Minimal Adblock/Adblock Plus Detector With jQuery

Minimal Adblock/Adblock Plus Detector With jQuery

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.

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.

  • Publication date: 09.11.2018
  • Source