How to create ad blocker extension that works on all websites

Hi Guys,

I am trying to build an ad blocker for learning purpose that hides/blocks ads on all websites. So far I am able to hide ads from specific website by targeting the DOM element of that ad and setting its display to none.

Is there a way to do that? If yes, can someone points me in that direction?

Thank you!

1 Like

You and everyone else :slight_smile:

I suppose the toughest problem to solve when building an ad blocker is determining just what is an ad and what isn’t so you only block ads. And I’m sure advertisers are constantly looking for ways to get around all the methods ad blockers are using to try and block them.

One thing you could do is look at how other ad blockers are doing it to. For example, uBlock is completely open source so you can clone their repo and start messing around with it. I’m sure if you search you can also find articles on how ad blocking software works.

Good luck!



Exactly, it’s a cat and mouse game. I’ll check the UBlock repo and see if I can get anythign out of it. I was more focussing on how AdBlock Plus is filtering ads. Havn’t got to the code yet. They are open source too.

Thank you for taking the time to write. :slight_smile:

1 Like