6 methods of web page detection of AdBlock

some web pages are full of disgusting ads that hinder not only the acquisition of information, but also the mood of visitors. In particular, some irrelevant multimedia ads and pop-up windows not only make people feel harassed, but also easy to delay and waste precious time. Hence the famous cross platform AdBlock plug-in, which has its extensions or plug-ins on any mainstream browser, where users can install it and block most of the ad.

since AdBlock has a way of detecting ads and shielding them, as a web maker, there are actually ways of checking AdBlock in turn.

Why does

test AdBlock


this is a controversial issue: users choose not to see the destruction of advertising, advertising rights in the browser page, the site also has bundled advertising and information distributed to you together and charge advertisers show cost free. Both can not interfere with each other, and in the absence of clear laws and regulations in the environment, you can guard against me, I can guard you.


In addition to the

AdBlock directly to the "acceptable advertising website" for entering the white list to request directly from outside the shield, here are 6 starting from the site itself and AdBlock detection method related to the operation of the trigger.

The following

methods are done without modifying the ad code itself, because ad associations such as Google AdSense require no modification of the code.

detects the visible height of the ad module

this is a very simple method, the principle is very simple, is to detect the corresponding advertising module height is less than its height, if it is less than the empty collapse, it is enabled AdBlock.


code is similar to the following

if (document.getElementById (‘ads’).ClientHeight < 90) {

the feasibility of this scheme is medium. In some cases, AdBlock shields the processing of an ad after it is special. It does not cause the ad module to collapse, but maintains the set height and displays the blank. That time, it doesn’t work.

detects the number of visible ads

This is a

and the similar method is also very simple, that is to detect whether the current number of ads on a page as expected, because some advertisements may not trigger AdBlock rules to display a number of methods can be used to check the ads so.

Leave a Reply

Your email address will not be published. Required fields are marked *