Advertisement
thetenfold

Scnlog.eu - Disable Popups

Mar 20th, 2014
267
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name          Scnlog.eu - Disable Popups
  3. // @namespace     http://userscripts.org/users/23652
  4. // @description   Disables popups on Scnlog.eu
  5. // @include       http://scnlog.eu/*
  6. // @include       https://scnlog.eu/*
  7. // @copyright     JoeSimmons
  8. // @version       1.0.0
  9. // @license       GPL version 3 or any later version; http://www.gnu.org/copyleft/gpl.html
  10. // @grant         GM_addStyle
  11. // ==/UserScript==
  12.  
  13. (function () {
  14.     var script = '_gunggo.pop.open = _gunggo.pop.clkPop = function () {};',
  15.         uw, intv;
  16.  
  17.     // unwraps the element so we can use its methods freely
  18.     function unwrap(elem) {
  19.         if (elem) {
  20.             if ( typeof XPCNativeWrapper === 'function' && typeof XPCNativeWrapper.unwrap === 'function' && elem === XPCNativeWrapper(elem) ) {
  21.                 return XPCNativeWrapper.unwrap(elem);
  22.             } else if (elem.wrappedJSObject) {
  23.                 return elem.wrappedJSObject;
  24.             }
  25.         }
  26.  
  27.         return elem;
  28.     }
  29.  
  30.     // run by JoeSimmons
  31.     function run(t) {
  32.         var s = document.createElement('script'),
  33.             body = document.body;
  34.  
  35.         s.type = 'text/javascript';
  36.         s.innerHTML = t;
  37.  
  38.         body.appendChild(s);
  39.         body.removeChild(s);
  40.     }
  41.  
  42.     // get the raw window object of the page
  43.     uw = typeof unsafeWindow !== 'undefined' ? unsafeWindow : unwrap(window);
  44.  
  45.     intv = window.setInterval(function () {
  46.         if (uw._gunggo) {
  47.             run(script);
  48.         }
  49.     }, 250);
  50. }());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement