(function() { var wrapped = top; var deprecatedProperties = ["webkitStorageInfo", "webkitIndexedDB", "mozHidden", "mozVisibilityState"]; /** * Wrapper for window object */ var wrapper = { listeners: {}, /** * Removes the event listener previously registered with addEventListener() * @param eventType - A string representing the event type to remove * @param eventListener - The object that receives a notification when an event of the specified type occurs * @param options - An options object that specifies characteristics about the event listener */ removeEventListener: function (eventType, eventListener, options) { if (wrapper.listeners[eventListener]) { var eventListenerWrapper = wrapper.listeners[eventListener]; wrapped.removeEventListener(eventType, eventListenerWrapper, options); } }, /** * Registers the specified listener on the EventTarget it's called on * @param eventType - A string representing the event type to listen for * @param eventListener - The object that receives a notification when an event of the specified type occurs * @param options - An options object that specifies characteristics about the event listener */ addEventListener: function (eventType, eventListener, options) { var eventListenerWrapper; if (wrapper.listeners[eventListener]) { eventListenerWrapper = wrapper.listeners[eventListener]; } else { var eventListenerWrapper = function (e) { if (eventListener.handleEvent) { with (wrapper) { eventListener.handleEvent(e); } } else { eventListener.call(document, e); } }; wrapper.listeners[eventListener] = eventListenerWrapper; } wrapped.addEventListener(eventType, eventListenerWrapper, options); }, /** * Creates an event of the type specified * @param eventType - A string representing the event type to create */ createEvent: function (eventType) { return wrapped.createEvent(eventType); }, /** * Dispatches an event at the wrapper * @param event - The Event object to be dispatched. */ dispatchEvent: function (event) { return wrapped.dispatchEvent(event); }, /** * Event object that currently being processed */ Event: function() { return wrapped.Event; } }; (function () { 'use strict'; // Init GM commands api window.__adg_gm_commands_api = window.__adg_gm_commands_api || { commands: [] }; })(); /** * Calls the specified event handler when body loaded * @param eventListener - The object that receives a notification when an event of the specified type occurs */ var runAtBody = function (eventListener) { if (document.body) { if (eventListener) { eventListener.call(document); } } else { var listenEvents = ["load", "DOMNodeInserted", "DOMContentLoaded"]; var eventListenerWrapper = function () { listenEvents.forEach(function (eventType) { document.removeEventListener(eventType, eventListenerWrapper, false); }); runAtBody(eventListener); }; listenEvents.forEach(function (eventType) { document.addEventListener(eventType, eventListenerWrapper, false); }) } }; /** * Calls the specified event handler when document was successfully loaded * @param eventListener - The object that receives a notification when an event of the specified type occurs */ var runAtDocumentEnd = function (eventListener) { if (document.readyState == "complete" || document.readyState == "loaded" || document.readyState == "interactive") { if (eventListener) { eventListener.call(document); } } else { var listenEvents = ["DOMContentLoaded", "load"]; var eventListenerWrapper = function () { listenEvents.forEach(function (eventType) { document.removeEventListener(eventType, eventListenerWrapper, false); }); runAtDocumentEnd(eventListener); }; listenEvents.forEach(function (eventType) { document.addEventListener(eventType, eventListenerWrapper, false); }) } }; /** * Copies the properties from wrappedObject to wrapperObject * @param wrappedObject - object from which properties copied * @param wrapperObject - object to which properties copied */ var copyProperties = function (wrappedObject, wrapperObject) { var properties = []; for (prop in wrappedObject) { properties.push(prop); } properties.forEach(function (propertyName) { if (wrapperObject[propertyName] || deprecatedProperties.indexOf(propertyName) > -1) { return; } if (typeof (wrappedObject[propertyName]) === 'function') { var func = wrappedObject[propertyName]; wrapperObject[propertyName] = function () { return func.apply(wrappedObject, arguments); } } else { Object.defineProperty(wrapperObject, propertyName, { get: function () { return wrappedObject[propertyName]; }, set: function (property_value) { wrappedObject[propertyName] = property_value; } }); } }); }; /** * Initialize window and document wrappers. * Schedule userscript to run. */ var initializeWindowWrapper = function () { wrapper.window = wrapper; wrapper.Promise = wrapped.Promise; wrapper.XMLHttpRequest = wrapped.XMLHttpRequest; wrapper.DOMParser = wrapped.DOMParser; wrapper.MutationObserver = wrapped.MutationObserver; wrapper.document = document; wrapper.top = (window.top == window) ? wrapper : window.top; wrapper.parent = (window.parent == window) ? wrapper : window.parent; wrapper.escape = wrapped.escape; wrapper.self = wrapper; if (typeof InstallTrigger !== 'undefined') { wrapper.exportFunction = function (func, context, options) { if (options && options.defineAs) { context[options.defineAs] = func; } return func; } wrapper.createObjectIn = function (context, options) { var newObject = {}; if (options && options.defineAs) { context[options.defineAs] = newObject; } return newObject; } } var isEventFunction = function (key) { return key === 'addEventListener' || key === 'removeEventListener' || key === 'createEvent' || key === 'dispatchEvent' || key.indexOf('on') === 0; }; // https://github.com/AdguardTeam/AdguardForWindows/issues/1139 var decorator = { get: function (target, key) { if (isEventFunction(key)) { var wrappedFunction = target[key]; return function () { wrappedFunction.apply(target, arguments); } } else { return target[key]; } }, set: function (target, key, value) { target[key] = value; return true; } }; if (typeof Proxy != 'undefined') { wrapper.unsafeWindow = new Proxy(window, decorator); } else { wrapper.unsafeWindow = window; } copyProperties(wrapped, wrapper); }; var log = function (message) { 'use strict'; if (console && console.log) { console.log(message); } }; var isTinyIframe = function () { var isIframe = (window.self != window.top); var width = window.innerWidth || document.documentElement.clientWidth; var height = window.innerHeight || document.documentElement.clientHeight; return (isIframe && ((width * height) < 100000)) } /** * clean up all userscript "tracks" */ var cleanUp = function () { var currentScript = document.currentScript; if (!currentScript) { var scripts = document.getElementsByTagName('script'); currentScript = scripts[scripts.length - 1]; } var rootElement = currentScript.parentNode; rootElement.removeChild(currentScript); } /** * "main" Userscript execution */ var executeUserscript = function () { initializeWindowWrapper(); var AdguardSettings ={"feedbackUrl":"//api.adguard.com","applicationId":"3a2e92596c5142f9afd10ba75584a46a","locale":"ru","appVersion":"6.1.331.1732","uniqueName":"Adguard Popup Blocker","version":"1.0.21","sendAnonymousStatistic":"true","nonce":"121bf6a6aabe4570a626ef675324db6d"}; var protectionFunction = function (params) { 'use strict'; return "160dd" + params + "0f926bdcba754116980af3f"; }; var userscript = function (window, AdguardSettings, __adg_gm_commands_api) { with (wrapper) { // No resources; var __GM_api={}; (function(){var settings={apiurl:"/adguard-ajax-api/api",feedbackUrl:"/api/1.0/url-report.html"};var utils={getHostWithProtocol:function(){var hostname=document.location.hostname;var protocol=document.location.protocol;var port=document.location.port=="80"?"":":"+document.location.port;return protocol+"//"+hostname+port},sendGetRequest:function(params,async){var url=utils.getHostWithProtocol()+settings.apiurl;url+="?";url+=utils.buildParameters(params);if(typeof async=="undefined")async=false;var xmlhttp= new XMLHttpRequest;xmlhttp.open("GET",url,async);xmlhttp.send();if(xmlhttp.readyState==4)if(xmlhttp.status!=200)throw xmlhttp.statusText;return xmlhttp.responseText},sendPostRequest:function(params){var url=utils.getHostWithProtocol()+settings.apiurl;var data=utils.buildParameters(params);var xmlhttp=new XMLHttpRequest;xmlhttp.open("POST",url,true);xmlhttp.send(data)},buildParameters:function(params,omitParameters){var query="";for(var key in params)if(params.hasOwnProperty(key)){var value=params[key]; if(query)query+="&";query+=key;query+="=";if(omitParameters&&omitParameters[key])query+=value;else query+=encodeURIComponent(value)}var calc=function(params){var ROTR=function(n,x){return x>>>n|x<<32-n};var \u03a30=function(x){return ROTR(2,x)^ROTR(13,x)^ROTR(22,x)};var \u03a31=function(x){return ROTR(6,x)^ROTR(11,x)^ROTR(25,x)};var \u03c30=function(x){return ROTR(7,x)^ROTR(18,x)^x>>>3};var \u03c31=function(x){return ROTR(17,x)^ROTR(19,x)^x>>>10};var Ch=function(x,y,z){return x&y^~x&z};var Maj=function(x, y,z){return x&y^x&z^y&z};var toHexStr=function(n){var s="",v;for(var i=7;i>=0;i--){v=n>>>i*4&15;s+=v.toString(16)}return s};var safeMathCeil=function(x){var i=0;for(;i<=x+1;i++)if(i>=x)return i;return i};var paddingBit=String.fromCharCode(128);var charCodeAt=function(str,index){var character=str[index];if(typeof character=="undefined")return NaN;if(character==" ")return 32;if(character=="!")return 33;if(character=='"')return 34;if(character=="#")return 35;if(character=="$")return 36;if(character== "%")return 37;if(character=="&")return 38;if(character=="'")return 39;if(character=="(")return 40;if(character==")")return 41;if(character=="*")return 42;if(character=="+")return 43;if(character==",")return 44;if(character=="-")return 45;if(character==".")return 46;if(character=="/")return 47;if(character=="0")return 48;if(character=="1")return 49;if(character=="2")return 50;if(character=="3")return 51;if(character=="4")return 52;if(character=="5")return 53;if(character=="6")return 54;if(character== "7")return 55;if(character=="8")return 56;if(character=="9")return 57;if(character==":")return 58;if(character==";")return 59;if(character=="<")return 60;if(character=="=")return 61;if(character==">")return 62;if(character=="?")return 63;if(character=="@")return 64;if(character=="A")return 65;if(character=="B")return 66;if(character=="C")return 67;if(character=="D")return 68;if(character=="E")return 69;if(character=="F")return 70;if(character=="G")return 71;if(character=="H")return 72;if(character== "I")return 73;if(character=="J")return 74;if(character=="K")return 75;if(character=="L")return 76;if(character=="M")return 77;if(character=="N")return 78;if(character=="O")return 79;if(character=="P")return 80;if(character=="Q")return 81;if(character=="R")return 82;if(character=="S")return 83;if(character=="T")return 84;if(character=="U")return 85;if(character=="V")return 86;if(character=="W")return 87;if(character=="X")return 88;if(character=="Y")return 89;if(character=="Z")return 90;if(character== "[")return 91;if(character=="\\")return 92;if(character=="]")return 93;if(character=="^")return 94;if(character=="_")return 95;if(character=="`")return 96;if(character=="a")return 97;if(character=="b")return 98;if(character=="c")return 99;if(character=="d")return 100;if(character=="e")return 101;if(character=="f")return 102;if(character=="g")return 103;if(character=="h")return 104;if(character=="i")return 105;if(character=="j")return 106;if(character=="k")return 107;if(character=="l")return 108;if(character== "m")return 109;if(character=="n")return 110;if(character=="o")return 111;if(character=="p")return 112;if(character=="q")return 113;if(character=="r")return 114;if(character=="s")return 115;if(character=="t")return 116;if(character=="u")return 117;if(character=="v")return 118;if(character=="w")return 119;if(character=="x")return 120;if(character=="y")return 121;if(character=="z")return 122;if(character=="{")return 123;if(character=="|")return 124;if(character=="}")return 125;if(character=="~")return 126; if(character==paddingBit)return 128;return 32};var createSafeArray=function(size){return{}};var setArrayElement=function(array,index,value){var i=protectionFunction(index);array[i]=value};var getArrayElement=function(array,index){var i=protectionFunction(index);return array[i]};var hash=function(msg){var K=createSafeArray(64);setArrayElement(K,0,1116352408);setArrayElement(K,1,1899447441);setArrayElement(K,2,3049323471);setArrayElement(K,3,3921009573);setArrayElement(K,4,961987163);setArrayElement(K, 5,1508970993);setArrayElement(K,6,2453635748);setArrayElement(K,7,2870763221);setArrayElement(K,8,3624381080);setArrayElement(K,9,310598401);setArrayElement(K,10,607225278);setArrayElement(K,11,1426881987);setArrayElement(K,12,1925078388);setArrayElement(K,13,2162078206);setArrayElement(K,14,2614888103);setArrayElement(K,15,3248222580);setArrayElement(K,16,3835390401);setArrayElement(K,17,4022224774);setArrayElement(K,18,264347078);setArrayElement(K,19,604807628);setArrayElement(K,20,770255983);setArrayElement(K, 21,1249150122);setArrayElement(K,22,1555081692);setArrayElement(K,23,1996064986);setArrayElement(K,24,2554220882);setArrayElement(K,25,2821834349);setArrayElement(K,26,2952996808);setArrayElement(K,27,3210313671);setArrayElement(K,28,3336571891);setArrayElement(K,29,3584528711);setArrayElement(K,30,113926993);setArrayElement(K,31,338241895);setArrayElement(K,32,666307205);setArrayElement(K,33,773529912);setArrayElement(K,34,1294757372);setArrayElement(K,35,1396182291);setArrayElement(K,36,1695183700); setArrayElement(K,37,1986661051);setArrayElement(K,38,2177026350);setArrayElement(K,39,2456956037);setArrayElement(K,40,2730485921);setArrayElement(K,41,2820302411);setArrayElement(K,42,3259730800);setArrayElement(K,43,3345764771);setArrayElement(K,44,3516065817);setArrayElement(K,45,3600352804);setArrayElement(K,46,4094571909);setArrayElement(K,47,275423344);setArrayElement(K,48,430227734);setArrayElement(K,49,506948616);setArrayElement(K,50,659060556);setArrayElement(K,51,883997877);setArrayElement(K, 52,958139571);setArrayElement(K,53,1322822218);setArrayElement(K,54,1537002063);setArrayElement(K,55,1747873779);setArrayElement(K,56,1955562222);setArrayElement(K,57,2024104815);setArrayElement(K,58,2227730452);setArrayElement(K,59,2361852424);setArrayElement(K,60,2428436474);setArrayElement(K,61,2756734187);setArrayElement(K,62,3204031479);setArrayElement(K,63,3329325298);var H=createSafeArray(8);setArrayElement(H,0,1779033703);setArrayElement(H,1,3144134277);setArrayElement(H,2,1013904242);setArrayElement(H, 3,2773480762);setArrayElement(H,4,1359893119);setArrayElement(H,5,2600822924);setArrayElement(H,6,528734635);setArrayElement(H,7,1541459225);msg+=String.fromCharCode(128);var l=msg.length/4+2;var N=safeMathCeil(l/16);var M=createSafeArray(N);for(var i=0;i>2;enc2=(chr1&3)<<4|chr2>>4;enc3=(chr2&15)<<2|chr3>>6;enc4=chr3&63;if(isNaN(chr2))enc3=enc4=64;else if(isNaN(chr3))enc4=64;output=output+Base64._keyStr.charAt(enc1)+Base64._keyStr.charAt(enc2)+Base64._keyStr.charAt(enc3)+Base64._keyStr.charAt(enc4)}return output},decode:function(input){var output= "";var chr1,chr2,chr3;var enc1,enc2,enc3,enc4;var i=0;input=input.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(i>4;chr2=(enc2&15)<<4|enc3>>2;chr3=(enc3&3)<<6|enc4;output=output+String.fromCharCode(chr1);if(enc3!=64)output=output+String.fromCharCode(chr2);if(enc4!=64)output=output+String.fromCharCode(chr3)}output= Base64._utf8_decode(output);return output},_utf8_encode:function(string){string=string.replace(/\r\n/g,"\n");var utftext="";for(var n=0;n127&&c<2048){utftext+=String.fromCharCode(c>>6|192);utftext+=String.fromCharCode(c&63|128)}else{utftext+=String.fromCharCode(c>>12|224);utftext+=String.fromCharCode(c>>6&63|128);utftext+=String.fromCharCode(c&63|128)}}return utftext},_utf8_decode:function(utftext){var string= "";var i=0;var c=0;var c1=0;var c2=0;var c3=0;while(i191&&c<224){c2=utftext.charCodeAt(i+1);string+=String.fromCharCode((c&31)<<6|c2&63);i+=2}else{c2=utftext.charCodeAt(i+1);c3=utftext.charCodeAt(i+2);string+=String.fromCharCode((c&15)<<12|(c2&63)<<6|c3&63);i+=3}}return string}};var exportFunction=function(func,context){return function(){return func.apply(context,arguments)}};var fns=["indexOf","lastIndexOf", "filter","forEach","every","map","some","slice"];fns.forEach(function(funcName){if(typeof Array[funcName]!=="function"){var obj={};obj[funcName]={value:function(arraylikeObj){return Array.prototype[funcName].apply(arraylikeObj,Array.prototype.slice.call(arguments,1))},enumerable:false,writable:true,configurable:true};Object.defineProperties(Array,obj)}});__GM_api.GM_info={script:{name:AdguardSettings.uniqueName,version:AdguardSettings.version},scriptMetaStr:"",scriptWillUpdate:true,version:"0.9.16", uuid:"uuid"};var GM_valuesCache=Object.create(null);__GM_api.GM_setValue=function(name,value){if(typeof value=="undefined"){GM_log("Trying to set "+name+" property to undefined");return}var gmValue=utils.convertToGmProperty(value);var params={"type":"gm-set-value","unique_name":AdguardSettings.uniqueName,"variable_key":name,"variable_value":gmValue};var currentValue=GM_valuesCache[name];if(typeof currentValue!="undefined"&¤tValue==gmValue)return;GM_valuesCache[name]=gmValue;utils.sendPostRequest(params)}; __GM_api.GM_getValue=function(name,defaultValue){var params={"type":"gm-get-value","unique_name":AdguardSettings.uniqueName,"variable_key":name};var gmValue=GM_valuesCache[name];if(typeof gmValue=="undefined"){var gmValue=utils.sendGetRequest(params);GM_valuesCache[name]=gmValue}var resultValue=utils.convertFromGmProperty(gmValue);if(typeof resultValue=="undefined")return defaultValue;return resultValue};__GM_api.GM_deleteValue=function(name){var params={"type":"gm-delete-value","unique_name":AdguardSettings.uniqueName, "variable_key":name};delete GM_valuesCache[name];utils.sendPostRequest(params)};__GM_api.GM_listValues=function(){var params={"type":"gm-list-values","unique_name":AdguardSettings.uniqueName};var result=utils.sendGetRequest(params);try{return JSON.parse(result)}catch(ex){GM_log(ex);return[]}};__GM_api.GM_getResourceText=function(resourceName){return Base64.decode(GM_getResourceURL(resourceName))};__GM_api.GM_getResourceURL=function(resourceName){var result=GM_Resources[resourceName];if(typeof result=== "undefined")throw"Resource "+resourceName+" not found";return result};__GM_api.GM_xmlhttpRequest=function(details){details.url=details.url?details.url:"";details.data=details.data?details.data:"";details.headers=details.headers?details.headers:"";details.overrideMimeType=details.overrideMimeType?details.overrideMimeType:"";details.method=details.method?details.method:"";details.user=details.user?details.user:"";details.password=details.password?details.password:"";var encodeHeaders=function(headers){if(typeof headers== "object"){var result="";for(header in headers)result+=encodeURIComponent(header)+":"+encodeURIComponent(headers[header])+",";return result.slice(0,-1)}if(typeof headers=="string")return encodeURIComponent(headers);return null};var url=utils.getHostWithProtocol();var method=details.method?details.method:"GET";var params={"type":"gm-xml-http-request","unique_name":AdguardSettings.uniqueName,"url":details.url,"data":details.data,"headers":encodeHeaders(details.headers),"method":details.method,"overridemimetype":details.overrideMimeType, "user":details.user,"password":details.password};var data=utils.buildParameters(params,{"headers":true});if(method!="POST"&&(method!="PUT"&&(method!="PATCH"&&method!="DELETE"))){url+=settings.apiurl;url+="?";url+=data}else url+=settings.apiurl;var async=details.synchronous?!details.synchronous:true;var xmlhttp=new XMLHttpRequest;xmlhttp.open(method,url,async);xmlhttp.onreadystatechange=function(){var responseState={responseXML:"",responseText:xmlhttp.readyState==4?xmlhttp.responseText:"",readyState:xmlhttp.readyState, responseHeaders:xmlhttp.readyState==4?xmlhttp.getAllResponseHeaders():"",status:xmlhttp.readyState==4?xmlhttp.status:0,statusText:xmlhttp.readyState==4?xmlhttp.statusText:"",finalUrl:xmlhttp.readyState==4?xmlhttp.finalUrl:""};if(details["onreadystatechange"])details["onreadystatechange"](responseState);if(xmlhttp.readyState==4){if(details["onload"]&&(xmlhttp.status>=200&&xmlhttp.status<300))details["onload"](responseState);if(details["onerror"]&&(xmlhttp.status<200||xmlhttp.status>=300))details["onerror"](responseState)}}; if(async){xmlhttp.timeout=details.timeout?details.timeout:15E3;xmlhttp.ontimeout=function(){if(details.ontimeout)details.ontimeout(xmlhttp)};if(method=="GET")xmlhttp.send();else xmlhttp.send(data);return xmlhttp}else{if(method=="GET")xmlhttp.send();else xmlhttp.send(data);return xmlhttp.responseText}};__GM_api.GM_registerMenuCommand=function(caption,commandFunc,accessKey){if(!__adg_gm_commands_api)return;if(!caption||!commandFunc){GM_log("Caption or commandFunc should be set to register menu command"); return}var command={"caption":caption,"commandFunc":commandFunc};__adg_gm_commands_api.commands.push(command);var event=document.createEvent("Events");event.initEvent("__adg_gm_command_registered",true,true);event.data={};document.dispatchEvent(event)};__GM_api.GM_addStyle=function(css){var style=document.createElement("style");style.setAttribute("nonce",AdguardSettings.nonce);style.type="text/css";if(style.styleSheet)style.styleSheet.cssText=css;else style.appendChild(document.createTextNode(css)); var head=document.getElementsByTagName("head");if(head&&(head.length>0&&head[0]))head[0].appendChild(style)};__GM_api.GM_setClipboard=function(text){window.prompt("Copy to clipboard: Ctrl+C, Enter",text)};__GM_api.GM_openInTab=function(url){return window.open(url,"_blank")};__GM_api.GM_log=function(message){if(window.console&&window.console.log)window.console.log(message)};__GM_api.ADG_addRule=function(rule){var params={"type":"add","rule":rule};utils.sendGetRequest(params)};__GM_api.ADG_removeRule= function(rule){var params={"type":"remove","rule":rule};utils.sendGetRequest(params)};__GM_api.ADG_temporaryDontBlock=function(timeout){if(!timeout)timeout=30;var domainName=document.location.hostname;var parameter="@@||"+domainName+"$document";var params={"type":"notblock","timeout":timeout,"rule":parameter};utils.sendGetRequest(params)};__GM_api.ADG_sendComplaint=function(url,comment,complaintType){var details={};details.url=AdguardSettings.feedbackUrl+settings.feedbackUrl;details.method="POST"; details.data="applicationId="+encodeURIComponent(AdguardSettings.applicationId)+"&messageType="+encodeURIComponent(complaintType)+"&url="+encodeURIComponent(url)+"&comment="+encodeURIComponent(comment);details.headers="Content-Type: application/x-www-form-urlencoded";GM_xmlhttpRequest(details)};__GM_api.ADG_sendAbuse=function(url){var params={"type":"send-abuse","url":url};utils.sendGetRequest(params)}})();var GM_info=__GM_api.GM_info;var GM_setValue=__GM_api.GM_setValue.bind(__GM_api); var GM_getValue=__GM_api.GM_getValue.bind(__GM_api);var GM_deleteValue=__GM_api.GM_deleteValue.bind(__GM_api);var GM_listValues=__GM_api.GM_listValues.bind(__GM_api);var GM_getResourceText=__GM_api.GM_getResourceText.bind(__GM_api);var GM_openInTab=__GM_api.GM_openInTab.bind(__GM_api);var GM_getResourceURL=__GM_api.GM_getResourceURL.bind(__GM_api);var GM_xmlhttpRequest=__GM_api.GM_xmlhttpRequest.bind(__GM_api);var GM_registerMenuCommand=__GM_api.GM_registerMenuCommand.bind(__GM_api); var GM_addStyle=__GM_api.GM_addStyle.bind(__GM_api);var GM_setClipboard=__GM_api.GM_setClipboard.bind(__GM_api);var GM_log=__GM_api.GM_log.bind(__GM_api);var ADG_addRule=__GM_api.ADG_addRule.bind(__GM_api);var ADG_removeRule=__GM_api.ADG_removeRule.bind(__GM_api);var ADG_temporaryDontBlock=__GM_api.ADG_temporaryDontBlock.bind(__GM_api);var ADG_sendComplaint=__GM_api.ADG_sendComplaint.bind(__GM_api);var ADG_sendAbuse=__GM_api.ADG_sendAbuse.bind(__GM_api); // ==UserScript== // @name Adguard Popup Blocker // @name:ru Блокировщик всплывающей рекламы Adguard // @name:uk Блокувальник спливаючої реклами Adguard // @name:de Adguard Popup-Blocker // @name:sr Koristi Adguard-ov blokator iskačućih prozora // @name:pl Bloker wyskakujących okienek // @name:zh 使用 Adguard 弹窗拦截器 // @name:zh-TW Adguard 彈出視窗阻擋器 // @name:sk Adguard blokovač vyskakovacích okien // @name:fr Bloqueur de popup de Adguard // @name:it Blocco Pop-Up di Adguard // @name:es Bloqueador Popup de Adguard // @namespace Adguard // @description Blocks popup ads on web pages // @description:ru Блокирует всплывающую рекламу на страницах // @description:uk Блокує спливаючу рекламу на веб-сторінках // @description:de Blockiert Anzeige-Popups auf Webseiten // @description:tr Web sayfalarında açılan pencere reklamları engeller // @description:ko 웹 페이지의 팝업 광고를 차단 합니다. // @description:sr Blokira iskačuće reklame na veb stranicama // @description:pl Blokuje wyskakujące okienka z reklamami na stronach internetowych // @description:zh 拦截网页弹窗广告 // @description:zh-TW 阻擋網頁彈窗廣告 // @description:sk Blokuje vyskakovacie reklamy na webových stránkach // @description:fr Bloque les publicités intrusives sur les pages web // @description:it Blocca gli annunci di popup nelle pagine internet // @description:vi Chặn quảng cáo popup trên các trang web // @description:es Bloquea popups de anuncios en sitios web // @version 1.0.21 // @adg:permanent true // @exclude //www.yandex.* // @exclude *://disqus.com/* // @exclude *www.facebook.com/plugins/сomments* // @exclude *vk.com/widget_comments* // @exclude *www.youtube.com/embed/* // @exclude *mail.live.com* // @exclude *wikipedia.org* // @downloadURL https://cdn.adguard.com/public/Userscripts/AdguardPopupBlocker/1.0/adguard_popup.user.js // @updateURL https://cdn.adguard.com/public/Userscripts/AdguardPopupBlocker/1.0/adguard_popup.meta.js // ==/UserScript== (function() { var trim=function(str){return str.replace(/^\s+|\s+$/g,"")};var locale=window.navigator.userLanguage||(window.navigator.language||"ru");if(AdguardSettings&&AdguardSettings.locale)locale=AdguardSettings.locale;var adguard=new Object;adguard.alreadyInit=0;adguard.popupPatterns=[];adguard.usePopupBlock=false; adguard.popupBlockedText=locale=="ru"?"Adguard \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd \ufffd\ufffd\ufffd\ufffd":"Adguard has blocked pop-up window";adguard.defaultConfiguration={popupFunctions:[]};adguard.setupPopupPatterns=function(popupFunctions){if(popupFunctions)for(var i=0;i0?" - ("+adguard.popupBlocked+ ")":"");adguard.popupBlocked++;return adguard.blockedWindow}}if(code)for(i=0;i0?" - ("+adguard.popupBlocked+")":"");adguard.popupBlocked++;return adguard.blockedWindow}}try{return adguard.baseOpen.apply(window,arguments)}catch(ex){return adguard.baseOpen(url,name,params)}}; adguard.getFunctionName=function(func){var fName=(""+func).match(/function\s*([\w\$]*)\s*\(/);if(fName!=null)return fName[1];return""};var rules=[{domain:"letitbit.net",pattern:'"downloadclick"'},{domain:"uploadbox.com",pattern:'"poker"'},{domain:"fileshare.in.ua",pattern:'"ppn"'},{domain:"fishki.net",pattern:'"plarium"'},{domain:"~irr.ru,~irr.kz,~irr.by,~irr.ua,~irr.lt",pattern:'"under"'},{domain:"~irr.ru,~irr.kz,~irr.by,~irr.ua,~irr.lt",pattern:'"mgopen"'}];var permitted=[]; for(var i=0;i-1&&!contains(domains,"~"+window.location.host))permitted.push(rule)}adguard.init({popupFunctions:permitted}); })(); } }; (function () { 'use strict'; var runFlag = "__adg_run_flag" + AdguardSettings.uniqueName; if (!wrapped[runFlag]) { wrapped[runFlag] = true; if (!AdguardSettings.runAt || AdguardSettings.runAt == "document-end") { runAtDocumentEnd(function () { userscript.call(wrapper, wrapper, AdguardSettings, window.__adg_gm_commands_api); }) } else if (AdguardSettings.runAt == "document-body") { runAtBody(function () { userscript.call(wrapper, wrapper, AdguardSettings, window.__adg_gm_commands_api); }) } else if (AdguardSettings.runAt == "document-idle") { runAtDocumentEnd(function () { wrapper.setTimeout(function () { userscript.call(wrapper, wrapper, AdguardSettings, window.__adg_gm_commands_api); }, 1) }) } else { userscript.call(wrapper, wrapper, AdguardSettings, window.__adg_gm_commands_api); } } else { log('Page tries to run userscript second time'); } })(); } try { try { // Do not run into small iframes if (!isTinyIframe()) { executeUserscript(); } } catch (ex) { log(ex); } cleanUp(); } catch (ex) { log(ex); } })();