Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

detect adblock javascript

      window.onload = function() {
        setTimeout(function() {
          var ad = document.querySelector("ins.adsbygoogle");
          if (ad && ad.innerHTML.replace(/s/g, "").length == 0) {
            ad.style.cssText = 'display:block !important';
            ad.innerHTML = "You seem to blocking Google AdSense ads in your browser.";
          }
        }, 2000);
      };
Source by www.labnol.org #
 
PREVIOUS NEXT
Tagged: #detect #adblock #javascript
ADD COMMENT
Topic
Name
2+5 =