Skip to content

Instantly share code, notes, and snippets.

@mywaiting
Last active December 8, 2020 19:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mywaiting/0603edb5b78a8e2af05216ea043c3745 to your computer and use it in GitHub Desktop.
Save mywaiting/0603edb5b78a8e2af05216ea043c3745 to your computer and use it in GitHub Desktop.
儿童不宜网站抓到的 popunder.js 存个 gist 作为记录
(function() {
var d = window;
// d['_pop']
/**
[
[
"siteId",
2776682
],
[
"minBid",
0
],
[
"popundersPerIP",
0
],
[
"delayBetween",
0
],
[
"default",
false
],
[
"defaultPerDay",
0
],
[
"topmostLayer",
false
]
]
**/
d["\u005f\x70\u006fp"] = [
["s\u0069\u0074e\u0049\x64", 2776682],
["mi\u006eBi\x64", 0],
["\u0070\x6fp\x75nd\u0065\x72s\x50\x65r\u0049\x50", 0],
["d\u0065\x6ca\x79\u0042\x65t\x77\x65e\x6e", 0],
["\u0064\x65\u0066\u0061\x75l\u0074", false],
["\u0064\x65fa\x75\u006c\x74\u0050\u0065r\x44a\u0079", 0],
["t\u006f\x70m\u006fst\x4cay\u0065\u0072", !1]
];
/**
var b = [
"//c1.popads.net/pop.js",
"//c2.popads.net/pop.js",
"//www.pyfmxzhrnivq.com/pt.js",
"//www.qvgjqhfnbdeur.com/yov.js",
""
]
*/
var b = ["\u002f\x2f\x63\x31\x2ep\u006f\x70\u0061\u0064\x73.n\u0065\x74\x2fp\u006f\x70.j\u0073", "\u002f\x2fc\u0032\x2epo\u0070\u0061\u0064\u0073\x2en\x65t\u002f\x70o\u0070.j\x73", "\x2f\x2fw\u0077w\u002epyfm\u0078\u007a\u0068rni\x76\u0071.\x63\u006fm/p\x74\x2ej\u0073", "/\u002f\u0077\u0077\u0077\u002eq\u0076\x67j\u0071\x68f\x6e\u0062\u0064e\x75r.c\u006fm\u002f\x79ov\x2e\u006as", ""],
x = 0,
o, p = function() {
if ("" == b[x]) return;
// document.createElement
o = d["d\u006f\u0063\u0075\u006d\x65\u006e\u0074"]["\u0063\x72\x65\x61\u0074\u0065\u0045l\u0065ment"]("sc\u0072\u0069\x70\u0074");
o["\u0074\x79\u0070\x65"] = "te\x78\x74\x2fj\u0061\u0076as\u0063\u0072\u0069\x70\u0074";
o["\x61\u0073ync"] = !0;
var f = d["\u0064\u006fc\x75men\x74"]["\x67\u0065t\x45\x6c\x65\u006de\x6e\x74\u0073\x42\u0079Ta\u0067\u004e\x61m\x65"]("scr\x69p\u0074")[0];
o["s\u0072c"] = b[x];
if (x < 2) {
o["\u0063\u0072\x6fs\x73\u004fr\x69\u0067i\u006e"] = "\u0061\x6e\x6fnymous";
o["i\x6e\x74eg\u0072\u0069t\u0079"] = "s\x68a\u00325\u0036\u002d2\u0070\x7aYzD\u006b\u0056\u006c\u0031\x6bE\u00330\u0055he\u0043r\x55\x71d\u0037\x31r\u00372B\x72\u0078\x61\x35\u005a\u0041Q\x78\u0041\x62\u0057w\x34i\u0049\x3d"
};
o["\x6f\x6e\x65\u0072\x72\u006f\u0072"] = function() {
x++;
p()
};
f["\x70\x61\u0072e\u006e\u0074\x4e\u006f\x64e"]["in\x73\x65\x72\u0074B\x65f\x6fre"](o, f)
};
p()
})();
Function.prototype.bind || (Function.prototype.bind = function(a) {
if ("function" !== typeof this) throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
var c = Array.prototype.slice.call(arguments, 1),
b = this,
d = function() {},
e = function() {
return b.apply(this instanceof d && a ? this : a, c.concat(Array.prototype.slice.call(arguments)))
};
d.prototype = this.prototype;
e.prototype = new d;
return e
});
var popjs = {
_cookieLockSet: function(a) {
var c = "1";
a && (c = "0");
if (localStorage) return localStorage.setItem("PopJSLock", c), !0;
a = new Date;
var b = 6E4;
a.setTime(a.getTime() + b);
b = "expires=" + a.toUTCString();
document.cookie = "PopJSLock=" + c + ";" + b + ";path=/";
return !0
},
_cookieLockGet: function() {
var a = !1;
if (localStorage) return localStorage.PopJSLock && (a = "1" == localStorage.PopJSLock), localStorage.setItem("PopJSLock", "0"), a;
for (var c = decodeURIComponent(document.cookie).split(";"), b = 0; b < c.length; b++) {
for (var d = c[b];
" " == d.charAt(0);) d = d.substring(1);
0 == d.indexOf("PopJSLock=") && "1" == d.substring(10, d.length) && (a = !0)
}
a && this._cookieLockSet(!0);
return a
},
_windowOpen: function(a, c) {
var b = "" + Math.random();
"msie" == this.cap.env.b && 9 >= this.cap.env.v && (b = "");
b = c ? window.open("", b, c) : window.open("", b);
try {
b.location.replace(a)
} catch (d) {}
return b
},
_openTabup: function(a) {
return this._windowOpen(a)
},
_openTabunder: function(a) {
if (0 == this.cap.tabunder) this._openTabup(a);
else {
this._cookieLockSet(!1);
var c = this._openTabup(document.location.href);
this.ti = setInterval(function() {
if (c) try {
document.location.replace(a)
} catch (b) {
clearInterval(this.ti)
}
}.bind(this), 10)
}
return !0
},
_getOptString: function() {
return optstring = "top=" + (window.screenY || 0) + ",left=" + (window.screenX || 0) + ",width=" + (0 == window.outerWidth ? 9999 : window.outerWidth || window.screen.width) + ",height=" + (0 == window.outerHeight ? 9999 : window.outerHeight || window.screen.height) + ",status=0,location=1,toolbar=1,menubar=1,resizable=1,scrollbars=1"
},
_openPopup: function(a) {
return this._windowOpen(a, this._getOptString())
},
_openPopunderSafari: function(a) {
function c(a, c, e) {
var b = document.createElement("iframe");
b.style = "display:none;";
document.body.appendChild(b);
var d = b.contentWindow.document.createElement("script");
d.type = "text/javascript";
d.innerHTML = "window.parent = window.top = window.frameElement = null;window.mkp = function(url, name, opts) {var popWin = window.open(url, name, opts);try {popWin.opener = null} catch (e) {}return popWin;};";
b.contentWindow.document.body.appendChild(d);
a = b.contentWindow.mkp(a, c, e);
document.body.removeChild(b);
return a
}
window.name = "" + Math.random();
a = c(a, "" + Math.random(), this._getOptString());
c("", window.name, "");
window.name = null;
return a
},
_openPopunderBlur: function(a) {
a = this._openPopup(a);
try {
document.focus()
} catch (c) {}
window.focus();
a.blur();
return a
},
_openPopunderFF: function(a) {
var c;
setTimeout(function() {
c = this._openPopup(a);
"about:blank" == a && (this.prepop = c)
}.bind(this), 0);
setTimeout(function() {
var a = window.open("", "_self");
a && !a.closed && a.focus()
}, 0);
return !0
},
_openPopunderCRPre: function(a) {
var c = "<body>\t\t<script>\t\tvar s1i=0,s2i=0;window.name='';\t\tfunction posred(){window.resizeTo(100,100);if (window.screenY>100) window.moveTo(0,0); else window.moveTo(9999,9999)};\t\tfunction dance(){if (s1i==0 ){s1i=window.setInterval(function(){ posred(); }, 50);}posred();document.onmousemove=null;};\t\tdocument.onmousemove=dance;\t\tfunction phash(){return window.screenX+','+window.screenY+','+window.outerWidth+','+window.outerHeight};\t\tphashc=phash();s2i=setInterval(function(){if ((phashc!=phash())) { if(phashc.indexOf(',100,100') == -1) {dance();}; phashc=phash(); }},100);\t\tvar deploy=function()\t\t{\t\t\twindow.clearInterval(s1i);window.clearInterval(s2i);document.onmousemove=null;\t\t\twindow.moveTo(" + window.screenX + "," + window.screenY + ");\t\t\twindow.resizeTo(" + window.outerWidth + ", " + window.outerHeight + ");\t\t\tif (window.name=='') window.name='ready'; else\t\t\twindow.location.replace(window.name);window.onblur=null;\t\t};window.onblur=deploy;\t\tvar toi=setInterval(function(){if (window.name.length>5) {clearInterval(toi);setTimeout(function(){deploy()}, " + a + ");} },50);\t\t\x3c/script>";
a = window.open("", "", "top=9999,left=9999,width=100,height=100");
try {
a.document.open(), a.document.write(c), a.document.close()
} catch (b) {}
return a
},
_openPopunderCRPost: function(a) {
"ready" == this.prepop.name ? this.prepop.location.replace(a) : this.prepop.name = a
},
_getMinipopStatus: function(a) {
console.log(a);
if (!a || a.closed || !a.location) return "closed";
try {
var c = a.name
} catch (b) {
c = "error"
}
return "error" == c ? "success" : "" == c ? "waiting" : "ready" == c ? "prepopready" : 0
},
_openPopunderCR: function(a, c) {
var b = "<body>\t\t<script>\t\tvar s1i=0,s2i=0;\t\tfunction posred(){window.resizeTo(100,100);if (window.screenY>100) window.moveTo(0,0); else window.moveTo(9999,9999)};\t\tfunction dance(){if (s1i==0 ){s1i=window.setInterval(function(){ posred(); }, 50);}posred();document.onmousemove=null;};\t\tdocument.onmousemove=dance;\t\tfunction phash(){return window.screenX+','+window.screenY+','+window.outerWidth+','+window.outerHeight};\t\tphashc=phash();s2i=setInterval(function(){if (phashc!=phash()) { if(phashc.indexOf(',100,100') == -1) {dance();}; phashc=phash(); }},100);\t\tvar deploy=function()\t\t{\t\t\twindow.name='ready';\t\t\twindow.clearInterval(s1i);window.clearInterval(s2i);document.onmousemove=null;\t\t\twindow.moveTo(" + window.screenX + "," + window.screenY + ");\t\t\twindow.resizeTo(" + window.outerWidth + ", " + window.outerHeight + ");\t\t\twindow.location.replace('" + a + "');\t\t};window.onblur=deploy;setTimeout(deploy, " + c + ")\x3c/script>",
d = window.open("", "", "top=9999,left=9999,width=100,height=100");
try {
d.document.open(), d.document.write(b), d.document.close()
} catch (e) {}
return d
},
_openPopunderIE11: function(a) {
this.tw = this._openPopup(a);
this.focusInterval && clearInterval(this.focusInterval);
this.runs = 0;
this.focusInterval = setInterval(function() {
try {
this.tw && (this.tw.blur(), this.tw.opener.focus(), window.self.focus(), window.focus(), document.focus())
} catch (c) {}
this.runs++;
10 < this.runs && this.focusInterval && clearInterval(this.focusInterval)
}.bind(this), 100);
return this.tw
},
_detectBrowser: function(a) {
var c, b, d = "desktop";
if (b = a.match(/^Mozilla\/5\.0 \([^\)]+\) AppleWebKit\/[0-9\.]+ \(KHTML, like Gecko\) Chrome\/([0-9]+)[0-9\.]+ Safari\/[0-9\.]+$/)) var e = "chrome",
f = b[1];
if (b = a.match(/(Firefox|OPR)\/([0-9]+)/)) e = b[1].toLowerCase(), f = b[2];
if (b = a.match(/rv:([0-9]+)\.0\) like Gecko/)) e = "msie", f = b[1];
if (b = a.match(/MSIE ([0-9]+)/)) e = "msie", f = b[1];
a.match(/Windows NT/) && (c = "windows");
if (b = a.match(/([0-9]+)(_([0-9]+)){0,} like Mac OS X/)) c = "ios", e = "safari", f = b[1], d = "mobile";
if (b = a.match(/(CrOS)\/([0-9]+)/)) e = "chrome", f = b[2], d = "mobile";
if (b = a.match(/(Edge)\/([0-9]+)/)) e = b[1].toLowerCase(), f = b[2];
if (b = a.match(/\(KHTML, like Gecko\) Version\/([0-9]+)/)) e = "safari", f = b[1];
a.match(/Macintosh; Intel Mac OS X /) && (c = "macosx");
a.match(/Android|like Mac OS X|Mobile|Phone/) && (d = "mobile");
a.match(/^Mozilla\/5\.0 \(Linux; Android/) && (c = "android");
return {
o: c,
b: e,
v: f,
f: d,
i: window != window.top
}
},
_getBrowserCapabilities: function() {
var a = this._detectBrowser(navigator.userAgent),
c = !1,
b = !0,
d = !0,
e = !0;
"desktop" == a.f ? ("chrome" == a.b && (c = !0), "firefox" == a.b && (c = !0), "msie" == a.b && 11 > a.v && (c = d = e = !0), "msie" == a.b && 11 == a.v && (c = !0), "safari" == a.b && (c = !0)) : e = b = !1;
1 == a.i && (e = !1);
return {
env: a,
popup: b,
popunder: c,
tabup: d,
tabunder: e
}
},
_openPopunder: function(a, c) {
var b = this.cap.env;
if ("desktop" == b.f) {
if ("chrome" == b.b) return this.minipopmon = !0, this._openPopunderCR(a, c);
if ("firefox" == b.b) return this._openPopunderFF(a);
if ("msie" == b.b && 11 > b.v) return this._openPopunderBlur(a);
if ("msie" == b.b && 11 == b.v) return this._openPopunderIE11(a);
if ("safari" == b.b) return this._openPopunderSafari(a);
if ("edge" == b.b) return this.cap.tabunder ? this._openTabunder(a) : this._openPopup(a)
} else return this.cap.tabunder ? this._openTabunder(a) : this._openTabup(a)
},
_prepopOpen: function(a) {
"chrome" == this.cap.env.b ? this.prepop = this._openPopunderCRPre(a) : this._openPopunder("about:blank")
},
_prepopReady: function() {
return !(!this.prepop || this.prepop.closed || !this.prepop.location)
},
_prepopUse: function(a) {
this.settings.onbeforeopen && (a = this.settings.onbeforeopen(a));
try {
if ("chrome" == this.cap.env.b ? this._openPopunderCRPost(a) : this.prepop.location.replace(a), this.settings.onafteropen) this.settings.onafteropen(a)
} catch (c) {
return !1
}
return !0
},
_prepopClose: function() {
try {
this.prepop.close()
} catch (a) {
return !1
}
return !0
},
_openAd: function(a, c) {
this.settings.onbeforeopen && (a = this.settings.onbeforeopen(a));
var b = c.type;
"popunder" != b || this.cap.popunder || (b = "tabunder");
"tabunder" != b || this.cap.tabunder || (b = "popup");
"popup" != b || this.cap.popup || (b = "tabup");
"tabup" != b || this.cap.tabup || (b = "popup");
var d;
"popunder" == b ? d = this._openPopunder(a, c.crtimeout || this.settings.crtimeout) : "popup" == b ? d = this._openPopup(a) : "tabup" == b ? d = this._openTabup(a) : "tabunder" == b && (d = this._openTabunder(a));
if (d && this.settings.onafteropen) this.settings.onafteropen(a);
return d
},
_onExecute: function(a) {
a = a || window.event;
if ("click" == a.type || "mouseup" == a.type || "mousedown" == a.type) {
var c = !1;
"which" in a ? c = 3 == a.which : "button" in a && (c = 2 == a.button);
if (c) return !1
}
if (navigator.userActivation && !navigator.userActivation.isActive) return !1;
this.minipopmon && (a = this._getMinipopStatus(this.minipopmontw), console.log(a), "prepopready" == a || "success" == a ? (this.urls.shift(), this.minipopmon = !1) : "closed" == a && (this.minipopmon = !1));
0 == this.urls.length && this.settings.prepop && !this._prepopReady() && (this.settings.prepop = !1, this._prepopOpen(this.settings.crtimeout));
this.catchalldiv && 0 == this.urls.length && this._removeCatchAllDiv();
if (0 == this.urls.length) return !1;
this.settings.prepop = !1;
a = this.urls[0];
this.minipopmon = !1;
a = this._openAd(a.url, a.options);
this.minipopmon ? this.minipopmontw = a : a && this.urls.shift();
this.catchalldiv && 0 == this.urls.length && this._removeCatchAllDiv()
},
_userActivationHandler: function() {
navigator.userActivation.isActive && this._onExecute({
type: "uah"
})
},
_onMouseDownHandler: function(a) {
a = a.target || a.srcElement || a.toElement;
if ("A" != a.tagName) return !1;
if (a.popjsoriginalhref && 0 == this.urls.length) return a.href = a.popjsoriginalhref, delete a.popjsoriginalhref, a.target = "_blank", !1;
if ("_blank" != a.target || 0 == this.urls.length) return !1;
a.popjsoriginalhref = a.href;
a.href = "#";
a.target = ""
},
_onBeforeUnloadHandler: function() {
this._prepopReady() && this._prepopClose()
},
_isCatchAllNeeded: function() {
function a(a) {
a = document.getElementsByTagName(a);
for (var b = 0; b < a.length; b++) if (100 < (a.item(b).clientHeight || a.item(b).offsetHeight || 0) || 100 < (a.item(b).clientWidth || a.item(b).offsetWidth || 0)) return !0;
return !1
}
return a("IFRAME") || a("VIDEO") || a("OBJECT")
},
_removeCatchAllDiv: function() {
this.catchalldiv.parentNode.removeChild(this.catchalldiv);
delete this.catchalldiv
},
_createCatchAllDiv: function() {
if (0 == document.getElementsByTagName("body").length) return !1;
var a = document.createElement("div");
a.style = "position: fixed; display: block; width: 100%; height: 100%; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(0,0,0,0); z-index: 300000;";
document.addEventListener ? ("desktop" != this.cap.env.f && "ios" == this.cap.env.o && a.addEventListener("touchend", this._onExecute.bind(this)), a.addEventListener("click", this._onExecute.bind(this))) : a.attachEvent("onclick", this._onExecute.bind(this));
document.getElementsByTagName("body")[0].appendChild(a);
this.catchalldiv = a;
return !0
},
_deployCatchAll: function() {
this.settings.catchalldivoff && (this._isCatchAllNeeded() && !this.catchalldiv ? this._createCatchAllDiv() : this.catchallmon || (this.catchallmon = setInterval(function() {
this.catchalldiv ? clearInterval(this.catchallmon) : this._isCatchAllNeeded() && (clearInterval(this.catchallmon), this._createCatchAllDiv())
}.bind(this), 500)))
},
init: function(a) {
if (this._cookieLockGet()) return !1;
this.cap = this._getBrowserCapabilities();
this.urls = [];
this.settings = {};
this.settings.prepop = (a.prepop || !1) && this.cap.popunder;
this.settings.crtimeout = a.crtimeout || 6E4;
this.settings.targetblankhandler = a.targetblankhandler || !0;
this.settings.onbeforeopen = a.onbeforeopen;
this.settings.onafteropen = a.onafteropen;
this.settings.catchalldivoff = a.catchalldiv || !navigator.userActivation;
this._deployCatchAll();
navigator.userActivation && setInterval(this._userActivationHandler.bind(this), 50);
document.addEventListener ? ("desktop" != this.cap.env.f && "ios" == this.cap.env.o && document.addEventListener("touchend", this._onExecute.bind(this)), document.addEventListener("click", this._onExecute.bind(this)), this.settings.targetblankhandler && document.addEventListener("mousedown", this._onMouseDownHandler.bind(this)), this.settings.prepop && window.addEventListener("beforeunload", this._onBeforeUnloadHandler.bind(this))) : (document.attachEvent("onclick", this._onExecute.bind(this)), this.settings.targetblankhandler && document.attachEvent("onmousedown", this._onMouseDownHandler.bind(this)), this.settings.prepop && window.attachEvent("onbeforeunload", this._onBeforeUnloadHandler.bind(this)))
},
addUrl: function(a, c) {
if (!this.cap) return !1;
var b = !1;
this._prepopReady() && ("popunder" == c.type ? this._prepopUse(a) && (b = !0) : this._prepopClose());
b || (this.urls.push({
url: a,
options: c
}), this._deployCatchAll())
}
},
Base64 = {
a: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
encode: function(a) {
var c = "",
b = 0;
for (a = Base64.b(a); b < a.length;) {
var d = a.charCodeAt(b++);
var e = a.charCodeAt(b++);
var f = a.charCodeAt(b++);
var n = d >> 2;
d = (3 & d) << 4 | e >> 4;
var h = (15 & e) << 2 | f >> 6;
var k = 63 & f;
isNaN(e) ? h = k = 64 : isNaN(f) && (k = 64);
c = c + this.a.charAt(n) + this.a.charAt(d) + this.a.charAt(h) + this.a.charAt(k)
}
return c
},
decode: function(a) {
var c = "",
b = 0;
for (a = a.replace(/[^A-Za-z0-9\+\/=]/g, ""); b < a.length;) {
var d = this.a.indexOf(a.charAt(b++));
var e = this.a.indexOf(a.charAt(b++));
var f = this.a.indexOf(a.charAt(b++));
var n = this.a.indexOf(a.charAt(b++));
d = d << 2 | e >> 4;
e = (15 & e) << 4 | f >> 2;
var h = (3 & f) << 6 | n;
c += String.fromCharCode(d);
64 != f && (c += String.fromCharCode(e));
64 != n && (c += String.fromCharCode(h))
}
return Base64.c(c)
},
b: function(a) {
a = a.replace(/\r\n/g, "\n");
for (var c = "", b = 0; b < a.length; b++) {
var d = a.charCodeAt(b);
128 > d ? c += String.fromCharCode(d) : 127 < d && 2048 > d ? (c += String.fromCharCode(d >> 6 | 192), c += String.fromCharCode(63 & d | 128)) : (c += String.fromCharCode(d >> 12 | 224), c += String.fromCharCode(d >> 6 & 63 | 128), c += String.fromCharCode(63 & d | 128))
}
return c
},
c: function(a) {
var c = "",
b = 0;
for (c1 = c2 = 0; b < a.length;) {
var d = a.charCodeAt(b);
128 > d ? (c += String.fromCharCode(d), b++) : 191 < d && 224 > d ? (c2 = a.charCodeAt(b + 1), c += String.fromCharCode((31 & d) << 6 | 63 & c2), b += 2) : (c2 = a.charCodeAt(b + 1), c3 = a.charCodeAt(b + 2), c += String.fromCharCode((15 & d) << 12 | (63 & c2) << 6 | 63 & c3), b += 3)
}
return c
}
};
!
function(a, c, b) {
"undefined" != typeof module && module.exports ? module.exports = b(c, a) : "function" == typeof define && define.amd ? define("detect-zoom", function() {
return b(c, a)
}) : a[c] = b(c, a)
}(window, "detectZoom", function() {
var a = function() {
return window.devicePixelRatio || 1
},
c = function() {
return {
zoom: 1,
devicePxPerCssPx: 1
}
},
b = function() {
var b = Math.round(screen.deviceXDPI / screen.logicalXDPI * 100) / 100;
return {
zoom: b,
devicePxPerCssPx: b * a()
}
},
d = function() {
var b = Math.round(document.documentElement.offsetHeight / window.innerHeight * 100) / 100;
return {
zoom: b,
devicePxPerCssPx: b * a()
}
},
e = function() {
var b = Math.round(window.outerWidth / window.innerWidth * 100) / 100;
return {
zoom: b,
devicePxPerCssPx: b * a()
}
},
f = function() {
var b = Math.round(document.documentElement.clientWidth / window.innerWidth * 100) / 100;
return {
zoom: b,
devicePxPerCssPx: b * a()
}
},
n = function() {
var b = (90 == Math.abs(window.orientation) ? screen.height : screen.width) / window.innerWidth;
return {
zoom: b,
devicePxPerCssPx: b * a()
}
},
h = function() {
var b = document.createElement("div");
b.innerHTML = "1<br>2<br>3<br>4<br>5<br>6<br>7<br>8<br>9<br>0";
b.setAttribute("style", "font: 100px/1em sans-serif; -webkit-text-size-adjust: none; text-size-adjust: none; height: auto; width: 1em; padding: 0; overflow: visible;".replace(/;/g, " !important;"));
var c = document.createElement("div");
c.setAttribute("style", "width:0; height:0; overflow:hidden; visibility:hidden; position: absolute;".replace(/;/g, " !important;"));
c.appendChild(b);
document.body.appendChild(c);
b = 1E3 / b.clientHeight;
return b = Math.round(100 * b) / 100, document.body.removeChild(c), {
zoom: b,
devicePxPerCssPx: b * a()
}
},
k = function() {
var a = t("min--moz-device-pixel-ratio", "", 0, 10, 20, 1E-4);
return a = Math.round(100 * a) / 100, {
zoom: a,
devicePxPerCssPx: a
}
},
v = function() {
return {
zoom: k().zoom,
devicePxPerCssPx: a()
}
},
w = function() {
var b = window.top.outerWidth / window.top.innerWidth;
return b = Math.round(100 * b) / 100, {
zoom: b,
devicePxPerCssPx: b * a()
}
},
t = function(a, b, c, d, e, f) {
function g(c, d, l) {
var q = (c + d) / 2;
return 0 >= l || d - c < f ? q : p("(" + a + ":" + q + b + ")").matches ? g(q, d, l - 1) : g(c, q, l - 1)
}
var p, q, y, l;
window.matchMedia ? p = window.matchMedia : (q = document.getElementsByTagName("head")[0], y = document.createElement("style"), q.appendChild(y), l = document.createElement("div"), l.className = "mediaQueryBinarySearch", l.style.display = "none", document.body.appendChild(l), p = function(a) {
y.sheet.insertRule("@media " + a + "{.mediaQueryBinarySearch {text-decoration: underline} }", 0);
a = "underline" == getComputedStyle(l, null).textDecoration;
return y.sheet.deleteRule(0), {
matches: a
}
});
c = g(c, d, e);
return l && (q.removeChild(y), document.body.removeChild(l)), c
},
u = function() {
var a = c;
return isNaN(screen.logicalXDPI) || isNaN(screen.systemXDPI) ? window.navigator.msMaxTouchPoints ? a = d : !window.chrome || window.opera || 0 <= navigator.userAgent.indexOf(" Opera") ? 0 < Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor") ? a = f : "orientation" in window && "webkitRequestAnimationFrame" in window ? a = n : "webkitRequestAnimationFrame" in window ? a = h : 0 <= navigator.userAgent.indexOf("Opera") ? a = w : window.devicePixelRatio ? a = v : .001 < k().zoom && (a = k) : a = e : a = b, a
}();
return {
zoom: function() {
return u().zoom
},
device: function() {
return u().devicePxPerCssPx
}
}
});
function pafban(a, c, b, d, e) {
null == document.body && (document.body = document.createElement("body"));
null == document.head && (document.head = document.createElement("head"));
var f = document.createElement("style");
f.innerHTML = "#a_timer_oYvwGmQc,#a_title_nEYjMupI,.a_close_nEYjMupI{top:0;right:0;height:30px;line-height:30px;text-align:center}.top-left_vUTDnibMkZJIvuTH{position:fixed;top:0;left:0}.bottom-left_vUTDnibMkZJIvuTH{position:fixed;bottom:0;left:0}.top-right_vUTDnibMkZJIvuTH{position:fixed;top:0;right:0}.bottom-right_vUTDnibMkZJIvuTH{position:fixed;bottom:0;right:0}.top-center_vUTDnibMkZJIvuTH{position:fixed;top:0;left:50%;transform:translateX(-50%)}.bottom-center_vUTDnibMkZJIvuTH{position:fixed;bottom:0;left:50%;transform:translateX(-50%)}.c_window_xEucqIjg{z-index:9999999;overflow:hidden;position:fixed;background-color:#FFF;margin:20px;padding:0;border:1px solid #ccc;border-radius:5px;-webkit-box-shadow:0 0 5px 1px rgba(153,153,153,.5);-moz-box-shadow:0 0 5px 1px rgba(153,153,153,.5);box-shadow:0 0 5px 1px rgba(153,153,153,.5)}#alink_overlay_EPXdyaUf{position:absolute;z-index:1;background:rgba(0,0,0,0);cursor:pointer}#a_iframe_DwTGCjTm{z-index:-1;padding:0!important}.a_close_nEYjMupI{position:absolute;color:rgba(0,0,0,.3);width:30px;font-size:30px}#a_title_nEYjMupI{position:absolute;color:rgba(0,0,0,1);font-size:18px}.a_close_nEYjMupI a{text-decoration:none!important}#a_timer_oYvwGmQc{position:absolute;color:rgba(0,0,0,.3);width:30px;font-size:30px}.a_close_nEYjMupI:focus,.a_close_nEYjMupI:hover{color:#000;cursor:pointer}.a_open_rrTmtfGj{display:block}.a_hide_qkasklrO{display:none}";
document.head.appendChild(f);
f = document.createElement("div");
f.id = "c_window_xEucqIjg";
document.body.appendChild(f);
document.getElementById("c_window_xEucqIjg").classList.add("c_window_xEucqIjg");
f.innerHTML = '<div style="height:30px;"><span id="a_title_nEYjMupI">Ads by <a href="http://popads.net/">PopAds.net</a></span><span class="a_close_nEYjMupI a_hide_qkasklrO" data-alink="data-alink" id="a_close_nEYjMupI" data-dismiss_OLjQnDvi="c_xEucqIjg"><a href="#" data-alink="data-alink" data-dismiss_OLjQnDvi="c_xEucqIjg" style="text-decoration: none!important; color: rgba(0,0,0,0.3);">&times;</span></a><span id="a_timer_oYvwGmQc">5</span></div><div id="alink_overlay_EPXdyaUf" alink="alink"></div>';
document.getElementById("c_window_xEucqIjg").classList.add(c + "_vUTDnibMkZJIvuTH");
c = document.createElement("iframe");
f = document.getElementById("c_window_xEucqIjg");
var n = document.getElementById("a_title_nEYjMupI"),
h = document.getElementById("alink_overlay_EPXdyaUf");
f.style.width = b;
var k = b.search(/px/i),
v = d.search(/px/i),
w = (Math.max(document.documentElement.clientWidth, window.innerWidth || 0), Math.max(document.documentElement.clientHeight, window.innerHeight || 0));
if (-1 == k ? (h.style.width = "100%", c.style.width = "100%", n.style.width = "100%") : (h.style.width = b, c.style.width = b, n.style.width = b), -1 == v) c.style.height = "100%", h.style.height = "96%", f.style.height = d;
else {
n = function(a) {
a.matches
};
k = function() {
Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
Math.max(document.documentElement.clientHeight, window.innerHeight || 0) < t && (document.getElementById("c_window_xEucqIjg").style.top = "0")
};
v = d.split("px")[0];
var t = Number(v) + 30;
h.style.height = d;
c.style.height = d;
f.style.height = t + "px";
b = b.split("px")[0];
d = Number(b) + 40;
window.onresize = k;
window.onload = k;
h = document.createElement("style");
if (h.innerHTML = "@media all and (max-width: " + d + "px){#c_window_xEucqIjg{position:fixed;top:0!important;left:0;right:0;width:90%!important;margin:10px auto auto!important;text-align:center}.bottom-center_vUTDnibMkZJIvuTH,.top-center_vUTDnibMkZJIvuTH{left:0!important;right:0!important;transform:none!important}#a_iframe_DwTGCjTm{width:100%!important;}#alink_overlay_EPXdyaUf{width:90%!important;height:90%!important},.bottom-right_vUTDnibMkZJIvuTH {top:0px!important;} }", document.head.appendChild(h), matchMedia) b = window.matchMedia("(min-width: " + b + "px)"), b.addListener(n), n(b);
window.matchMedia("(orientation: landscape)").matches && w < t && (document.getElementById("c_window_xEucqIjg").style.top = "0");
window.addEventListener("orientationchange", function() {
window.matchMedia("(orientation:landscape)").matches || w < t && (document.getElementById("c_window_xEucqIjg").style.top = "0")
})
}
c.src = a;
c.name = "a_iframe_DwTGCjTm";
c.id = "a_iframe_DwTGCjTm";
c.frameBorder = "0";
c.scrolling = "no";
c.sandbox = "allow-forms allow-scripts";
f.appendChild(c);
document.getElementById("c_window_xEucqIjg").classList.add("a_open_rrTmtfGj");
document.getElementById("a_iframe_DwTGCjTm").src = a;
var u = 5,
x = setInterval(function() {
u--;
document.getElementById("a_timer_oYvwGmQc").textContent = u;
0 >= u && clearInterval(x)
}, 1E3);
setTimeout(function() {
document.getElementById("a_close_nEYjMupI").classList.remove("a_hide_qkasklrO");
document.getElementById("a_timer_oYvwGmQc").classList.add("a_hide_qkasklrO")
}, 5E3);
document.addEventListener("click", function(a) {
var b = (a = a || window.event).target || a.srcElement;
if (b.hasAttribute("data-dismiss_OLjQnDvi") && "c_xEucqIjg" == b.getAttribute("data-dismiss_OLjQnDvi")) {
var c = document.getElementById("c_window_xEucqIjg");
document.getElementById("c_window_xEucqIjg").classList.add("a_hide_qkasklrO");
c.classList.remove("a_open_rrTmtfGj");
a.preventDefault()
}
b.hasAttribute("data-alink") && (c = document.getElementById("c_window_xEucqIjg"), document.getElementById("c_window_xEucqIjg").classList.add("a_hide_qkasklrO"), c.classList.remove("a_open_rrTmtfGj"), a.preventDefault());
b.hasAttribute("alink") && (c = document.getElementById("c_window_xEucqIjg"), document.getElementById("c_window_xEucqIjg").classList.add("a_hide_qkasklrO"), c.classList.remove("a_open_rrTmtfGj"), window.open(e, "_blank").focus())
}, !1)
}(function(a, c, b, d) {
var e = a.Base64,
f = +new Date,
n = 0,
h = -1,
k = -1,
v = -1,
w = -1,
t = 0,
u = 0,
x = 0,
A = c.currentScript,
B = {
log: function() {}
},
m = {
_set: function(a, b, d, e, l) {
var g = d || "";
g && ("number" === typeof g ? (d = new Date, d.setTime(d.getTime() + 1E3 * g)) : d = g, g = ";expires=" + d.toUTCString());
c.cookie = a + "=" + escape("" + b) + g + (l ? ";domain=" + l : "") + ";path=" + (e || "/")
},
_get: function(a) {
return (a = c.cookie.match(new RegExp(a + "=[^;]+", "i"))) ? decodeURIComponent(a[0].split("=")[1]) : null
},
_remove: function(a) {
this._set(a, 0, new Date(0))
}
},
r = {
_available: null,
_isAvailable: function() {
if (null === this._available) try {
a.localStorage.setItem("localStorageTest", 1), a.localStorage.removeItem("localStorageTest"), this._available = !0
} catch (g) {
this._available = !1
}
return this._available
},
_set: function(b, c) {
this._isAvailable() ? a.localStorage.setItem(b, c) : m._set(b, c)
},
_get: function(b) {
try {
return this._isAvailable() ? a.localStorage.getItem(b) : m._get(b)
} catch (p) {
return null
}
},
_remove: function(b) {
this._isAvailable() ? a.localStorage.removeItem(b) : m._remove(b)
}
};
var z = {
_inventory: {},
_config: {
_siteId: 0,
_minBid: 0,
_popPerDay: -1,
_popDelay: 0,
_blockedCountries: !1,
_default: !1,
_defaultType: "popunder",
_defaultPerDay: 0,
_useOverlay: !1,
_trafficType: 0,
_popunderFailover: "tabunder",
_prepop: null === m._get("_popprepop")
},
_init: function() {
this._loadConfig();
this._isDelayBetweenExpired() && d.init({
prepop: this._config._prepop
});
this._adscoreDeploy();
this._monitorWindow()
},
_monitorWindow: function() {
Event.bind(a, "scroll", function() {
n++;
k = h = -1
});
Event.bind(c, "mousemove", function(b) {
if (b.pageX) {
var d = b.pageX;
b = b.pageY
} else d = event.clientX + c.body.scrollLeft, b = event.clientY + c.body.scrollTop;
0 > h && (h = d, k = b, v = d, w = b);
0 > d && (d = 0);
0 > b && (b = 0);
var g = Math.round(Math.sqrt((d - h) * (d - h) + (b - k) * (b - k)));
g > x && 50 < d && 50 < b && (!a.innerWidth || d < a.innerWidth - 50) && (!a.innerHeight || b < a.innerHeight - 50) && (x = g);
t += g;
h = d;
k = b;
u++
})
},
_adscoreDeploy: function() {
var a = this,
b = 0,
d = 0,
e = this._config;
b = setInterval(function() {
if (c.body) {
clearInterval(b);
var g = c.createElement("script");
g.src = "//c.adsco.re/";
try {
g.onerror = A.onerror ||
function() {
clearTimeout(d);
B.log("load adscore failure");
a._checkInventory("")
}
} catch (C) {}
g.onload = function() {
clearTimeout(d);
try {
AdscoreInit("QpUJAAAAAAAAGu98Hdz1l_lcSZ2rY60Ajjk9U1c", {
sub_id: e._siteId,
callback: function(b) {
a._checkInventory(b.signature || "")
}
})
} catch (C) {
a._checkInventory("")
}
};
c.body.appendChild(g);
d = setTimeout(function() {
a._checkInventory("")
}, 3E3)
}
}, 100)
},
_checkInventory: function(a) {
var b = this,
d = 0,
g = this._config,
l, e;
d = setInterval(function() {
var f = "//qvgjqhfnbdeur.com/b.asp";
if (c.body) {
clearInterval(d);
if ("" === a) {
var p = Math.floor(+new Date / 1E3);
null === m._get("_popprepop") && m._set("_popprepop", 1, 21600)
} else m._remove("_popprepop"), p = encodeURIComponent(a);
e = {
_: p,
v: 4,
ANircwYl: g._siteId,
iPQnzJBu: g._minBid,
jmAkGrDN: g._popPerDay,
lAtHBEdk: g._blockedCountries || "",
McvsGdHV: encodeURIComponent(c.referrer),
s: b._getScreenData()
};
for (l in e) e.hasOwnProperty(l) && (f += (-1 < f.indexOf("?") ? "&" : "?") + l + "=" + (e[l] || ""));
p = c.createElement("script");
p.src = f;
try {
p.onerror = A.onerror ||
function() {
B.log("load inventory failure")
}
} catch (D) {}
c.body.appendChild(p)
}
}, 100);
b._checkInventory = function(a) {}
},
_parseFloatingBanner: function(a) {
pafban(a.url, a.position, a.width, a.height, a.clickurl)
},
_parseInventory: function(a) {
this._inventory = a || {};
this._preparePop()
},
_preparePopDefault: function() {
if (!1 === this._config._default || 0 < this._config._defaultPerDay && this._getFiredCount("fallback") >= this._config._defaultPerDay) d._prepopReady() && d._prepopClose();
else if (/^https?:\/\//.test(this._config._default)) this._isDelayBetweenExpired() && d.addUrl(this._config._default, {
type: "popunder"
});
else {
this._updateFiredCount("fallback");
var a = e.decode(this._config._default);
a = ("<script>" + a + "\x3c/script>").replace(/^\s*<script[^>]*>|<\/script>\s*$/g, "");
var b = c.createElement("script");
b.type = "text/javascript";
b.text = a;
c.body.appendChild(b)
}
},
_preparePopInventory: function() {
var b = this;
if (!(0 < this._config._popPerDay && this._getFiredCount() >= this._config._popPerDay)) {
var e = function() {
return "undefined" !== typeof c.hidden ? c.hidden ? "nt.h" : "nt.v" : "undefined" !== typeof c.mozHidden ? c.mozHidden ? "mz.h" : "mz.v" : "undefined" !== typeof c.msHidden ? c.msHidden ? "ms.h" : "ms.v" : "undefined" !== typeof c.webkitHidden ? c.webkitHidden ? "wk.h" : "wk.v" : c.visibilityState ? "vs." + c.visibilityState.substr(0, 1) : "ns.u"
};
var q = function() {
var b = -1,
c = -1,
d = -1,
g = -1,
e = -1,
p = -1,
q = -1,
m = -1;
Date && Date.now && Math && Math.round && (b = Math.round((Date.now() - f) / 1E3));
top && top.frames && top.frames.length && (c = top.frames.length);
a.screenX && a.screenY && (d = a.screenX, g = a.screenY);
a.innerWidth && a.innerHeight && (p = a.innerWidth, e = a.innerHeight);
a.outerWidth && a.outerHeight && (m = a.outerWidth, q = a.outerHeight);
return [h, k, u, t, x, v, w, b, n, c, d, g, p, e, m, q].join()
};
this._isDelayBetweenExpired() && d.addUrl(this._inventory.url, {
type: this._inventory.type,
onbeforeopen: function(a) {
a = a + "&s=" + b._getScreenData();
a += "&v=" + e();
return a += "&m=" + q()
},
onafteropen: function() {
b._updateFiredCount(this._inventory.type)
}
})
}
},
_getScreenData: function() {
try {
var c = a.detectZoom.zoom();
return [b.width, b.height, c, b.width * c, b.height * c].join()
} catch (p) {
return ""
}
},
_getFiredCount: function(a) {
a = "_popfired" + (a || "");
var b = a + "_expires",
c = 0;
if (r._isAvailable() ? r._get(b) : m._get(b)) c = r._isAvailable() ? r._get("_spop" + a) : m._get("_spop" + a), c = parseInt(c, 10) || 0, isNaN(c) && (c = 0);
return c
},
_updateFiredCount: function(a) {
var b = "_popfired" + (a || ""),
c = b + "_expires",
d = r._isAvailable() ? r._get(c) : m._get(c),
e = d ? new Date(d) : new Date((new Date).getTime() + 86400);
a = d ? this._getFiredCount(a) : 0;
r._isAvailable() && (r._set("_spop" + b, a + 1), r._set("_spop" + c, e.toUTCString()), r._set("_spoplastOpenAt", new Date));
m._set(b, a + 1, new Date(e.getTime() - e.getTime()));
m._set(c, e.toUTCString(), new Date(e.getTime() - e.getTime()));
m._set("lastOpenAt", new Date, 86400)
},
_getLastOpenAt: function() {
var a = r._isAvailable() ? r._get("_spoplastOpenAt") : m._get("lastOpenAt");
return a ? new Date(a) : null
},
_isDelayBetweenExpired: function() {
var a = this._getLastOpenAt();
return !a || (new Date(a.getTime() + this._config._popDelay)).getTime() < (new Date).getTime()
},
_preparePop: function() {
"" !== this._inventory.url ? this._preparePopInventory() : this._preparePopDefault()
},
_loadConfig: function() {
var b = a._pop || [],
c = this._config,
d;
for (d = 0; d < b.length; d++) {
var e = b[d][0];
var f = b[d][1];
switch (e) {
case "siteId":
case "popundersPerIP":
case "delayBetween":
case "defaultPerDay":
case "trafficType":
if (f = parseInt(f, 10), isNaN(f)) continue
}
switch (e) {
case "siteId":
c._siteId = f;
break;
case "minBid":
c._minBid = f;
break;
case "popundersPerIP":
c._popPerDay = f;
break;
case "delayBetween":
c._popDelay = f;
break;
case "blockedCountries":
c._blockedCountries = f;
break;
case "default":
c._default = f;
break;
case "defaultType":
c._defaultType = f;
break;
case "defaultPerDay":
c._defaultPerDay = f;
break;
case "topmostLayer":
c._useOverlay = f;
break;
case "trafficType":
c._trafficType = f;
break;
case "popunderFailover":
c._popunderFailover = f;
break;
case "prepop":
c._prepop = f
}
}
}
};
z._init();
a.PopAds = z;
a._pao = {
parse: function(a) {
z._parseInventory(a)
},
fbparse: function(a) {
z._parseFloatingBanner(a)
}
}
})(window, window.document, window.screen, window.popjs);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment