Skip to content

Instantly share code, notes, and snippets.

@DKunin
Created July 29, 2016 12:45
Show Gist options
  • Select an option

  • Save DKunin/cf04206ae31b8d6b2e58f251e0042286 to your computer and use it in GitHub Desktop.

Select an option

Save DKunin/cf04206ae31b8d6b2e58f251e0042286 to your computer and use it in GitHub Desktop.
Somekind of adblock detector
function nbes_get_adblock_status()
{
var patt = new RegExp("Android");
var res = patt.test(window.navigator.userAgent);
var patt1 = new RegExp("UCBrowser");
var res1 = patt.test(window.navigator.userAgent);
if(res && res1)
{
nbes_loaded = true;
nbes_bypass("#mmm");
}
var el = document.createElement("img");
el.src = "http://adserver.adtech.de/adserv|3.0|1253.1|3552681|0|744|ADTECH;loc=300;key=key1+key2+key3+key4;alias=";
el.onload= function()
{
nbes_loaded = true;
el.parentNode.removeChild(el);
nbes_adblock = false;
};
el.onerror = function ()
{
nbes_loaded = true;
}
document.head.appendChild(el);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment