Detecting Adblockers and displaying a message of guilt

Most websites today are supported by ads. It’s a great system, and it’s become the main source of revenue for many websites.

Problem is, some people block ads. They block them for several reasons, one is because some sites have really awful ads, another is they’re just an *** and don’t care.

Whatever the reason is, it’s important to get users to stop blocking ads. So, I created a set of scripts that will detect when a user has an adblocker installed and then display a message accordingly. It’s based on Erik Swan’s implementation, and you can see it in action at

You can download it on GitHub here:

By the way, I’m really excited that I’ve finally uploaded something to github. Woot.

Hi! I'm Luke Harris.

I make websites for people.

I'm based in Corpus Christi, Texas, and I have over 10 years of experience making it easy for small business owners, non-profits, and religious organizations to reach more people online.

5 thoughts on “Detecting Adblockers and displaying a message of guilt”

  1. If ads were simply an image I would not care, but trying to multitask with ram hungry programs means I don’t want flash running period.

    • Easy to prevent flash from running unless you need it with Chrome. 

      • So you’re going to make the end user do extra work to toggle flash on and off? Easier to just run adblock. Then I don’t have to toggle shit all day long. Ad makers brought this upon themselves by making annoying ads with flashy graphics and sound. If you kept the ads non-intrusive, there wouldn’t be an adblock. I take sites off adblock that I care about, but mostly I just run it.
        Write a script that denies access to adblock users if you’re so concerned about us, so we can gladly gtfo and find an alternative site or put you on the whitelist.

      • It’s a click to play system so it’s really not that much of a deal to enable that option in Chrome. Do what you want though. This script is mostly for noobs who only know how to install adblock and not how to manually block ads with it.

  2. Pingback: Displaying ads the nice way | lucasbytegenius

Comments are closed.