AdBlocker in JavaScript code example
Example: 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);
};