-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathjspopunder.min.js
1 lines (1 loc) · 1.99 KB
/
jspopunder.min.js
1
function jsPopunder(e,t){function d(){try{c=Math.floor(document.cookie.split(h+"Cap=")[1].split(";")[0])}catch(e){}return l<=c||document.cookie.indexOf(h+"=")!==-1}function v(e,t,i,s,o,u){if(d())return;var a="toolbar=no,scrollbars=yes,location=yes,statusbar=yes,menubar=no,resizable=1,width="+i.toString()+",height="+s.toString()+",screenX="+o+",screenY="+u;document.onclick=function(){if(d())return;r=n.window.open(e,t,a);if(r){var i=new Date;document.cookie=h+"=1;expires="+(new Date(i.setTime(i.getTime()+f))).toGMTString()+";path=/",i=new Date,document.cookie=h+"Cap="+(c+1)+";expires="+(new Date(i.setTime(i.getTime()+846e5))).toGMTString()+";path=/",m()}}}function m(){try{r.blur(),r.opener.window.focus(),window.self.window.blur(),window.focus(),p.firefox&&g(),p.webkit&&y()}catch(e){}}function g(){var e=window.open("about:blank");e.focus(),e.close()}function y(){var e=document.createElement("a");e.href="about:blank",e.target="PopHelper",document.getElementsByTagName("body")[0].appendChild(e),e.parentNode.removeChild(e);var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!0,!1,!1,!0,0,null),e.dispatchEvent(t),window.open("about:blank","PopHelper").close()}var n=top!=self&&typeof top.document.location.toString()=="string"?top:self,r=null;t=t||{};var i=t.name||Math.floor(Math.random()*1e3+1),s=t.width||window.innerWidth,o=t.height||window.innerHeight,u=typeof t.left!="undefined"?t.left.toString():window.screenX,a=typeof t.top!="undefined"?t.top.toString():window.screenY,f=t.wait||3600;f*=1e3;var l=t.cap||2,c=0,h=t.cookie||"__.popunder",p=function(){var e=navigator.userAgent.toLowerCase(),t={webkit:/webkit/.test(e),mozilla:/mozilla/.test(e)&&!/(compatible|webkit)/.test(e),chrome:/chrome/.test(e),msie:/msie/.test(e)&&!/opera/.test(e),firefox:/firefox/.test(e),safari:/safari/.test(e)&&!/chrome/.test(e),opera:/opera/.test(e)};return t.version=t.safari?(e.match(/.+(?:ri)[\/: ]([\d.]+)/)||[])[1]:(e.match(/.+(?:ox|me|ra|ie)[\/: ]([\d.]+)/)||[])[1],t}();if(d())return;v(e,i,s,o,u,a)};