Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
js
LICENSE
README.md
ad-detect.html
index.html

README.md

AdBlock Detect (adBDetect)

Calling Javascript file

<script type="text/javascript" src="https://muhbayu.github.io/adBDetect/js/adbdetect.packed.js"></script>

Setup

Normal (default option)

adBDetect().start();

With options

var adBD = adBDetect().setup({
    debug:true, // (optional)
    setPage:'ad-detect.html',
    wait:1000, // 1000 = 1 sec (default: 500)
});
adBD.start();

OR

adBDetect().setup({
    debug:true, // (optional)
    setPage:'ad-detect.html',
    wait:1000, // 1000 = 1 sec (default: 500)
}).start();

Custom check if AdBlock Detected

// value: boolean
adBDetect().isDetected();

Example for custom notification

var adBD = adBDetect();
if(adBD.isDetected()) {
  alert('Please disable your AdBlock before access this page!');
}

Instance

Calling javascript file

<script type="text/javascript" src="https://muhbayu.github.io/adBDetect/js/adbdetect.packed.js"></script>

After that

var adBD = adBDetect().setup({
    debug:true,
    setPage:'ad-detect.html',
    wait:1000, // 1000 = 1 sec (default: 500)
});
adBD.start();
if(adBD.isDetected()) {
    //custom alert
}