Minimal Adblock/Adblock Plus Detector With jQuery

Minimal Adblock/Adblock Plus Detector With jQuery
File Size: 3.25 KB
Views Total: 2391
Last Update:
Publish Date:
Official Website: Go to website
License: MIT

An ultra-light jQuery Adblock Detector that helps developers to detect if there are extensions for blocking ads (e.g. Adblock, Adblock Plus) currently active in the browser.

How to use it:

1. Download and insert the JavaScript file jquery.adblock-detector.js after jQuery.

<script src="" 
<script src="jquery.adblock-detector.js"></script>

2. Detect whether the current browser has Adblock enabled.

  if (!adsEnabled) {
    // do something

3. Advanced usage. The plugin uses Sweetalert2 to show a warning popup when there is an Adblock extension is activated in the browser.

<link href="" rel="stylesheet">
<script src=""></script>
  if (!adsEnabled) {
      title: 'Adblock Detected',
      text: "You won't be able to access this page",
      type: 'warning',
      showCancelButton: true,
      confirmButtonColor: '#3085d6',
      cancelButtonColor: '#d33',
      confirmButtonText: 'Disable Adblock'
      }).then((result) => {
      if (result.value) {
        'Thank You!',
        'Refresh The Page',

This awesome jQuery plugin is developed by xxnoobmanxx. For more Advanced Usages, please check the demo page or visit the official website.