How do AdBlockers Work?
AdBlocker Ultimate is designed with a single goal in mind to block ALL ads and bring your focus back to the thing that matters – content. AdBlocker Ultimate will also block any malicious software or online tracker on the web. Thanks to its powerful features, this extension will boost your browser’s performance even further and make your time spent online even more exciting. Mar 13, 2018 Click the extension icon, and then choose the “Options” entry. This opens a new browser tab. On that tab, click the “Customize” option at the top. There are quite a few options on the “Customize” page, but you’re looking for the “Show ads everywhere except for these domains” option. Click it to expand a new input box.
First we need to understand how adblockers work. While a web page is loading the browser is downloading the HTML code with all the referenced internal and external resources such as images, CSS stylesheets and JavaScript files.
AdBlock, ABP and other ad blocker extensions have a list of keywords that mark elements that won't be allowed to be loaded and rendered. For example the webpage won't display images with the blacklisted 'adBar' class. This 'blacklist' includes but is not limited to HTML elements. It doesn't load JS files named ads.js or iframes with URL parameters like ?adCount=.
Google AdSense is the most popular advertising platform used by publishers to monetize their websites. To block them, ad blockers disable loading its main script, called adsbygoogle.js. This can speed up the loading speed considerably.
For the complete list of blocked elements visit easylist.txt.
How To Detect AdBlock?
![Adblock Options Not Showing Adblock Options Not Showing](https://en.stealthsettings.com/wp-content/uploads/2013/06/ieadblocknotification.jpg)
Now that we understand how they work we can fight back. Wrap your ad banners in a div element and check its height with a script. If the banner didn't load then the height of the wrapper is zero.
We have the #wrapper div and an .adBar div inside of it with a non-breaking space character. If the browser does render the .adBar then the size of #wrapper will be greater than 0. Our script is executed one second (1000 milisecods) after the page has finished loading. It checks the offsetHeight of #wrapper and displays a message if it's height is greater than 0.
If you use AdSense then you don't need the .adBar div. Simply put your AdSense banner in the #wrapper and you are ready to go. Read more about this solution here
Other Option, Using ads.js
I have mentioned that ad blockers disable external JavaScript files that are named as one of the blacklisted keywords, like ads.js.
Our simple example below shows a text warning to visitors, asking them to disable AdBlock and loads an external ads.js script that hides the message.
HTML markup:
External JavaScript, named ads.js:
Adblock Plus Options
As you can see, there are many ways to detect leeching visitors. You have seen how to detect them and using one of these examples you can implement your own custom solution.
How To Access Adblock Settings
Unfortunately we can't bypass ad blockers but we can completely disable websites for unwanted visitors or we can ask them nicely to allow ads.