Search code examples
javascripthtmladblock

Ad Blocking | Create Dummy Page


I'm trying to create a static HTML page with a dummy ad on screen to get Ad Blocker to detect there is an ad on the page.

So far I've found this isn't as simple as copying ad code you find on other sites.

Is there anyway to achieve this and have ad blocker trigger? Is there a specific class list of what ad blocker searches the DOM for?

These are the classes I've found so far and have this as part of my Javascript object searching the DOM

baitClass:          'test pub_300x250 pub_300x250m pub_728x90 text-ad textAd text_ad text_ads text-ads text-ad-links'

HTML

<div class="outline">
                    <div class="test pub_300x250"></div>
                </div>
            </div>

This unfortunately isn't working.


Solution

  • If you are referring to Adblock Plus, there is a quite extensive description on the creators' web site.

    The matching algorithm contains both trivial and non-trivial elements (like a modified Boyer-Moore algorithm), and a simple effort like your own is not enough to correctly evaluate how the system works. I suggest you go to the source and read more:

    If you are asking about ad blockers in general, you have a lot of work ahead of you. The ads business and the ad blockers are playing cat-and-mouse with implementations and detection, and as an outside party, you are probably always a couple of generations behind.

    Also, if you are serving your "dummy page" locally (from the file system or on localhost), ad blockers probably don't detect anything.