Is It Possible To Create Your Own AdBlocker?

Ever since my last post here, I was trying to determine why I was having issues with the AdGuard browser extension & why it wouldn’t display certain images properly in the browsers I use. I only received a few responses from AdGuard support. We tried some troubleshooting, but that didn’t really get me very far. They did however assure me that they will look further into the issue, but I honestly have the feeling I won’t hear anything else from them. And the post I made on their forum only got 1 response which wasn’t much help at all & that was it. I haven’t seen or heard anything else. So, “Where does that leave you?” you might ask. In a difficult position to say the least. :confused:

TBH, I’ve been a bit angry that I haven’t gotten more help regarding this, but I’m not trying to take it personally; I’m just really frustrated about the whole ordeal. But after thinking it over in my mind, I actually had an inspiration: Is it possible for someone to create their own adblocker? [Not a program, just a browser extension & how difficult would it be for someone who has had no experience with coding or even creating a piece of software, etc.?] :thinking:

Well, I think by now you guys know the drill: If you have anything to say, wish to ask, or need to know, just go right ahead & I’ll be sure to provide you with all the necessary details! Thanks in advance to anyone who might be able to help! :slight_smile:

1 Like

Hi, Welcome back!

I see you are still having issues, and I’m really impressed that you’re looking at browser extensions.
Good on you!

I’ve never built a blocker myself, but use several, and have never built an extension, but might offer just a couple of things to start thinking?

There are already several extensions that you can use as inspiration, but first things first, you might want to work out which of the many forms of Ads you want to block?

Also, ads have been put there by the website creator.
Either by providing a box into which an advertising firm puts ads, or as a direct ad displayed by the website owner.

First work out which frames, boxes, pop-ups, redirects, cross-site-scripts etc you might want to block, then perhaps you can start on an extension?

Well, for starters you can add your own filters to uBlock Origin – it’s highly customizable.
Otherwise, you can go ahead and fork it, thus making your own variant of uBlock without the need to start from scratch.

1 Like

Not to worry. I already know the types of ads I wish to block: just irrelevant ads on any websites, ones that can lead to malware/adware/viruses/ransomware, etc. There are TONS of ads even on these movie sites that can be really annoying! And I have tried other adblockers before, but it just seems like I haven’t been able to find the right fit ever since this issue with AdGuard. :roll_eyes:

So at least that should give you a ballpark figure as to what I’m after. Only problem is I’ve never actually coded, or even built a piece of software or a browser extension before. That tells you right there that I’m quite inexperienced but willing to learn nonetheless! :slight_smile:

Sounds like a good devember project. :smiley:

Well, I’m all ears & open to suggestions/tips/advice if anyone has any to offer!

I’d start with some beginner javascript tutorials, and go from there.

Then, once you’ve got a feeling for the basics you can move into the stuff that’s specific to writing a browser extension.

https://developer.chrome.com/extensions/getstarted

What’d be really nifty is if you could make it smarter than most other ad blockers and find some way of detecting ads without consulting a list of known domains as most ad blockers do.

IMO it depends on how deep down the rabbit hole you want to go. Programming a browser baised blocker from the ground up is way out of my knowledge range.
However I do know that a raspberry pie baised dns level add blocker “pie hole” is a fairly simple and fun project that is very well documented and almost anyone can accomplish might serve your purpose.

2 Likes

True. I even noticed that Linus Tech Tips did a video on it. I’m just not sure if it’s the right solution for me though.

Dissenter
Which is an off shoot of Brave…

A couple of reference points.

You could just edit the hosts file on your computer to point things like ad.doubleclick.net to 127.0.0.1, if you want true simplicity.

I noticed you recommended Dissenter for me. But I’m a little confused, what’s the difference between this browser & brave since it’s based on it?

Not sure ? I have never used brave. The code base is based off of it.

I have used Dissenter but it is far too basic for my use. I am mostly Firefox person with my own collection of extensions that i use constantly.

To be honest … Use firefox and Ublock origin and call it a day.

So you if don’t think Dissenter is worth it, then why bother to suggest it if it’s “basic”?

Examples of adblock built into a browser.

So you if don’t think Dissenter is worth it, then why bother to suggest it if it’s “basic”? Also, I have tried using ublock origin before, but I’m not really a fan of how all their settings are arranged. Just a little too cluttered for my tastes.

I suggest you go out and look around more. This conversation is done.

Yes it is. Learn JavaScript or TypeScript, HTML, and CSS. Then start learning from the UBlock Origin repo at GitHub. Once you know how Ublock Origin ticks, amend the code and take it to every web browser you want.
For example, Ublock Origin knows how to defeat Tweaktown’s and Yahoo Mail’s delayed check for missing ads.

I found this article on web
https://levelup.gitconnected.com/building-your-own-adblocker-in-literally-10-minutes-1eec093b04cd