Peter posted this on June 11, 2023
We all have little annoyances when browsing the internet, and if you’re anything like me, always fixing, you’ve probably thought at some point, “I wish there was a way to fix this.” Well, that’s precisely the predicament I found myself in while browsing the Nairaland forum.
Nairaland, as many of you know, is a broad-spectrum forum where users can discuss a wide range of topics. But with such a vast user base comes a common issue – spam. There are those users who repeatedly post the same thing, turning a once enjoyable browsing experience into a spam-filled nightmare – especially when you try to search on the forum.
So, I decided to do something about it. I took it upon myself to create a Chrome extension that hides posts from spammers on the Nairaland forum, un-creatively named Hide Spam Posts on Nairaland.
The concept was simple – create an extension that would hide posts from users who are spamming the forum while you browse. By removing these posts from view, the browsing and search experience on the forum would be significantly improved. It’s a small tweak, but one that I believe makes a world of difference.
The extension was built primarily using JavaScript (79.4%), with some CSS (12.5%), and HTML (8.1%) thrown into the mix. The main files that drive the functionality of the extension are:
content.js
: This is where the magic happens. It contains the logic for identifying and hiding spam posts.popup.html
, popup.css
, and popup.js
: These files handle the popup functionality of the extension, allowing users to see which usernames are hidden and unhide posts if needed.manifest.json
: This file provides important information about the extension to Chrome, like its name, version, and permissions it requires.Like any development project, building the extension was not without its challenges. I encountered a bug where not just the spam posts, but also the headers were being hidden. I had to delve deep into my code, and after a bit of debugging, I was able to fix this issue.
The extension has gone through a couple of updates since its initial release. Here are some of the key features and improvements made over time:
Building the “Hide Spam Posts on Nairaland” Chrome extension has been a fulfilling journey. It reminded me that even the smallest annoyances could be opportunities for improvement and sometimes, all it takes is a bit of coding know-how to turn those opportunities into tangible solutions.
If you’re interested in trying out the extension, you can find it here. And for those who are keen to delve into the code, check out the GitHub repository. I hope this small project of mine can inspire others