You are on page 1of 2

"use strict";!function(t){var e={},o="offset",n="client",r=function(){},i=!

1,l=void
0===t.addEventListener,a={loopDelay:50,maxLoop:5,testRemoteList:!0,debug:!
0,useLocalBait:!0,blockLists:[],found:r,notfound:r,complete:r};var u=function(t)
{var e=new XMLHttpRequest;this.success=t.success||r,this.fail=t.fail||r;var
o=this,n=t.method||"get";this.abort=function(){try{e.abort()}catch(t)
{}},e.onreadystatechange=function(t){4==e.readyState&&(200==e.status?
o.success(e.response):o.fail(e.status))},e.open(n,t.url,!0),e.send()},s=function()
{var t={};this.addUrl=function(e){return
t[e]={url:e,state:"pending",format:null,data:null,result:null},t[e]},this.setResult
=function(e,o,n){var r=t[e];if(null==r&&(r=this.addUrl(e)),r.state=o,null!=n)
{if("string"==typeof n)try{n=function(t){var e,o;try{e=JSON.parse(t)}catch(n)
{try{o=new Function("return "+t),e=o()}catch(t){g("Failed secondary JSON parse",!
0)}}return e}(n),r.format="json"}catch(t){r.format="easylist"}return
r.data=n,r}r.result=null}},c=[],d=null,f={cssClass:"pub_300x250 pub_300x250m
pub_728x90 text-ad textAd text_ad text_ads text-ads text-ad-links"},p={nullProps:
[o+"Parent"],zeroProps:
[]};p.zeroProps=[o+"Height",o+"Left",o+"Top",o+"Width",o+"Height",n+"Height",n+"Wid
th"];var m={quick:null,remote:null},v=null,y={test:0,download:0};function b(t)
{return"function"==typeof t}function g(e,o){(a.debug||
o)&&t.console&&t.console.log&&(o?console.error("[ABD] "+e):console.log("[ABD]
"+e))}var h,w=[];function k(t){var e,o;h.addUrl(t),e=new
u({url:t,success:function(e){g("downloaded file
"+t),o=h.setResult(t,"success",e);try{var n=0,r=0,l=function(t){return!i&&(x(t,!
0),!0)};if(1==v)return;if(l(o.data))return;g("Pause before test
execution"),n=setInterval(function(){(l(o.data)||r+
+>5)&&clearInterval(n)},250)}catch(e){g(e.message+" url: "+t,!0)}},fail:function(e)
{g(e,!0),h.setResult(t,"error",null)}}),w.push(e)}function P(){var
t,e=a;for(t=0;t<e.blockLists.length;t++)k(e.blockLists[t])}function x(t,o){g("start
beginTest"),1!=v&&(i=!0,L(t),o?
m.remote="testing":m.quick="testing",y.test=setTimeout(function(){!function t(o,n)
{var r;var l=document.body;var u=!1;var s=null;null==d&&(g("recast bait"),L(o||
f));if("string"==typeof o)return g("invalid bait used",!
0),void(D()&&setTimeout(function(){i=!
1},5));y.test>0&&(clearTimeout(y.test),y.test=0);null!
==l.getAttribute("abp")&&(g("found adblock body attribute"),u=!
0,s="body_abp_attr");if(!u){for(r=0;r<p.nullProps.length;r++)
{if(null==d[p.nullProps[r]]){u=!0,g("found adblock null attr:
"+p.nullProps[r]),s="null_attr
"+p.nullProps[r];break}if(1==u)break}for(r=0;r<p.zeroProps.length&&1!=u;r+
+)0==d[p.zeroProps[r]]&&(u=!0,s="zero_attr "+p.zeroProps[r],g("found adblock zero
attr: "+p.zeroProps[r]))}if(!u&&void 0!==window.getComputedStyle){var
m=window.getComputedStyle(d,null);"none"!=m.getPropertyValue("display")&&"hidden"!
=m.getPropertyValue("visibility")||(u=!0,s="computedStyle indicator",g("found
adblock computedStyle indicator"))}!0;if(u||n++>=a.maxLoop)
{v=u;try{u&&e.blockerDetected(s,n)}catch(t){g(t.message)}g("exiting test loop -
value: "+v),function(){var t,e;if(null===v)return;for(t=0;t<c.length;t++)
{e=c[t];try{null!=e&&(b(e.complete)&&e.complete(v),v&&b(e.found)?e.found():!
1===v&&b(e.notfound)&&e.notfound())}catch(t){g("Failure in notify listeners
"+t.Message,!0)}}}(),D()&&setTimeout(function(){i=!1},5)}else
y.test=setTimeout(function(){t(o,n)},a.loopDelay)}(t,1)},5),!
o&&a.testRemoteList&&P())}function L(t){var e,o=document.body,n="width: 1px !
important; height: 1px !important; position: absolute !important; left: -10000px !
important; top: -1000px !important;";if(null!=t&&"string"!=typeof t){for(null!
=t.style&&(n+=t.style),d=function(t,e){var
o,n,r=e;if(n=document.createElement(t),r)for(o in
r)r.hasOwnProperty(o)&&n.setAttribute(o,r[o]);return n}("div",
{class:t.cssClass,style:n}),g("adding bait node to
DOM"),o.appendChild(d),e=0;e<p.nullProps.length;e+
+)d[p.nullProps[e]];for(e=0;e<p.zeroProps.length;e++)d[p.zeroProps[e]]}else
g("invalid bait being cast")}function D(){if(null===d)return!
0;try{b(d.remove)&&d.remove(),document.body.removeChild(d)}catch(t){}return
d=null,!0}function E(){var e,o,n,r,i=!
0;document.readyState&&"complete"==document.readyState&&(i=!0),e=function()
{a.useLocalBait?x(f,!1):(g("ignoreing local bait - download remote"),P())},i?e():
(o=t,n="load",r=e,l?o.attachEvent("on"+n,r):o.addEventListener(n,r,!1))}var
T={init:function(t){var e,o;if(t){o={complete:r,found:r,notfound:r};for(e in
t)t.hasOwnProperty(e)&&("complete"==e||"found"==e||"notFound"==e?
o[e.toLowerCase()]=t[e]:a[e]=t[e]);c.push(o),h=new s,E()}}};t.detector=T,e={key:
{BLOCKER:"AdBlocker",FOUND:"Found",NOT_FOUND:"NotFound",DETECT:"IABDetect"},recordE
vent:function(t,o,n,r)
{e.redirect(),window.ga&&ga("send","event",t,o,n,r)},redirect:function(){var
t=document.getElementById("block-detector");if(t){var e=t.getAttribute("data-
redirect");e&&(window.location=e)}else
window.location="/blocked.cms"},blockerDetected:function(t,o){var
n=e.key;e.recordEvent(n.DETECT,n.FOUND,t,o)},blockerNotDetected:function(){e.key}}}
(window),window.detector.init({});

You might also like