Skip to content

alimogh/adblocker-detector

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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!

About

Detect if your visitors are using an ad blocker

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%