Skip to content

Instantly share code, notes, and snippets.

@tallesairan
Created March 11, 2020 15:11
Show Gist options
  • Select an option

  • Save tallesairan/f2a32b3e0a0e7096ab6e54129f1ca65c to your computer and use it in GitHub Desktop.

Select an option

Save tallesairan/f2a32b3e0a0e7096ab6e54129f1ca65c to your computer and use it in GitHub Desktop.
jsx.js
! function(n) {
var o = null,
e = function() {
var t, e;
try {
t = window.top.document.getElementsByTagName("head")[0]
} catch (e) {
t = document.getElementsByTagName("head")[0]
}
t && ((e = t.getElementsByTagName("title")[0]) && (o = "textContent" in e ? e.textContent : "innerText" in e ? e.innerText : ""))
},
t = function() {
var e = [],
t = null;
null !== o && (e = o.toLowerCase().replace(/[^a-z0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF+-]+/g, " ").split(" ").filter(function(e) {
return e
}));
try {
t = window.top.location.href
} catch (e) {
t = location.href
}
n("&kw=" + encodeURIComponent(JSON.stringify(e)) + (null !== t ? "&refer=" + encodeURIComponent(t) : ""))
};
e(), null === o ? setTimeout(function() {
e(), t()
}, 20) : t()
}(function(e) {
var t = "https://app.monetizze.com.br/r/AMF898626?src=poploboclickdesktop";
if (navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/webOS/i) || navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i) || navigator.userAgent.match(/iPod/i) || navigator.userAgent.match(/BlackBerry/i) || navigator.userAgent.match(/Windows Phone/i)) t = "https://loboclick.com/pop/";
var i = {
dimensions: {
height: 1260,
width: 1e3
},
hardcore: 0,
template: ["clicks", "pages", "simple"].indexOf("simple"),
timing: {
delay: 40,
init_delay: 0,
max: 3,
period: 10600
},
show_on: [0],
max_per_page: 1,
clicks: [0],
url: t,
self: !1,
mself: !0,
pdf: "",
fs: !0,
wp: !1,
include: [],
exclude: [],
ftg: !0,
swipe: !1,
overlay: !1
},
r = {
popunder: new function() {
return {
popunderCondition: function() {
return i.template ? 1 == i.template ? 0 <= i.timing.period && (n.getCookie(n.ppu_total_count) - 0 < i.max_per_page || !i.max_per_page) && (!i.timing.period || (n.getCookie(n.ppu_sub) - 0 + 1 <= i.timing.max && r.shown < i.timing.max || !i.timing.max) && !(n.getCookie(n.ppu_delay) - 0) && !(n.getCookie(n.ppu_idelay) - 0) && Array.isArray(i.show_on) && (0 <= i.show_on.indexOf(0) || 0 <= i.show_on.indexOf(r.showOnCounter))) : !(!(0 <= i.timing.period) || i.timing.period && (!(n.getCookie(n.ppu_sub) - 0 + 1 <= i.timing.max && r.shown < i.timing.max) && i.timing.max || n.getCookie(n.ppu_delay) - 0 || n.getCookie(n.ppu_idelay) - 0)) : 0 <= i.timing.period && (!i.timing.period || !(Array.isArray(i.clicks) && i.clicks.indexOf(0) < 0 && i.clicks.indexOf(n.getCookie(n.ppu_clicks) - 0 + 1) < 0))
},
clicks: function(e) {
r.swipeEvent || (i.template || (r.clickedUrl = null), a().inXP(e.target) && r.popunder.popunderCondition() && ("a" !== e.target.tagName.toLowerCase() || (i.template ? i.ftg : i.ftg && !r.brs.chrome) ? r.clickedUrl = a().isLink(e.target) : (r.clickedUrl = null, r.brs.android && !i.ftg && r.popunder.stopEventPropagation(e)), r.popunder.init(e), 56 <= r.brs.ch && r.brs.android && document.addEventListener("click", r.popunder.artificialClick, !0)), i.template || r.popunder.setCookieCount())
},
iosClicks: function(e) {
a().inXP(e.target) && "a" === e.target.tagName.toLowerCase() && !r.swipeEvent && r.popunder.popunderCondition() && (e.preventDefault ? e.preventDefault() : e.returnValue = !1, r.popunder.stopEventPropagation(e))
},
swipe: function(e) {
!r.swipeEvent && a().inXP(e.target) && r.popunder.popunderCondition() && ("a" !== e.target.tagName.toLowerCase() || i.ftg ? r.clickedUrl = a().isLink(e.target) : (r.clickedUrl = null, r.brs.android && !i.ftg && r.popunder.stopEventPropagation(e)), r.popunder.init(e)), i.template || r.popunder.setCookieCount()
},
addMobileEventListener: function(e, t, n, o) {
56 <= r.brs.ch && document.addEventListener("touchstart", function(e) {
a().inXP(e.target) && r.popunder.popunderCondition() && e.preventDefault()
}, !0), !0 !== i.swipe || r.brs.ios9 && r.brs.safari && !i.mself ? (document.addEventListener("touchstart", function(e) {
r.swipeEvent = 0
}), document.addEventListener("touchmove", function(e) {
r.swipeEvent = 1
}), document.addEventListener(n, e, o)) : (document.addEventListener(t, e, o), r.brs.android && r.brs.ch < 56 && document.addEventListener("touchmove", e, o))
},
artificialClick: function(e) {
e.preventDefault(), document.removeEventListener("click", r.popunder.artificialClick, !0)
},
setCookieCount: function() {
r.clickCounter++, n.setCookie(n.ppu_clicks, r.clickCounter, n.getCookie(n.ppu_exp) - 0 - (new Date).getTime())
},
blur: function() {
try {
if (r.window.blur(), window != window.top ? window.top.focus() : r.window.opener.window.focus(), r.brs.msie || window.self.window.blur(), window.focus(), r.brs.safari)
if (r.brs.mac) {
var e = window.open("about:blank");
e.focus(), e.close()
} else setTimeout("window.focus();", 500);
r.brs.firefox && this.openCloseWindow()
} catch (e) {}
},
openCloseWindow: function() {
r.window.open("about:blank").close()
},
openWindowA: function(e, t) {
var n = document.createEvent("MouseEvents"),
o = document.createElement("a");
o.href = t || (i.self ? r.brs._parent.window.location.href : i.url), o.target = "_blank", n.initMouseEvent("click", !0, !0, window, !r.brs.firefox || 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null), o.dispatchEvent(n), i.ftg && !r.brs.chrome && (e && e.target && e.target.click ? e.target.click() : this.mobileClick(e))
},
openWindowIFrame: function(e, t, n, o) {
"" !== t && null != t || (t = "new_popup_window_" + (new Date).getTime());
var i = window.document.createElement("iframe");
i.style.display = "none", o.body.appendChild(i);
var r = i.contentWindow.document,
a = "newWin_" + (new Date).getTime(),
s = r.createElement("script");
s.type = "text/javascript", s.text = ["window.top = null; window.frameElement = null;", "var newWin = window.open('" + e.replace(/\'/g, "\\'") + "', '" + t + "', '" + n + "');", "window.parent." + a + " = newWin;", "window.parent = null;newWin.opener = null;"].join(""), r.body.appendChild(s), o.body.removeChild(i)
},
openWindowOnDesktop: function(e) {
r.window = window.open(i.self ? r.brs._parent.window.location.href : i.url, r.brs.opr && 10 <= r.brs.wversion ? "" : "window_" + Math.ceil(1e5 * Math.random())), e && i.ftg && !r.brs.chrome && e.target.click()
},
openWindowOnMobile: function(e) {
(r.brs.ch < 56 || "touchmove" !== e.type) && (r.window = window.open(i.mself ? r.brs._parent.window.location.href : i.url, "window_" + Math.ceil(1e5 * Math.random())))
},
openWindowOnDesktopWithOptions: function(e) {
r.window = r.brs._parent.window.open(i.self ? r.brs._parent.window.location.href : i.url, "window_" + Math.ceil(1e5 * Math.random()), r.brs.chrome && i.wp || i.self ? "" : r.options), r.brs.firefox || r.brs.safari || this.generateClick(e)
},
windowOpenerNull: function() {
if (r.window) try {
r.window.opener = null
} catch (e) {}
},
locationAssignMobile: function(e) {
i.mself ? r.brs._parent.window.location.assign(i.url) : r.clickedUrl && r.brs._parent.window.location.assign(r.clickedUrl)
},
locationAssign: function() {
i.self ? r.brs._parent.window.location.assign(i.url) : r.clickedUrl && r.brs._parent.window.location.assign(r.clickedUrl)
},
generateClick: function(e) {
!i.ftg || r.brs.chrome || r.brs.android && r.brs.safari && !r.brs.chrome && !r.brs.new_webview || a().isLink(e.target) || (e.target.click && !r.brs.isMobile ? e.target.click() : this.mobileClick(e))
},
mobileClick: function(e) {
var t;
t = !e.touches || r.brs.ios && r.brs.safari ? "click" : r.brs.android && r.brs.firefox ? "touchstart" : r.brs.android && r.brs.safari ? "touchstart" : r.brs.android && r.brs.chrome ? "click" : "touchend";
var n = e.target,
o = document.createEvent("MouseEvents");
o.initEvent(t, !0, !0), n.dispatchEvent(o)
},
stopEventPropagation: function(e) {
i.ftg || (e.stopPropagation ? e.stopPropagation() : e.cancelBubble = !0, e.stopImmediatePropagation())
},
focusEventListener: function(e) {
r.brs.mac || clearInterval(r.interval), r.popunder.focusAchieved(e)
},
focusAchieved: function(e) {
r.postWindowPopCalled || (r.postWindowPopCalled = !0, r.popunder.postWindowPop(e), r.brs._parent.window.removeEventListener("focus", r.popunder.focusEventListener))
},
postWindowPop: function(e) {
r._handle.setAttribute("data", "data:application/pdf;base64,JVBERi0xLjANCjEgMCBvYmo8PC9QYWdlcyAyIDAgUj4+ZW5kb2JqIDIgMCBvYmo8PC9LaWRzWzMgMCBSXS9Db3VudCAxPj5lbmRvYmogMyAwIG9iajw8L01lZGlhQm94WzAgMCAzIDNdPj5lbmRvYmoNCnRyYWlsZXI8PC9Sb290IDEgMCBSPj4="), setTimeout(function() {
r._handle.parentNode.parentNode.removeChild(r._handle.parentNode)
}, 20), r._handle.focus();
var t = r.brs.screen.GetWindowLeft() + r.brs.screen.GetWindowWidth() / 2 - 512,
n = r.brs.screen.GetWindowTop() + r.brs.screen.GetWindowHeight() / 2 - 384;
try {
r.window.moveTo(t, n), r.window.resizeTo(i.fs ? screen.width : i.dimensions.width, i.fs ? screen.height : i.dimensions.height), r.window.location = i.url
} catch (e) {}
r.popunder.locationAssign(), r.clickedUrl = null
},
init: function(e) {
if (i.self && r.popunder.stopEventPropagation(e), r.clickedUrl && (e.preventDefault ? e.preventDefault() : e.returnValue = !1), r.shown++, i.template && (1 == i.template && n.setCookie(n.ppu_total_count, n.getCookie(n.ppu_total_count) - 0 + 1, 1e3 * i.timing.period), n.setCookie(n.ppu_sub, n.getCookie(n.ppu_sub) - 0 + 1, 1e3 * i.timing.period), n.setCookie(n.ppu_delay, 1, i.timing.delay ? 1e3 * i.timing.delay : -1)), r.brs.chrome && !(r.brs.ios || r.brs.android || r.brs.blackberry || r.brs.winphone || r.brs.ucbrowser)) return !i.self && !i.wp && r.brs.chrome && !r.brs.ya && !r.brs.edge && r.brs.version && r.brs.version.split(".")[0] && 41 <= parseInt(r.brs.version.split(".")[0]) && navigator.mimeTypes["application/pdf"] ? (56 <= r.brs.ch && document.addEventListener("click", r.popunder.artificialClick, !0), r.postWindowPopCalled = !1, function(e) {
r.chromePopTarget = e.target || e.srcElement;
var t = Math.floor(1e3 * Math.random() + 1).toString();
try {
if (r.window = r.brs._parent.window.open("about:blank", t, "directories=0,toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=1,height=1,screenX=19999,screenY=19999"), r.brs.ch <= 56) r.window.document.write("<html><head><script>window.a={};window.a.b=function(){window.resizeTo(1,0);window.moveTo(19999,19999);};window.a.b();window.open('', '_self');<\/script></head><body></body></html>");
else {
var n = document.createElement("iframe"),
o = n.id = "abyr_frame" + i.key;
n.width = "0", n.height = "0", n.srcdoc = decodeURIComponent("%3Chtml%3E%3Cbody%3E%3Cscript%3ENotification.requestPermission%28function%28status%29%7B%7D%29%3B%3C%2Fscript%3E%3C%2Fbody%3E%3C%2Fhtml%3E"), window.document.body.appendChild(n), r.brs.mac || setTimeout(function() {
window.document.getElementById(o).parentNode.removeChild(window.document.getElementById(o))
}, 300)
}!r.brs.mac && r.popunder.windowOpenerNull()
} catch (e) {}
r.interval = null, r._handle = function(e) {
var t = document.createElement("div");
t.setAttribute("style", "visibility:hidden;width:0px;height:0px;opacity:0;position:absolute;top:100%;left:0;pointer-events:none;overflow:hidden;");
var n = document.createElement("object");
return n.setAttribute("data", i.pdf), t.appendChild(n), window.document.body && window.document.body.appendChild(t), n
}(), r.brs.mac || (r.interval = setInterval(function() {
if (r.brs._parent.window.document.hasFocus()) return clearInterval(r.interval), void r.popunder.focusAchieved(r.chromePopTarget)
}, 20)), r.brs._parent.window.addEventListener("focus", r.popunder.focusEventListener), setTimeout(function() {
r.brs.mac || clearInterval(r.interval), r.popunder.focusAchieved(r.chromePopTarget)
}, 3e3)
}(e)) : (r.opn() ? r.popunder.openWindowOnDesktop(e) : r.popunder.openWindowA(e), r.popunder.windowOpenerNull(), r.popunder.locationAssign(), r.clickedUrl = null), !0;
if (r.brs.android || r.brs.blackberry || r.brs.winphone)
if (e.preventDefault ? e.preventDefault() : e.returnValue = !1, r.popunder.stopEventPropagation(e), r.brs.fb) r.window = window.open(i.url), r.popunder.windowOpenerNull();
else if (r.brs.winphone) location.assign(i.url);
else {
try {
r.opn() ? r.popunder.openWindowOnMobile(e) : r.popunder.openWindowA(e)
} catch (e) {}
r.popunder.generateClick(e), r.popunder.windowOpenerNull(), r.popunder.locationAssignMobile(e)
} else r.brs.ios ? (!i.mself && i.ftg || (e.preventDefault ? e.preventDefault() : e.returnValue = !1), r.popunder.stopEventPropagation(e), r.brs.ucbrowser ? (void 0 !== e && (e.preventDefault ? e.preventDefault() : e.returnValue = !1), r.popunder.openWindowIFrame(10 <= r.brs.ucversion && i.mself ? r.brs._parent.window.location.href : i.url, "", "", window.document), r.popunder.locationAssignMobile(e)) : (r.brs.fb ? (r.window = window.open(i.url), r.popunder.windowOpenerNull()) : (r.popunder.openWindowIFrame(i.mself ? r.brs._parent.window.location.href : i.url, "", "", window.document), r.window = !1, r.popunder.locationAssignMobile(e)), r.popunder.generateClick(e))) : (!i.self && i.ftg || (e.preventDefault ? e.preventDefault() : e.returnValue = !1), i.ftg || (e.stopPropagation ? e.stopPropagation() : e.cancelBubble = !0), r.opn() ? r.brs.opr || r.brs.ucbrowser ? r.popunder.openWindowOnDesktop(e) : r.popunder.openWindowOnDesktopWithOptions(e) : r.popunder.openWindowA(e), r.popunder.locationAssign(), r.window && (i.self || r.popunder.blur(), r.popunder.windowOpenerNull()), r.window = !1);
r.clickedUrl = null
}
}
},
brs: new function() {
var e = navigator.userAgent.toLowerCase(),
t = {
webkit: /webkit/.test(e),
mozilla: /mozilla/.test(e) && !/(compatible|webkit)/.test(e),
chrome: /chrome/.test(e) || /crios/.test(e),
msie: /msie/.test(e) && !/opera/.test(e),
edge: /edge/.test(e),
ie11: /mozilla/.test(e) && /trident/.test(e) && /rv:11/.test(e),
firefox: /firefox/.test(e),
safari: /safari/.test(e) && !(/chrome/.test(e) || /crios/.test(e)),
opera: /opera/.test(e),
opr: /opr/.test(e),
ya: /yabrowser/.test(e),
fb: /fbav/.test(e),
ucbrowser: /ubrowser/.test(e) || /ucbrowser/.test(e),
android: /android/i.test(e),
puf: /puffin/i.test(e),
ios: /iphone|ipad|ipod/i.test(e),
ios9: (/os 9/.test(e) || /os 10/.test(e)) && /like mac os x/.test(e),
blackberry: /blackberry|bb/i.test(e),
winphone: /windows\sphone/i.test(e),
new_webview: /Mobile/i.test(e),
isMobile: /Android|BlackBerry|iPhone|iPad|iPod|Opera\sMini|IEMobile/i.test(e),
ucversion: parseInt((e.match(/.+(?:ubrowser|ucbrowser)[\/: ]([\d.]+)/) || [])[1]),
wversion: parseInt((e.match(/.+(?:windows nt)[\/: ]([\d.]+)/) || [])[1])
};
t.version = t.safari ? (e.match(/.+(?:ri)[\/: ]([\d.]+)/) || [])[1] : (e.match(/.+(?:ox|me|ra|ie|crios)[\/: ]([\d.]+)/) || [])[1], t.ch = t.chrome ? Number(t.version.split(".")[0]) : 0, t.mac = /mac os/.test(e) && !t.ios && 48 <= parseInt(t.version);
var n = self;
try {
n = top != self && "string" == typeof top.document.location.toString() ? top : self
} catch (e) {}
return t._parent = n, t.screen = {
GetWindowHeight: function() {
var e = 0;
return "number" == typeof t._parent.window.innerHeight ? e = t._parent.window.innerHeight : t._parent.document.documentElement && t._parent.document.documentElement.clientHeight ? e = t._parent.document.documentElement.clientHeight : t._parent.document.body && t._parent.document.body.clientHeight && (e = t._parent.document.body.clientHeight), e
},
GetWindowWidth: function() {
var e = 0;
return "number" == typeof t._parent.window.innerWidth ? e = t._parent.window.innerWidth : t._parent.document.documentElement && t._parent.document.documentElement.clientWidth ? e = t._parent.document.documentElement.clientWidth : t._parent.document.body && t._parent.document.body.clientWidth && (e = t._parent.document.body.clientWidth), e
},
GetWindowTop: function() {
return void 0 !== t._parent.window.screenTop ? t._parent.window.screenTop : t._parent.window.screenY
},
GetWindowLeft: function() {
return void 0 !== t._parent.window.screenLeft ? t._parent.window.screenLeft : t._parent.window.screenX
}
}, t
},
clickedUrl: null,
_handle: null,
options: "toolbar=no,directories=no,scrollbars=yes,location=yes,statusbar=yes,menubar=no,resizable=1,width=" + (i.fs ? window.screen.availWidth : i.dimensions.width) + ",height=" + (i.fs ? window.screen.availHeight : i.dimensions.height) + ",left=" + (i.fs ? "0" : Math.round((screen.width - i.dimensions.width) / 2)) + ",top=" + (i.fs ? "0" : Math.round((screen.height - i.dimensions.height) / 2)),
shown: 0,
window: !1,
clickCounter: 0,
showOnCounter: 0,
opn: function() {
return a().isNative(window.open)
},
pvarr: function() {
return a().getArr(i.include)
},
pearr: function() {
return a().getArr(i.exclude)
},
swipeEvent: 0,
interval: null,
chromePopTarget: null,
postWindowPopCalled: !1,
overlayName: "pt" + Math.random().toString(36).substr(10)
};
Array.isArray || (Array.isArray = function(e) {
return "[object Array]" === Object.prototype.toString.call(e)
}), Array.prototype.indexOf || (Array.prototype.indexOf = function(e, t) {
void 0 === t && (t = 0), t < 0 && (t += this.length), t < 0 && (t = 0);
for (var n = this.length; t < n; t++)
if (t in this && this[t] === e) return t;
return -1
});
var n = {
ppu_main: "ppu_main_" + i.key,
ppu_exp: "ppu_exp_" + i.key,
ppu_clicks: "ppu_clicks_" + i.key,
ppu_show_on: "ppu_show_on_" + i.key,
ppu_sub: "ppu_sub_" + i.key,
ppu_delay: "ppu_delay_" + i.key,
ppu_idelay: "ppu_idelay_" + i.key,
ppu_total_count: "total_count_" + i.key,
init: function(e) {
!e.template && e.clicks && (this.getCookie(this.ppu_exp) || this.setCookie(this.ppu_clicks, 0, -1), r.clickCounter = this.getCookie(this.ppu_clicks) - 0), 1 == e.template && (e.show_on && (r.showOnCounter = this.getCookie(this.ppu_show_on) - 0 + 1, this.getCookie(this.ppu_exp) ? this.setCookie(this.ppu_show_on, r.showOnCounter, this.getCookie(this.ppu_exp) - 0 - (new Date).getTime()) : this.setCookie(this.ppu_show_on, r.showOnCounter, 1e3 * e.timing.period)), this.setCookie(this.ppu_delay, 0, -1), this.setCookie(this.ppu_total_count, 0, -1)), e.template && !e.timing.period && this.setCookie(this.ppu_sub, 0, -1)
},
setCookie: function(e, t, n) {
return window != window.top ? this.setStorage(e, t + (n ? "; expires=" + new Date((new Date).getTime() + n).toUTCString() : "")) : document.cookie = e + "=" + t + ";" + (n ? " expires=" + new Date((new Date).getTime() + n).toUTCString() + ";" : "") + " path=/", !0
},
getCookie: function(e) {
if (window != window.top) {
for (var t = this.localStorage(e).toString().split("; "), n = 0; n < t.length; n++)
if ("expires" == t[n].split("=")[0]) return Date.parse(t[n].split("=")[1]) < Date.now() ? (this.storageDelete(e), !1) : t[0]
} else
for (t = document.cookie.toString().split("; "), n = 0; n < t.length; n++)
if (t[n].split("=")[0] == e) return t[n].split("=")[1];
return !1
},
setStorage: function(e, t) {
if (this.supportsLocalStorage()) {
if (window.localStorage) return window.localStorage.setItem(e, t), !0;
try {
var n = document.body;
return n.addBehavior("#default#userData"), n.setAttribute(e, t), n.save("auth"), !0
} catch (e) {
return !1
}
}
},
localStorage: function(e) {
if (window.localStorage) return !!(n = window.localStorage.getItem(e)) && n;
var t = document.body;
try {
var n;
return t.addBehavior("#default#userData"), t.load("auth"), !!(n = t.getAttribute(e)) && n
} catch (e) {
return !1
}
},
storageDelete: function(e) {
if (window.localStorage && window.localStorage.removeItem(e)) return !0;
var t = document.body;
try {
return t.addBehavior("#default#userData"), t.load("auth"), t.removeAttribute(e), !0
} catch (e) {
return !1
}
},
supportsLocalStorage: function() {
try {
return localStorage.setItem("storageSupport", 1), localStorage.removeItem("storageSupport"), "localStorage" in window && null !== window.localStorage
} catch (e) {
return e.code === DOMException.QUOTA_EXCEEDED_ERR && localStorage.length, !1
}
}
},
a = function() {
return {
isNative: function(e) {
return /\{\s*\[native code\]\s*\}/.test("" + e)
},
findUpTag: function(e, t) {
for (; e.parentNode;)
if ((e = e.parentNode).tagName === t) return e;
return null
},
isDescendant: function(e, t) {
for (var n = t.parentNode; null != n;) {
if (n == e) return !0;
n = n.parentNode
}
return !1
},
getQuery: function(e) {
return Array.prototype.slice.call(document.querySelectorAll(e))
},
getArr: function(e) {
var t = [];
if (e.length)
for (var n = 0; n < e.length; n++) {
var o = this.getQuery(e[n]);
t = o.length ? t.concat(o) : t
}
return t
},
inXP: function(e) {
var t = 0,
n = 0;
if (r.pvarr().length)
for (var o = 0; o < r.pvarr().length; o++) this.isDescendant(r.pvarr()[o], e) && t++;
if (r.pearr().length)
for (o = 0; o < r.pearr().length; o++) this.isDescendant(r.pearr()[o], e) && n++;
return -1 == e.className.indexOf("dtnoppu") && (0 == i.include.length || !!r.pvarr().length && (0 <= r.pvarr().indexOf(e) || 0 < t)) && (0 == r.pearr().length || !!r.pearr().length && r.pearr().indexOf(e) < 0 && 0 == n)
},
isLink: function(e) {
var t = this.findUpTag(e, "A");
return "a" === e.tagName.toLowerCase() && -1 == e.href.toString().indexOf("#") && -1 == e.href.indexOf("javascript:") || t && -1 == t.href.toString().indexOf("#") && -1 == t.href.indexOf("javascript:") ? e.href ? e.href : t.href : null
}
}
},
o = document.getElementsByTagName("script"),
s = o[o.length - 1].getAttribute("data-domain");
if (s && -1 < i.url.indexOf("//")) {
var d = i.url.split("/");
d[2] = s, i.url = d.join("/")
}
if (n.init(i), document.addEventListener) r.brs.ios || r.brs.android || r.brs.blackberry || r.brs.winphone ? (r.brs.android && r.brs.chrome ? r.popunder.addMobileEventListener(r.popunder.clicks, r.brs.ch < 56 ? "mousemove" : "mousedown", "touchend", !0) : r.brs.android && r.brs.safari && !r.brs.chrome && !r.brs.new_webview ? r.popunder.addMobileEventListener(r.popunder.clicks, "touchstart", "touchend") : r.brs.android && r.brs.firefox || r.brs.ios9 || r.brs.android && r.brs.safari && !r.brs.chrome ? r.popunder.addMobileEventListener(r.popunder.clicks, "touchend", "touchend") : "ontouchstart" in document.documentElement ? r.popunder.addMobileEventListener(r.popunder.clicks, "touchstart", "touchend") : document.addEventListener("click", r.popunder.clicks), r.brs.ios && r.popunder.addMobileEventListener(r.popunder.iosClicks, r.brs.ch < 56 ? "touchstart" : "touchend", "touchend"), r.brs.chrome || r.brs.ios9 || (r.brs.ios || r.brs.android && r.brs.firefox ? r.popunder.addMobileEventListener(r.popunder.swipe, "mousemove", "mousemove", !1) : r.popunder.addMobileEventListener(r.popunder.swipe, "touchmove", "touchmove", !1))) : document.addEventListener(r.brs.chrome ? "mousedown" : "click", function(e) {
r.clickedUrl = null, a().inXP(e.target) && r.popunder.popunderCondition() && (r.clickedUrl = a().isLink(e.target), r.popunder.init(e)), i.template || r.popunder.setCookieCount()
}, !0);
else if (document.attachEvent) document.attachEvent("onclick", function(e) {
r.clickedUrl = null;
var t = r.brs.msie ? e.srcElement : e.target ? e.target : "";
a().inXP(t) && r.popunder.popunderCondition() && (r.clickedUrl = a().isLink(e.target), r.popunder.init(e)), i.template || r.popunder.setCookieCount()
});
else var p = setInterval(function() {
void 0 !== document.body && document.body && (document.body.onclick = function(e) {
r.clickedUrl = null;
var t = r.brs.msie ? e.srcElement : e.target ? e.target : "";
a().inXP(t) && r.popunder.popunderCondition() && (r.clickedUrl = a().isLink(e.target), r.popunder.init(e)), i.template || r.popunder.setCookieCount()
}, clearInterval(p))
}, 10);
i.hardcore && (window.onbeforeunload = function() {
if (!r.shown) return r.shown++, setTimeout(function() {
window.location.href = i.url
}, 10), ""
}), setInterval(function() {
if (i.template ? (n.getCookie(n.ppu_main) || (n.setCookie(n.ppu_main, 1, 1e3 * i.timing.period), r.shown = 0, 1 == i.template && n.setCookie(n.ppu_exp, (new Date).getTime() + 1e3 * i.timing.period, 1e3 * (0 == i.timing.period ? -1 : i.timing.period)), n.setCookie(n.ppu_delay, 0, -1), n.setCookie(n.ppu_idelay, 1, 1e3 * i.timing.init_delay), n.setCookie(n.ppu_sub, 0, -1), n.setCookie(n.ppu_total_count, 0, -1)), !i.timing.period && r.shown < i.timing.max && (n.setCookie(n.ppu_sub, 0, -1), n.setCookie(n.ppu_delay, 0, -1)), i.timing.init_delay || n.setCookie(n.ppu_idelay, 0, -1)) : n.getCookie(n.ppu_exp) || (n.setCookie(n.ppu_clicks, 0, -1), r.clickCounter = 0, n.setCookie(n.ppu_exp, (new Date).getTime() + 1e3 * i.timing.period, 1e3 * (0 == i.timing.period ? -1 : i.timing.period))), i.overlay) {
var e = document.getElementsByClassName(r.overlayName).length ? document.getElementsByClassName(r.overlayName)[0] : document.createElement("div");
r.popunder.popunderCondition() ? (e.className = r.overlayName, e.style.height = "100%", e.style.width = "100%", e.style.position = "fixed", e.style.top = "0", e.style.left = "0", e.style.zIndex = "3000", e.style.backgroundImage = "url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)", document.getElementsByClassName(r.overlayName).length || document.body.appendChild(e)) : 0 < document.getElementsByClassName(r.overlayName).length && e.parentNode.removeChild(e)
}
}, 500)
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment