Skip to content

Instantly share code, notes, and snippets.

@codepo8
Created November 14, 2022 23:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codepo8/e45811f26e74daf893ff5eadd8e7dc37 to your computer and use it in GitHub Desktop.
Save codepo8/e45811f26e74daf893ff5eadd8e7dc37 to your computer and use it in GitHub Desktop.
Adblocker detection found in the wild
function hab() {
var t = document.createElement('div');
t.innerHTML = ' ';
t.className = 'ad doubleclick google-ad adsbox pub_300x250 pub_300x250m pub_728x90 text-ad textAd text_ad text_ads text-ads skyscraper text-ad-links';
var e = !(t.style = 'width: 1px !important; height: 1px !important; position: absolute !important; left: -10000px !important; top: -1000px !important;');
try {
document.body.appendChild(t);
var a = document.getElementsByClassName('adsbox')[0];
if (0 !== a.offsetHeight && 0 !== a.clientHeight || (e = !0), void 0 !== window.getComputedStyle) { var d = window.getComputedStyle(a, null); !d || 'none' != d.getPropertyValue('display') && 'hidden' != d.getPropertyValue('visibility') || (e = !0) } document.body.removeChild(t)
}
catch (a) { }
return e
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment