block-ads icon indicating copy to clipboard operation
block-ads copied to clipboard

Create a "no ad blocker detected script"

Open hdkw opened this issue 7 years ago • 2 comments

Hi thank you so much for your work! I think the problem of advertising is totally underestimated and your initiative is important. It would be great to have something that independent websites could use to assert their difference and attack sites that sell their users: a script that would mirror the ad blocker detection of corporate sites only to show a message when the user is NOT using an ad blocker. Something like what you are already doing : "we detected that you are not using an ad blocker!"..

I'm don't know much about html but basically my question is : is it possible to change a bit your work to include it on a website so that nothing happens when adblocking is on and a message appears to suggest using an ad blocker when adblocking is off?

hdkw avatar Jan 21 '17 06:01 hdkw

Thank you for the kind words. :)

It is possible to do this. In fact, we do it on FiveFilters.org. If a visitor to our site does not have ad blocking enabled, they will see a link in the top navigation to our Block Ads! site. If they do, that link will not display.

We've been meaning to make a simple cut and paste HTML snippet for this purpose. For the time being you can use what's posted here: https://forums.lanik.us/viewtopic.php?f=85&t=30824 Inserting the CSS block and HTML block in your site should do the job. Although we generally do not recommend Adblock Plus. So I would change the URL and link text to either point to uBlock Origin or our Block Ads! site (uBlock Origin does not yet have a nice home page to tell the user which version of their application they need to install).

When I get some time, I will try and do a version based on this to promote uBlock Origin instead and I'll post it here.

If you're curious about how this works, the key part of the method above is the inclusion of the class attribute value "GoogleAd":

<div class="abp-box abp-msg GoogleAd">Install...

Ad blockers that rely on Easy List (e.g. AdBlock Plus, uBlock Origin and many others) will see that as a sign that what it holds is an ad, and so they won't show it. Users who don't have an ad blocker will see the contents, which in this case is not an ad, but a message to install an ad blocker.

fivefilters avatar Jan 24 '17 19:01 fivefilters

Thanks for your answer, this is great and I'm looking forward for your snippet. How can I contact you privately by the way ?

hdkw avatar Jan 26 '17 08:01 hdkw