Advertisement
Guest User

Untitled

a guest
Dec 25th, 2015
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.34 KB | None | 0 0
  1. <html>
  2. <head>
  3. <script type="text/javascript">
  4. function makePopunder(pUrl) {
  5. var _parent = (top != self && typeof (top["document"]["location"].toString()) === "string") ? top : self;
  6. var mypopunder = null;
  7. var pName = (Math["floor"]((Math["random"]() * 1000) + 1));
  8. var pWidth = window["innerWidth"];
  9. var pHeight = window["innerHeight"];
  10. var pPosX = window["screenX"];
  11. var pPosY = window["screenY"];
  12. var pWait = 3600;
  13. pWait = (pWait * 1000);
  14. var pCap = 50000;
  15. var todayPops = 0;
  16. var cookie = "_.mypopunder";
  17. var browser = function () {
  18. var n = navigator["userAgent"]["toLowerCase"]();
  19. var b = {
  20. webkit: /webkit/ ["test"](n),
  21. mozilla: (/mozilla/ ["test"](n)) && (!/(compatible|webkit)/ ["test"](n)),
  22. chrome: /chrome/ ["test"](n),
  23. msie: (/msie/ ["test"](n)) && (!/opera/ ["test"](n)),
  24. firefox: /firefox/ ["test"](n),
  25. safari: (/safari/ ["test"](n) && !(/chrome/ ["test"](n))),
  26. opera: /opera/ ["test"](n)
  27. };
  28. b["version"] = (b["safari"]) ? (n["match"](/.+(?:ri)[\/: ]([\d.]+)/) || [])[1] : (n["match"](/.+(?:ox|me|ra|ie)[\/: ]([\d.]+)/) || [])[1];
  29. return b;
  30. }();
  31.  
  32. function isCapped() {
  33. try {
  34. todayPops = Math["floor"](document["cookie"]["split"](cookie + "Cap=")[1]["split"](";")[0]);
  35. } catch (err) {};
  36. return (pCap <= todayPops || document["cookie"]["indexOf"](cookie + "=") !== -1);
  37. };
  38.  
  39. function doPopunder(pUrl, pName, pWidth, pHeight, pPosX, pPosY) {
  40. if (isCapped()) {
  41. return;
  42. };
  43. var sOptions = "toolbar=no,scrollbars=yes,location=yes,statusbar=yes,menubar=no,resizable=1,width=" + pWidth.toString() + ",height=" + pHeight.toString() + ",screenX=" + pPosX + ",screenY=" + pPosY;
  44. document["onclick"] = function (e) {
  45. if (isCapped() || window["pop_clicked"] == 1 || pop_isRightButtonClicked(e)) {
  46. //return;
  47. };
  48. window["pop_clicked"] = 1;
  49. mypopunder = _parent["window"]["open"](pUrl, pName, sOptions);
  50. if (mypopunder) {
  51. var now = new Date();
  52. document["cookie"] = cookie + "=1;expires=" + new Date(now["setTime"](now["getTime"]() + pWait))["toGMTString"]() + ";path=/";
  53. now = new Date();
  54. document["cookie"] = cookie + "Cap=" + (todayPops + 1) + ";expires=" + new Date(now["setTime"](now["getTime"]() + (84600 * 1000)))["toGMTString"]() + ";path=/";
  55. pop2under();
  56. };
  57. };
  58. };
  59.  
  60. function pop2under() {
  61. try {
  62. mypopunder["blur"]();
  63. mypopunder["opener"]["window"]["focus"]();
  64. window["self"]["window"]["blur"]();
  65. window["focus"]();
  66. if (browser["firefox"]) {
  67. openCloseWindow();
  68. };
  69. if (browser["webkit"]) {
  70. openCloseTab();
  71. };
  72. } catch (e) {};
  73. };
  74.  
  75. function openCloseWindow() {
  76. var ghost = window["open"]("about:blank");
  77. ghost["focus"]();
  78. ghost["close"]();
  79. };
  80.  
  81. function openCloseTab() {
  82. var ghost = document["createElement"]("a");
  83. ghost["href"] = "about:blank";
  84. ghost["target"] = "PopHelper";
  85. document["getElementsByTagName"]("body")[0]["appendChild"](ghost);
  86. ghost["parentNode"]["removeChild"](ghost);
  87. var clk = document["createEvent"]("MouseEvents");
  88. clk["initMouseEvent"]("click", true, true, window, 0, 0, 0, 0, 0, true, false, false, true, 0, null);
  89. ghost["dispatchEvent"](clk);
  90. window["open"]("about:blank", "PopHelper")["close"]();
  91. };
  92.  
  93. function pop_isRightButtonClicked(e) {
  94. var rightclick = false;
  95. e = e || window["event"];
  96. if (e["which"]) {
  97. rightclick = (e["which"] == 3);
  98. } else {
  99. if (e["button"]) {
  100. rightclick = (e["button"] == 2);
  101. };
  102. };
  103. return rightclick;
  104. };
  105. if (isCapped()) {
  106. return;
  107. } else {
  108. doPopunder(pUrl, pName, pWidth, pHeight, pPosX, pPosY);
  109. };
  110. }
  111. makePopunder("http://www.google.com/");
  112. </script>
  113.  
  114.  
  115.  
  116. </head>
  117. <body>
  118. <p>click anywhere in the page</p>
  119. </body>
  120. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement