/adblock-detection-script

JavaScript function to detect the presence of an ad blocker.

Primary LanguageJavaScript

Adblock Detection Script (JavaScript)

JavaScript function to detect the presence of an ad blocker. More info in the blog post on AdGlare Ad Server.

Usage

Include the JS file, and then call the function hasAdblock().

Example

<script src='adblock-detection-script.js'></script>
<script>
  if(hasAdblock()) {
    //do something
  } else {
    //do something
  }
</script>