Skip to content

Latest commit

 

History

History
30 lines (23 loc) · 618 Bytes

README.md

File metadata and controls

30 lines (23 loc) · 618 Bytes

adblocker-detector

adblocker-detector is a tiny javascript function for detecting whether or not your visitors are using an ad blocker.

Example usage:

detectAdBlock(function(active){
    if (active) {
        alert('AdBlocker detected!');
    } else {
        alert('AdBlocker not detected. All clear');
    }
});

* Once executed, ad blocker status is made available via window.__adblocker__, so for future runs, use:

if (window.__adblocker__) {
    alert('AdBlocker detected!');
} else {
    alert('AdBlocker not detected. All clear');
}

Enjoy!