📜  检测 adblock javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:19.748000             🧑  作者: Mango

代码示例1
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);
      };