/AdBlockCheck

Check if your visitors have AdBlock enabled

Primary LanguageJavaScript

AdBlockCheck v1.0

Do you have a site with ads that want people to see? AdBlockCheck to the rescue! This is a 1KB module for detecting AdBlock with async callbacks for notifying visitors.

It's up to you if you provide a simple hint that you'd like your visitors to see ads or prompt them with an alert.

Usage

I recommend adding the script tags before the </body> tag (source).

adblock.check() accepts 2 parameters: A callback function and an optional delay.

<script src="adblockcheck.js"></script>
<script>
adblock.check(function (active) {
    if (active) {
        // AdBlock is currently enabled
    }
}, 500);
</script>

Demo

You can see a demo on jsfiddle.net here!