Search code examples
browserfirefox-addonadblock

Block all content on a web page for people using an Adblock-type browser add-on/extension?


I wish to block ALL my content from any users using an ad-blocking browser extension (ie. Adblock Plus for Firefox, Adthwart for Chrome).

How can I acheive this? Is there a server-side solution? Client-side?


Edit 1 This question regards the detection of ad-blocking browser extensions:

Detecting AdBlocking software?

I'm concerned with post-detection action.


Edit 2 A duplicate question was asked after mine, so I thought I'd link to it here:

Prevent Adblock Users from Accessing Website?


Solution

  • To detect if the user is blocking ads, all you have to do is find a function in the ad javascript and try testing for it. It doesn't matter what method they're using to block the ad. Here's what it looks like for Google Adsense ads:

    if(typeof(window.google_render_ad)=="undefined") 
    { 
        //They're blocking ads, do something else.
    }
    

    This method is outlined here: http://www.metamorphosite.com/detect-web-popup-blocker-software-adblock-spam