brooklet / AdBlockCheck

Check if your visitors have AdBlock enabled

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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!

About

Check if your visitors have AdBlock enabled


Languages

Language:JavaScript 77.1%Language:HTML 22.9%