diff --git a/dist/cjs/scriptletsCjs.js b/dist/cjs/scriptletsCjs.js index cdfc36f9..b99e0f2b 100644 --- a/dist/cjs/scriptletsCjs.js +++ b/dist/cjs/scriptletsCjs.js @@ -726,7 +726,7 @@ var parseRule = function parseRule(ruleText) { * * **Syntax** * ``` - * example.org#%#//scriptlet("abort-on-property-read", ) + * example.org#%#//scriptlet('abort-on-property-read', ) * ``` * * **Parameters** @@ -735,10 +735,10 @@ var parseRule = function parseRule(ruleText) { * **Examples** * ``` * ! Aborts script when it tries to access `window.alert` - * example.org#%#//scriptlet("abort-on-property-read", "alert") + * example.org#%#//scriptlet('abort-on-property-read', 'alert') * * ! Aborts script when it tries to access `navigator.language` - * example.org#%#//scriptlet("abort-on-property-read", "navigator.language") + * example.org#%#//scriptlet('abort-on-property-read', 'navigator.language') * ``` */ @@ -808,7 +808,7 @@ abortOnPropertyRead.injections = [randomId, setPropertyAccess, getPropertyInChai * * **Syntax** * ``` - * example.org#%#//scriptlet("abort-on-property-write", ) + * example.org#%#//scriptlet('abort-on-property-write', ) * ``` * * **Parameters** @@ -816,9 +816,8 @@ abortOnPropertyRead.injections = [randomId, setPropertyAccess, getPropertyInChai * * **Examples** * ``` - * ! Aborts all inline scripts trying to access `window.alert` - * utils.escape('') - * // => '<script></script>' + * ! Aborts script when it tries to set `window.adblock` value + * example.org#%#//scriptlet('abort-on-property-write', 'adblock') * ``` */ @@ -2038,7 +2037,7 @@ log.names = ['log']; * * **Syntax** * ``` - * example.org#%#//scriptlet("noeval") + * example.org#%#//scriptlet('noeval') * ``` */ @@ -2060,12 +2059,19 @@ noeval.injections = [hit]; * Related UBO scriptlet: * https://github.com/gorhill/uBlock/wiki/Resources-Library#noeval-ifjs- * + * **Syntax** + * ``` + * example.org#%#//scriptlet('prevent-eval-if'[, ]) + * ``` + * * **Parameters** - * - `search` string or regexp matching stringified eval payload + * - `search` - optional string or regexp for matching stringified eval payload. + * If 'search is not specified — all stringified eval payload will be matched. * * **Examples** * ``` - * ! + * ! Prevents eval if it matches 'test' + * example.org#%#//scriptlet('prevent-eval-if', 'test') * ``` * * @param {string|RegExp} [search] string or regexp matching stringified eval payload @@ -2662,7 +2668,7 @@ removeAttr.injections = [hit, observeDOMChanges]; * * 2. Removes with specified selector * ``` - * example.org#%#//scriptlet('remove-class', 'branding', 'div[class="inner"]') + * example.org#%#//scriptlet('remove-class', 'branding', 'div[class^="inner"]') * ``` * * ```html @@ -2734,7 +2740,7 @@ function removeClass(source, classNames, selector) { observeDOMChanges(removeClassHandler, true, CLASS_ATTR_NAME); } -removeClass.names = ['remove-class']; +removeClass.names = ['remove-class', 'remove-class.js', 'ubo-remove-class.js', 'rc.js', 'ubo-rc.js']; removeClass.injections = [hit, observeDOMChanges]; /** @@ -4609,6 +4615,7 @@ var getRedirectByName = function getRedirectByName(name) { /** * Returns redirect code by param * @param {Source} source + * @returns {string} redirect code */ @@ -4647,9 +4654,10 @@ var redirectsCjs = { */ /** -* Returns scriptlet code by param -* @param {Source} source -*/ + * Returns scriptlet code by param + * @param {Source} source + * @returns {string} scriptlet code + */ function getScriptletCode(source) { if (!validator.isValidScriptletName(source.name)) { diff --git a/dist/cjs/scriptletsCjs.js.map b/dist/cjs/scriptletsCjs.js.map index 07b4f84f..5e7c2f8a 100644 --- a/dist/cjs/scriptletsCjs.js.map +++ b/dist/cjs/scriptletsCjs.js.map @@ -1 +1 @@ -{"version":3,"file":"scriptletsCjs.js","sources":["../../src/helpers/random-id.js","../../src/helpers/set-property-access.js","../../src/helpers/get-property-in-chain.js","../../src/helpers/string-utils.js","../../src/helpers/create-on-error-handler.js","../../src/helpers/noop.js","../../src/helpers/hit.js","../../src/helpers/observer.js","../../src/helpers/index.js","../../src/helpers/injector.js","../../node_modules/@babel/runtime/helpers/arrayWithHoles.js","../../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js","../../node_modules/@babel/runtime/helpers/nonIterableRest.js","../../node_modules/@babel/runtime/helpers/slicedToArray.js","../../node_modules/@babel/runtime/helpers/defineProperty.js","../../src/helpers/parse-rule.js","../../src/scriptlets/abort-on-property-read.js","../../src/scriptlets/abort-on-property-write.js","../../src/scriptlets/prevent-setTimeout.js","../../src/scriptlets/prevent-setInterval.js","../../src/scriptlets/prevent-window-open.js","../../src/scriptlets/abort-current-inline-script.js","../../src/scriptlets/set-constant.js","../../src/scriptlets/remove-cookie.js","../../src/scriptlets/prevent-addEventListener.js","../../src/scriptlets/prevent-bab.js","../../src/scriptlets/nowebrtc.js","../../src/scriptlets/log-addEventListener.js","../../src/scriptlets/log-eval.js","../../src/scriptlets/log.js","../../src/scriptlets/noeval.js","../../src/scriptlets/prevent-eval-if.js","../../src/scriptlets/prevent-fab-3.2.0.js","../../src/scriptlets/set-popads-dummy.js","../../src/scriptlets/prevent-popads-net.js","../../src/scriptlets/prevent-adfly.js","../../src/scriptlets/debug-on-property-read.js","../../src/scriptlets/debug-on-property-write.js","../../src/scriptlets/debug-current-inline-script.js","../../src/scriptlets/remove-attr.js","../../src/scriptlets/remove-class.js","../../src/scriptlets/disable-newtab-links.js","../../src/scriptlets/adjust-setInterval.js","../../src/scriptlets/adjust-setTimeout.js","../../src/scriptlets/dir-string.js","../../src/scriptlets/json-prune.js","../../src/scriptlets/prevent-requestAnimationFrame.js","../../src/scriptlets/scriptletsList.js","../../src/helpers/validator.js","../../node_modules/@babel/runtime/helpers/iterableToArray.js","../../node_modules/@babel/runtime/helpers/toArray.js","../../src/helpers/converter.js","../../src/redirects/google-analytics.js","../../src/redirects/google-analytics-ga.js","../../src/redirects/googlesyndication-adsbygoogle.js","../../src/redirects/googletagmanager-gtm.js","../../src/redirects/googletagservices-gpt.js","../../src/redirects/scorecardresearch-beacon.js","../../src/redirects/metrika-yandex-tag.js","../../src/redirects/metrika-yandex-watch.js","../../src/redirects/index.js","../../src/scriptlets/index.js","../../src/scriptlets/scriptletsCjsWrapper.js"],"sourcesContent":["\n/**\n * Generate random six symbols id\n */\nexport function randomId() {\n return Math.random().toString(36).substr(2, 9);\n}\n","/**\n * Set getter and setter to property if it's configurable\n * @param {Object} object target object with property\n * @param {string} property property name\n * @param {Object} descriptor contains getter and setter functions\n * @returns {boolean} is operation successful\n */\nexport function setPropertyAccess(object, property, descriptor) {\n const currentDescriptor = Object.getOwnPropertyDescriptor(object, property);\n if (currentDescriptor && !currentDescriptor.configurable) {\n return false;\n }\n Object.defineProperty(object, property, descriptor);\n return true;\n}\n","/**\n * @typedef Chain\n * @property {Object} base\n * @property {string} prop\n * @property {string} [chain]\n */\n\n/**\n * Check is property exist in base object recursively\n *\n * If property doesn't exist in base object,\n * defines this property (for addProp = true)\n * and returns base, property name and remaining part of property chain\n *\n * @param {Object} base\n * @param {string} chain\n * @param {boolean} [addProp=true]\n * defines is nonexistent base property should be assigned as 'undefined'\n * @returns {Chain}\n */\nexport function getPropertyInChain(base, chain, addProp = true) {\n const pos = chain.indexOf('.');\n if (pos === -1) {\n return { base, prop: chain };\n }\n const prop = chain.slice(0, pos);\n const own = base[prop];\n chain = chain.slice(pos + 1);\n if (own !== undefined) {\n return getPropertyInChain(own, chain, addProp);\n }\n\n if (!addProp) {\n return false;\n }\n\n Object.defineProperty(base, prop, { configurable: true });\n return { base: own, prop, chain };\n}\n","/**\n * Escapes special chars in string\n * @param {string} str\n * @returns {string}\n */\nexport const escapeRegExp = (str) => str.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n\n/**\n * Converts search string to the regexp\n * TODO think about nested dependencies, but be careful with dependency loops\n * @param {string} str search string\n * @returns {RegExp}\n */\nexport const toRegExp = (str) => {\n if (str[0] === '/' && str[str.length - 1] === '/') {\n return new RegExp(str.slice(1, -1));\n }\n const escaped = str.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n return new RegExp(escaped);\n};\n\n/**\n * Get string before regexp first match\n * @param {string} str\n * @param {RegExp} rx\n */\nexport const getBeforeRegExp = (str, rx) => {\n const index = str.search(rx);\n return str.substring(0, index);\n};\n\nexport const startsWith = (str, prefix) => {\n return str && str.indexOf(prefix) === 0;\n};\n\nexport const endsWith = (str, prefix) => {\n return str && str.indexOf(prefix) === str.length - 1;\n};\n\nexport const substringAfter = (str, separator) => {\n if (!str) {\n return str;\n }\n const index = str.indexOf(separator);\n return index < 0 ? '' : str.substring(index + separator.length);\n};\n\nexport const substringBefore = (str, separator) => {\n if (!str || !separator) {\n return str;\n }\n const index = str.indexOf(separator);\n return index < 0 ? str : str.substring(0, index);\n};\n\n/**\n * Wrap str in single qoutes and replaces single quotes to doudle one\n * @param {string} str\n */\nexport const wrapInSingleQuotes = (str) => {\n if ((str[0] === '\\'' && str[str.length - 1] === '\\'')\n || (str[0] === '\"' && str[str.length - 1] === '\"')) {\n str = str.substring(1, str.length - 1);\n }\n // eslint-disable-next-line no-useless-escape\n str = str.replace(/\\'/g, '\"');\n\n return `'${str}'`;\n};\n\n/**\n * Returns substring enclosed in the widest braces\n * @param {string} str\n */\nexport const getStringInBraces = (str) => {\n const firstIndex = str.indexOf('(');\n const lastIndex = str.lastIndexOf(')');\n return str.substring(firstIndex + 1, lastIndex);\n};\n","/**\n * Generates function which silents global errors on page generated by scriptlet\n * If error doesn't belong to our error we transfer it to the native onError handler\n * @param {string} rid - unique identifier of scriptlet\n * @return {onError}\n */\nexport function createOnErrorHandler(rid) {\n // eslint-disable-next-line consistent-return\n const nativeOnError = window.onerror;\n return function onError(error, ...args) {\n if (typeof error === 'string' && error.indexOf(rid) !== -1) {\n return true;\n }\n if (nativeOnError instanceof Function) {\n return nativeOnError.apply(this, [error, ...args]);\n }\n return false;\n };\n}\n","/**\n * Noop function\n */\nexport const noopFunc = () => { };\n\n/**\n * Function returns null\n */\nexport const noopNull = () => null;\n\n/**\n * Function returns true\n */\nexport const trueFunc = () => true;\n\n/**\n * Function returns false\n */\nexport const falseFunc = () => false;\n\n/**\n * Function returns this\n */\nexport function noopThis() {\n return this;\n}\n\n/**\n * Function returns empty array\n */\nexport const noopArray = () => [];\n\n/**\n * Function returns empty string\n */\nexport const noopStr = () => '';\n","/* eslint-disable no-console, no-underscore-dangle */\n/**\n * Hit used only for debug purposes now\n * @param {Source} source\n * @param {string} [message] - optional message;\n * use LOG_MARKER = 'log: ' at the start of a message\n * for logging scriptlets\n */\nexport const hit = (source, message) => {\n if (source.verbose !== true) {\n return;\n }\n\n try {\n const log = console.log.bind(console);\n const trace = console.trace.bind(console);\n\n const prefix = source.ruleText || '';\n\n // Used to check if scriptlet uses 'hit' function for logging\n const LOG_MARKER = 'log: ';\n\n if (message) {\n if (message.indexOf(LOG_MARKER) === -1) {\n log(`${prefix} message:\\n${message}`);\n } else {\n log(message.slice(LOG_MARKER.length));\n }\n }\n\n log(`${prefix} trace start`);\n if (trace) {\n trace();\n }\n log(`${prefix} trace end`);\n } catch (e) {\n // try catch for Edge 15\n // In according to this issue https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/14495220/\n // console.log throws an error\n }\n\n // This is necessary for unit-tests only!\n if (typeof window.__debug === 'function') {\n window.__debug(source);\n }\n};\n","/**\n * DOM tree changes observer. Used for 'remove-attr' and 'remove-class' scriptlets\n * @param {Function} callback\n * @param {Boolean} observeAttrs - optional parameter - should observer check attibutes changes\n */\nexport const observeDOMChanges = (callback, observeAttrs = false, attrsToObserv = []) => {\n /**\n * Returns a wrapper, passing the call to 'method' at maximum once per 'delay' milliseconds.\n * Those calls that fall into the \"cooldown\" period, are ignored\n * @param {Function} method\n * @param {Number} delay - milliseconds\n */\n const throttle = (method, delay) => {\n let wait = false;\n let savedArgs;\n const wrapper = (...args) => {\n if (wait) {\n savedArgs = args;\n return;\n }\n method(...args);\n wait = true;\n setTimeout(() => {\n wait = false;\n if (savedArgs) {\n wrapper(savedArgs);\n savedArgs = null;\n }\n }, delay);\n };\n return wrapper;\n };\n\n /**\n * 'delay' in milliseconds for 'throttle' method\n */\n const THROTTLE_DELAY_MS = 20;\n /**\n * Used for remove-class\n */\n // eslint-disable-next-line no-use-before-define\n const observer = new MutationObserver(throttle(callbackWrapper, THROTTLE_DELAY_MS));\n\n const connect = () => {\n if (attrsToObserv.length > 0) {\n observer.observe(document.documentElement, {\n childList: true,\n subtree: true,\n attributes: observeAttrs,\n attributeFilter: attrsToObserv,\n });\n } else {\n observer.observe(document.documentElement, {\n childList: true,\n subtree: true,\n attributes: observeAttrs,\n });\n }\n };\n const disconnect = () => {\n observer.disconnect();\n };\n function callbackWrapper() {\n disconnect();\n callback();\n connect();\n }\n\n connect();\n};\n","/**\n * This file must export all used dependencies\n */\nexport * from './random-id';\nexport * from './set-property-access';\nexport * from './get-property-in-chain';\nexport * from './string-utils';\nexport * from './create-on-error-handler';\nexport * from './noop';\nexport * from './hit';\nexport * from './observer';\n","import * as dependencies from '.';\n\n\n/**\n * Concat dependencies to scriptlet code\n * @param {string} scriptlet string view of scriptlet\n */\nexport function attachDependencies(scriptlet) {\n const { injections = [] } = scriptlet;\n return injections.reduce((accum, dep) => `${accum}\\n${dependencies[dep.name]}`, scriptlet.toString());\n}\n\n/**\n * Add scriptlet call to existing code\n * @param {Function} scriptlet\n * @param {string} code\n */\nexport function addCall(scriptlet, code) {\n return `${code};\n const updatedArgs = args ? [].concat(source).concat(args) : [source];\n ${scriptlet.name}.apply(this, updatedArgs);\n `;\n}\n\n/**\n * Wrap function into IIFE (Immediately invoked function expression)\n *\n * @param {Source} source - object with scriptlet properties\n * @param {string} code - scriptlet source code with dependencies\n *\n * @returns {string} full scriptlet code\n *\n * @example\n * const source = {\n * args: [\"aaa\", \"bbb\"],\n * name: 'noeval',\n * };\n * const code = \"function noeval(source, args) { alert(source); } noeval.apply(this, args);\"\n * const result = wrapInIIFE(source, code);\n *\n * // result\n * `(function(source, args) {\n * function noeval(source) { alert(source); }\n * noeval.apply(this, args);\n * )({\"args\": [\"aaa\", \"bbb\"], \"name\":\"noeval\"}, [\"aaa\", \"bbb\"])`\n */\nexport function passSourceAndProps(source, code) {\n if (source.hit) {\n source.hit = source.hit.toString();\n }\n const sourceString = JSON.stringify(source);\n const argsString = source.args ? `[${source.args.map(JSON.stringify)}]` : undefined;\n const params = argsString ? `${sourceString}, ${argsString}` : sourceString;\n return `(function(source, args){\\n${code}\\n})(${params});`;\n}\n\n/**\n * Wrap code in no name function\n * @param {string} code which must be wrapped\n */\nexport function wrapInNonameFunc(code) {\n return `function(source, args){\\n${code}\\n}`;\n}\n","function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\n\nmodule.exports = _arrayWithHoles;","function _iterableToArrayLimit(arr, i) {\n if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === \"[object Arguments]\")) {\n return;\n }\n\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}\n\nmodule.exports = _iterableToArrayLimit;","function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance\");\n}\n\nmodule.exports = _nonIterableRest;","var arrayWithHoles = require(\"./arrayWithHoles\");\n\nvar iterableToArrayLimit = require(\"./iterableToArrayLimit\");\n\nvar nonIterableRest = require(\"./nonIterableRest\");\n\nfunction _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || nonIterableRest();\n}\n\nmodule.exports = _slicedToArray;","function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nmodule.exports = _defineProperty;","/**\n * Iterate over iterable argument and evaluate current state with transitions\n * @param {string} init first transition name\n * @param {Array|Collection|string} iterable\n * @param {Object} transitions transtion functions\n * @param {any} args arguments which should be passed to transition functions\n */\nfunction iterateWithTransitions(iterable, transitions, init, args) {\n let state = init || Object.keys(transitions)[0];\n for (let i = 0; i < iterable.length; i += 1) {\n state = transitions[state](iterable, i, args);\n }\n return state;\n}\n\n/**\n * AdGuard scriptlet rule mask\n */\nexport const ADG_SCRIPTLET_MASK = '#//scriptlet';\n\n/**\n * Helper to accumulate an array of strings char by char\n */\nconst wordSaver = () => {\n let str = '';\n const strs = [];\n const saveSymb = (s) => {\n str += s;\n return str;\n };\n const saveStr = () => {\n strs.push(str);\n str = '';\n };\n const getAll = () => [...strs];\n\n return { saveSymb, saveStr, getAll };\n};\n\nconst substringAfter = (str, separator) => {\n if (!str) {\n return str;\n }\n const index = str.indexOf(separator);\n return index < 0 ? '' : str.substring(index + separator.length);\n};\n\n/**\n * Parse and validate scriptlet rule\n * @param {*} ruleText\n * @returns {{name: string, args: Array}}\n */\nexport const parseRule = (ruleText) => {\n ruleText = substringAfter(ruleText, ADG_SCRIPTLET_MASK);\n /**\n * Transition names\n */\n const TRANSITION = {\n OPENED: 'opened',\n PARAM: 'param',\n CLOSED: 'closed',\n };\n\n /**\n * Transition function: the current index position in start, end or between params\n * @param {string} rule\n * @param {number} index\n * @param {Object} Object\n * @property {Object} Object.sep contains prop symb with current separator char\n */\n const opened = (rule, index, { sep }) => {\n const char = rule[index];\n let transition;\n switch (char) {\n case ' ':\n case '(':\n case ',': {\n transition = TRANSITION.OPENED;\n break;\n }\n case '\\'':\n case '\"': {\n sep.symb = char;\n transition = TRANSITION.PARAM;\n break;\n }\n case ')': {\n transition = index === rule.length - 1\n ? TRANSITION.CLOSED\n : TRANSITION.OPENED;\n break;\n }\n default: {\n throw new Error('The rule is not a scriptlet');\n }\n }\n\n return transition;\n };\n /**\n * Transition function: the current index position inside param\n * @param {string} rule\n * @param {number} index\n * @param {Object} Object\n * @property {Object} Object.sep contains prop `symb` with current separator char\n * @property {Object} Object.saver helper which allow to save strings by car by char\n */\n const param = (rule, index, { saver, sep }) => {\n const char = rule[index];\n switch (char) {\n case '\\'':\n case '\"': {\n const preIndex = index - 1;\n const before = rule[preIndex];\n if (char === sep.symb && before !== '\\\\') {\n sep.symb = null;\n saver.saveStr();\n return TRANSITION.OPENED;\n }\n }\n // eslint-disable-next-line no-fallthrough\n default: {\n saver.saveSymb(char);\n return TRANSITION.PARAM;\n }\n }\n };\n const transitions = {\n [TRANSITION.OPENED]: opened,\n [TRANSITION.PARAM]: param,\n [TRANSITION.CLOSED]: () => { },\n };\n const sep = { symb: null };\n const saver = wordSaver();\n const state = iterateWithTransitions(ruleText, transitions, TRANSITION.OPENED, { sep, saver });\n\n if (state !== 'closed') {\n throw new Error(`Invalid scriptlet rule ${ruleText}`);\n }\n\n const args = saver.getAll();\n return {\n name: args[0],\n args: args.slice(1),\n };\n};\n","import {\n randomId, setPropertyAccess, getPropertyInChain, createOnErrorHandler, hit,\n} from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet abort-on-property-read\n *\n * @description\n * Aborts a script when it attempts to **read** the specified property.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#abort-on-property-readjs-\n *\n * Related ABP source:\n * https://github.com/adblockplus/adblockpluscore/blob/6b2a309054cc23432102b85d13f12559639ef495/lib/content/snippets.js#L864\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"abort-on-property-read\", )\n * ```\n *\n * **Parameters**\n * - `property` (required) path to a property (joined with `.` if needed). The property must be attached to `window`.\n *\n * **Examples**\n * ```\n * ! Aborts script when it tries to access `window.alert`\n * example.org#%#//scriptlet(\"abort-on-property-read\", \"alert\")\n *\n * ! Aborts script when it tries to access `navigator.language`\n * example.org#%#//scriptlet(\"abort-on-property-read\", \"navigator.language\")\n * ```\n */\n/* eslint-enable max-len */\nexport function abortOnPropertyRead(source, property) {\n if (!property) {\n return;\n }\n const rid = randomId();\n const abort = () => {\n hit(source);\n throw new ReferenceError(rid);\n };\n const setChainPropAccess = (owner, property) => {\n const chainInfo = getPropertyInChain(owner, property);\n let { base } = chainInfo;\n const { prop, chain } = chainInfo;\n if (chain) {\n const setter = (a) => {\n base = a;\n if (a instanceof Object) {\n setChainPropAccess(a, chain);\n }\n };\n Object.defineProperty(owner, prop, {\n get: () => base,\n set: setter,\n });\n return;\n }\n\n setPropertyAccess(base, prop, {\n get: abort,\n set: () => {\n },\n });\n };\n\n setChainPropAccess(window, property);\n\n window.onerror = createOnErrorHandler(rid)\n .bind();\n}\n\nabortOnPropertyRead.names = [\n 'abort-on-property-read',\n 'abort-on-property-read.js',\n 'ubo-abort-on-property-read.js',\n 'aopr.js',\n 'ubo-aopr.js',\n 'abp-abort-on-property-read',\n];\nabortOnPropertyRead.injections = [\n randomId,\n setPropertyAccess,\n getPropertyInChain,\n createOnErrorHandler,\n hit,\n];\n","import {\n randomId, setPropertyAccess, getPropertyInChain, createOnErrorHandler, hit,\n} from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet abort-on-property-write\n *\n * @description\n * Aborts a script when it attempts to **write** the specified property.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#abort-on-property-writejs-\n *\n * Related ABP source:\n * https://github.com/adblockplus/adblockpluscore/blob/6b2a309054cc23432102b85d13f12559639ef495/lib/content/snippets.js#L896\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"abort-on-property-write\", )\n * ```\n *\n * **Parameters**\n * - `property` (required) path to a property (joined with `.` if needed). The property must be attached to `window`.\n *\n * **Examples**\n * ```\n * ! Aborts all inline scripts trying to access `window.alert`\n * utils.escape('')\n * // => '<script></script>'\n * ```\n */\n/* eslint-enable max-len */\nexport function abortOnPropertyWrite(source, property) {\n if (!property) {\n return;\n }\n const rid = randomId();\n const abort = () => {\n hit(source);\n throw new ReferenceError(rid);\n };\n const setChainPropAccess = (owner, property) => {\n const chainInfo = getPropertyInChain(owner, property);\n let { base } = chainInfo;\n const { prop, chain } = chainInfo;\n if (chain) {\n const setter = (a) => {\n base = a;\n if (a instanceof Object) {\n setChainPropAccess(a, chain);\n }\n };\n Object.defineProperty(owner, prop, {\n get: () => base,\n set: setter,\n });\n return;\n }\n\n setPropertyAccess(base, prop, { set: abort });\n };\n\n setChainPropAccess(window, property);\n\n window.onerror = createOnErrorHandler(rid).bind();\n}\n\nabortOnPropertyWrite.names = [\n 'abort-on-property-write',\n 'abort-on-property-write.js',\n 'ubo-abort-on-property-write.js',\n 'aopw.js',\n 'ubo-aopw.js',\n 'abp-abort-on-property-write',\n];\n\nabortOnPropertyWrite.injections = [\n randomId,\n setPropertyAccess,\n getPropertyInChain,\n createOnErrorHandler,\n hit,\n];\n","import {\n hit, noopFunc, toRegExp, startsWith,\n} from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet prevent-setTimeout\n *\n * @description\n * Prevents a `setTimeout` call if:\n * 1) the text of the callback is matching the specified search string/regexp which does not start with `!`;\n * otherwise mismatched calls should be defused;\n * 2) the timeout is matching the specified delay; otherwise mismatched calls should be defused.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#no-settimeout-ifjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"prevent-setTimeout\"[, [, ]])\n * ```\n *\n * **Parameters**\n *\n * Call with no arguments will log calls to setTimeout while debugging (`log-setTimeout` superseding),\n * so production filter lists' rules definitely require at least one of the parameters:\n * - `search` (optional) string or regular expression.\n * If starts with `!`, scriptlet will not match the stringified callback but all other will be defused.\n * If do not start with `!`, the stringified callback will be matched.\n * If not set, prevents all `setTimeout` calls due to specified `delay`.\n * - `delay` (optional) must be an integer.\n * If starts with `!`, scriptlet will not match the delay but all other will be defused.\n * If do not start with `!`, the delay passed to the `setTimeout` call will be matched.\n *\n * **Examples**\n *\n * 1. Prevents `setTimeout` calls if the callback matches `/\\.test/` regardless of the delay.\n * ```bash\n * example.org#%#//scriptlet(\"prevent-setTimeout\", \"/\\.test/\")\n * ```\n *\n * For instance, the following call will be prevented:\n * ```javascript\n * setTimeout(function () {\n * window.test = \"value\";\n * }, 100);\n * ```\n *\n * 2. Prevents `setTimeout` calls if the callback does not contain `value`.\n * ```\n * example.org#%#//scriptlet(\"prevent-setTimeout\", \"!value\")\n * ```\n *\n * For instance, only the first of the following calls will be prevented:\n * ```javascript\n * setTimeout(function () {\n * window.test = \"test -- prevented\";\n * }, 300);\n * setTimeout(function () {\n * window.test = \"value -- executed\";\n * }, 400);\n * setTimeout(function () {\n * window.value = \"test -- executed\";\n * }, 500);\n * ```\n *\n * 3. Prevents `setTimeout` calls if the callback contains `value` and the delay is not set to `300`.\n * ```\n * example.org#%#//scriptlet(\"prevent-setTimeout\", \"value\", \"!300\")\n * ```\n *\n * For instance, only the first of the following calls will not be prevented:\n * ```javascript\n * setTimeout(function () {\n * window.test = \"value 1 -- executed\";\n * }, 300);\n * setTimeout(function () {\n * window.test = \"value 2 -- prevented\";\n * }, 400);\n * setTimeout(function () {\n * window.test = \"value 3 -- prevented\";\n * }, 500);\n * ```\n *\n * 4. Prevents `setTimeout` calls if the callback does not contain `value` and the delay is not set to `300`.\n * ```\n * example.org#%#//scriptlet(\"prevent-setTimeout\", \"!value\", \"!300\")\n * ```\n *\n * For instance, only the second of the following calls will be prevented:\n * ```javascript\n * setTimeout(function () {\n * window.test = \"test -- executed\";\n * }, 300);\n * setTimeout(function () {\n * window.test = \"test -- prevented\";\n * }, 400);\n * setTimeout(function () {\n * window.test = \"value -- executed\";\n * }, 400);\n * setTimeout(function () {\n * window.value = \"test -- executed\";\n * }, 500);\n * ```\n */\n/* eslint-enable max-len */\nexport function preventSetTimeout(source, match, delay) {\n const nativeTimeout = window.setTimeout;\n const nativeIsNaN = Number.isNaN || window.isNaN; // eslint-disable-line compat/compat\n const log = console.log.bind(console); // eslint-disable-line no-console\n\n // logs setTimeouts to console if no arguments have been specified\n const shouldLog = ((typeof match === 'undefined') && (typeof delay === 'undefined'));\n\n const INVERT_MARKER = '!';\n\n const isNotMatch = startsWith(match, INVERT_MARKER);\n if (isNotMatch) {\n match = match.slice(1);\n }\n const isNotDelay = startsWith(delay, INVERT_MARKER);\n if (isNotDelay) {\n delay = delay.slice(1);\n }\n\n delay = parseInt(delay, 10);\n delay = nativeIsNaN(delay) ? null : delay;\n\n match = match ? toRegExp(match) : toRegExp('/.?/');\n\n const timeoutWrapper = (callback, timeout, ...args) => {\n let shouldPrevent = false;\n if (shouldLog) {\n hit(source);\n log(`setTimeout(\"${callback.toString()}\", ${timeout})`);\n } else if (!delay) {\n shouldPrevent = match.test(callback.toString()) !== isNotMatch;\n } else if (match === '/.?/') {\n shouldPrevent = (timeout === delay) !== isNotDelay;\n } else {\n shouldPrevent = match.test(callback.toString()) !== isNotMatch\n && (timeout === delay) !== isNotDelay;\n }\n\n if (shouldPrevent) {\n hit(source);\n return nativeTimeout(noopFunc, timeout);\n }\n\n return nativeTimeout.apply(window, [callback, timeout, ...args]);\n };\n window.setTimeout = timeoutWrapper;\n}\n\npreventSetTimeout.names = [\n 'prevent-setTimeout',\n 'no-setTimeout-if.js', // new implementation of setTimeout-defuser.js\n 'ubo-no-setTimeout-if.js',\n 'setTimeout-defuser.js', // old name should be supported as well\n 'ubo-setTimeout-defuser.js',\n 'nostif.js', // new short name of no-setTimeout-if\n 'ubo-nostif.js',\n 'std.js', // old short scriptlet name\n 'ubo-std.js',\n];\n\npreventSetTimeout.injections = [toRegExp, startsWith, hit, noopFunc];\n","import {\n hit, noopFunc, toRegExp, startsWith,\n} from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet prevent-setInterval\n *\n * @description\n * Prevents a `setInterval` call if:\n * 1) the text of the callback is matching the specified `search` string/regexp which does not start with `!`;\n * otherwise mismatched calls should be defused;\n * 2) the interval is matching the specified `delay`; otherwise mismatched calls should be defused.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#no-setinterval-ifjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"prevent-setInterval\"[, [, ]])\n * ```\n *\n * **Parameters**\n *\n * Call with no arguments will log calls to setInterval while debugging (`log-setInterval` superseding),\n * so production filter lists' rules definitely require at least one of the parameters:\n * - `search` (optional) string or regular expression.\n * If starts with `!`, scriptlet will not match the stringified callback but all other will be defused.\n * If do not start with `!`, the stringified callback will be matched.\n * If not set, prevents all `setInterval` calls due to specified `delay`.\n * - `delay` (optional) must be an integer.\n * If starts with `!`, scriptlet will not match the delay but all other will be defused.\n * If do not start with `!`, the delay passed to the `setInterval` call will be matched.\n *\n * **Examples**\n *\n * 1. Prevents `setInterval` calls if the callback matches `/\\.test/` regardless of the delay.\n * ```bash\n * example.org#%#//scriptlet(\"prevent-setInterval\", \"/\\.test/\")\n * ```\n *\n * For instance, the following call will be prevented:\n * ```javascript\n * setInterval(function () {\n * window.test = \"value\";\n * }, 100);\n * ```\n *\n * 2. Prevents `setInterval` calls if the callback does not contain `value`.\n * ```\n * example.org#%#//scriptlet(\"prevent-setInterval\", \"!value\")\n * ```\n *\n * For instance, only the first of the following calls will be prevented:\n * ```javascript\n * setInterval(function () {\n * window.test = \"test -- prevented\";\n * }, 300);\n * setInterval(function () {\n * window.test = \"value -- executed\";\n * }, 400);\n * setInterval(function () {\n * window.value = \"test -- executed\";\n * }, 500);\n * ```\n *\n * 3. Prevents `setInterval` calls if the callback contains `value` and the delay is not set to `300`.\n * ```\n * example.org#%#//scriptlet(\"prevent-setInterval\", \"value\", \"!300\")\n * ```\n *\n * For instance, only the first of the following calls will not be prevented:\n * ```javascript\n * setInterval(function () {\n * window.test = \"value 1 -- executed\";\n * }, 300);\n * setInterval(function () {\n * window.test = \"value 2 -- prevented\";\n * }, 400);\n * setInterval(function () {\n * window.test = \"value 3 -- prevented\";\n * }, 500);\n * ```\n *\n * 4. Prevents `setInterval` calls if the callback does not contain `value` and the delay is not set to `300`.\n * ```\n * example.org#%#//scriptlet(\"prevent-setInterval\", \"!value\", \"!300\")\n * ```\n *\n * For instance, only the second of the following calls will be prevented:\n * ```javascript\n * setInterval(function () {\n * window.test = \"test -- executed\";\n * }, 300);\n * setInterval(function () {\n * window.test = \"test -- prevented\";\n * }, 400);\n * setInterval(function () {\n * window.test = \"value -- executed\";\n * }, 400);\n * setInterval(function () {\n * window.value = \"test -- executed\";\n * }, 500);\n * ```\n */\n/* eslint-enable max-len */\nexport function preventSetInterval(source, match, delay) {\n const nativeInterval = window.setInterval;\n const nativeIsNaN = Number.isNaN || window.isNaN; // eslint-disable-line compat/compat\n const log = console.log.bind(console); // eslint-disable-line no-console\n\n // logs setIntervals to console if no arguments have been specified\n const shouldLog = ((typeof match === 'undefined') && (typeof delay === 'undefined'));\n\n const INVERT_MARKER = '!';\n\n const isNotMatch = startsWith(match, INVERT_MARKER);\n if (isNotMatch) {\n match = match.slice(1);\n }\n const isNotDelay = startsWith(delay, INVERT_MARKER);\n if (isNotDelay) {\n delay = delay.slice(1);\n }\n\n delay = parseInt(delay, 10);\n delay = nativeIsNaN(delay) ? null : delay;\n\n match = match ? toRegExp(match) : toRegExp('/.?/');\n\n const intervalWrapper = (callback, interval, ...args) => {\n let shouldPrevent = false;\n if (shouldLog) {\n hit(source);\n log(`setInterval(\"${callback.toString()}\", ${interval})`);\n } else if (!delay) {\n shouldPrevent = match.test(callback.toString()) !== isNotMatch;\n } else if (match === '/.?/') {\n shouldPrevent = (interval === delay) !== isNotDelay;\n } else {\n shouldPrevent = match.test(callback.toString()) !== isNotMatch\n && (interval === delay) !== isNotDelay;\n }\n\n if (shouldPrevent) {\n hit(source);\n return nativeInterval(noopFunc, interval);\n }\n\n return nativeInterval.apply(window, [callback, interval, ...args]);\n };\n window.setInterval = intervalWrapper;\n}\n\npreventSetInterval.names = [\n 'prevent-setInterval',\n 'no-setInterval-if.js', // new implementation of setInterval-defuser.js\n 'ubo-no-setInterval-if.js',\n 'setInterval-defuser.js', // old name should be supported as well\n 'ubo-setInterval-defuser.js',\n 'nosiif.js', // new short name of no-setInterval-if\n 'ubo-nosiif.js',\n 'sid.js', // old short scriptlet name\n 'ubo-sid.js',\n];\n\npreventSetInterval.injections = [toRegExp, startsWith, hit, noopFunc];\n","import {\n toRegExp,\n substringBefore,\n substringAfter,\n startsWith,\n endsWith,\n hit,\n noopFunc,\n trueFunc,\n} from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet prevent-window-open\n *\n * @description\n * Prevents `window.open` calls when URL either matches or not matches the specified string/regexp. Using it without parameters prevents all `window.open` calls.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#windowopen-defuserjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet('prevent-window-open'[, [, [, ]]])\n * ```\n *\n * **Parameters**\n * - `match` (optional) defaults to \"matching\", any positive number or nothing for \"matching\", 0 or empty string for \"not matching\",\n * - `search` (optional) string or regexp for matching the URL passed to `window.open` call; defaults to search all `window.open` call.\n * - `replacement` (optional) string to return prop value or property instead of window.open; defaults to return noopFunc\n * **Example**\n *\n * 1. Prevent all `window.open` calls:\n * ```\n * example.org#%#//scriptlet('prevent-window-open')\n * ```\n *\n * 2. Prevent `window.open` for all URLs containing `example`:\n * ```\n * example.org#%#//scriptlet('prevent-window-open', '1', 'example')\n * ```\n *\n * 3. Prevent `window.open` for all URLs matching RegExp `/example\\./`:\n * ```\n * example.org#%#//scriptlet('prevent-window-open', '1', '/example\\./')\n * ```\n *\n * 4. Prevent `window.open` for all URLs **NOT** containing `example`:\n * ```\n * example.org#%#//scriptlet('prevent-window-open', '0', 'example')\n * ```\n * 5. Prevent all `window.open` calls and return 'trueFunc' instead of it if website checks it:\n * ```\n * example.org#%#//scriptlet('prevent-window-open', , , 'trueFunc')\n * ```\n * 6. Prevent all `window.open` and returns callback\n * which returns object with property 'propName'=noopFunc\n * as a property of window.open if website checks it:\n * ```\n * example.org#%#//scriptlet('prevent-window-open', '1', , '{propName=noopFunc}')\n * ```\n */\n/* eslint-enable max-len */\nexport function preventWindowOpen(source, match = 1, search, replacement) {\n // Default value of 'match' is needed to prevent all `window.open` calls\n // if the scriptlet is used without parameters\n const nativeOpen = window.open;\n\n // unary plus converts 'match' to a number\n // e.g.: +'1' -> 1; +false -> 0\n match = +match > 0;\n\n search = search\n ? toRegExp(search)\n : toRegExp('/.?/');\n\n // eslint-disable-next-line consistent-return\n const openWrapper = (str, ...args) => {\n if (match !== search.test(str)) {\n return nativeOpen.apply(window, [str, ...args]);\n }\n\n hit(source);\n\n let result;\n\n // defaults to return noopFunc instead of window.open\n if (!replacement) {\n result = noopFunc;\n } else if (replacement === 'trueFunc') {\n result = trueFunc;\n } else if (replacement.indexOf('=') > -1) {\n // We should return noopFunc instead of window.open\n // but with some property if website checks it (examples 5, 6)\n // https://github.com/AdguardTeam/Scriptlets/issues/71\n const isProp = startsWith(replacement, '{') && endsWith(replacement, '}');\n if (isProp) {\n const propertyPart = replacement.slice(1, -1);\n const propertyName = substringBefore(propertyPart, '=');\n const propertyValue = substringAfter(propertyPart, '=');\n if (propertyValue === 'noopFunc') {\n result = () => {\n const resObj = { };\n resObj[propertyName] = noopFunc;\n return resObj;\n };\n }\n }\n }\n\n return result;\n };\n\n window.open = openWrapper;\n}\n\npreventWindowOpen.names = [\n 'prevent-window-open',\n 'window.open-defuser.js',\n 'ubo-window.open-defuser.js',\n];\n\npreventWindowOpen.injections = [\n toRegExp,\n startsWith,\n endsWith,\n substringBefore,\n substringAfter,\n hit,\n noopFunc,\n trueFunc,\n];\n","import {\n randomId,\n setPropertyAccess,\n getPropertyInChain,\n toRegExp,\n createOnErrorHandler,\n hit,\n} from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet abort-current-inline-script\n *\n * @description\n * Aborts an inline script when it attempts to **read** the specified property\n * AND when the contents of the `\n * ```\n *\n * 3. Aborts inline scripts which are trying to access `window.alert` and match this regexp: `/Hello.+world/`.\n * ```\n * example.org#%#//scriptlet('abort-current-inline-script', 'alert', '/Hello.+world/')\n * ```\n *\n * For instance, the following scripts will be aborted:\n * ```html\n * \n * ```\n * ```html\n * \n * ```\n *\n * This script will not be aborted:\n * ```html\n * \n * ```\n */\n/* eslint-enable max-len */\nexport function abortCurrentInlineScript(source, property, search = null) {\n const regex = search ? toRegExp(search) : null;\n const rid = randomId();\n\n const getCurrentScript = () => {\n if (!document.currentScript) { // eslint-disable-line compat/compat\n const scripts = document.getElementsByTagName('script');\n return scripts[scripts.length - 1];\n }\n return document.currentScript; // eslint-disable-line compat/compat\n };\n\n const ourScript = getCurrentScript();\n\n const abort = () => {\n const scriptEl = getCurrentScript();\n let content = scriptEl.textContent;\n\n // We are using Node.prototype.textContent property descriptor\n // to get the real script content\n // even when document.currentScript.textContent is replaced.\n // https://github.com/AdguardTeam/Scriptlets/issues/57#issuecomment-593638991\n try {\n const textContentGetter = Object.getOwnPropertyDescriptor(Node.prototype, 'textContent').get;\n content = textContentGetter.call(scriptEl);\n } catch (e) { } // eslint-disable-line no-empty\n\n if (scriptEl instanceof HTMLScriptElement\n && content.length > 0\n && scriptEl !== ourScript\n && (!regex || regex.test(content))) {\n hit(source);\n throw new ReferenceError(rid);\n }\n };\n\n const setChainPropAccess = (owner, property) => {\n const chainInfo = getPropertyInChain(owner, property);\n let { base } = chainInfo;\n const { prop, chain } = chainInfo;\n\n // The scriptlet might be executed before the chain property has been created\n // (for instance, document.body before the HTML body was loaded).\n // In this case we're checking whether the base element exists or not\n // and if not, we simply exit without overriding anything.\n // e.g. https://github.com/AdguardTeam/Scriptlets/issues/57#issuecomment-575841092\n if (base instanceof Object === false && base === null) {\n const props = property.split('.');\n const propIndex = props.indexOf(prop);\n const baseName = props[propIndex - 1];\n console.log(`The scriptlet had been executed before the ${baseName} was loaded.`); // eslint-disable-line no-console\n return;\n }\n\n if (chain) {\n const setter = (a) => {\n base = a;\n if (a instanceof Object) {\n setChainPropAccess(a, chain);\n }\n };\n Object.defineProperty(owner, prop, {\n get: () => base,\n set: setter,\n });\n return;\n }\n\n let currentValue = base[prop];\n setPropertyAccess(base, prop, {\n set: (value) => {\n abort();\n currentValue = value;\n },\n get: () => {\n abort();\n return currentValue;\n },\n });\n };\n\n setChainPropAccess(window, property);\n\n window.onerror = createOnErrorHandler(rid)\n .bind();\n}\n\nabortCurrentInlineScript.names = [\n 'abort-current-inline-script',\n 'abort-current-inline-script.js',\n 'ubo-abort-current-inline-script.js',\n 'acis.js',\n 'ubo-acis.js',\n 'abp-abort-current-inline-script',\n];\n\nabortCurrentInlineScript.injections = [\n randomId,\n setPropertyAccess,\n getPropertyInChain,\n toRegExp,\n createOnErrorHandler,\n hit,\n];\n","import {\n hit,\n noopFunc,\n trueFunc,\n falseFunc,\n getPropertyInChain,\n setPropertyAccess,\n} from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet set-constant\n *\n * @description\n * Creates a constant property and assigns it one of the values from the predefined list.\n *\n * > Actually, it's not a constant. Please note, that it can be rewritten with a value of a different type.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#set-constantjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"set-constant\", , )\n * ```\n *\n * **Parameters**\n * - `property` (required) path to a property (joined with `.` if needed). The property must be attached to `window`.\n * - `value` (required). Possible values:\n * - positive decimal integer `<= 32767`\n * - one of the predefined constants:\n * - `undefined`\n * - `false`\n * - `true`\n * - `null`\n * - `noopFunc` - function with empty body\n * - `trueFunc` - function returning true\n * - `falseFunc` - function returning false\n * - `''` - empty string\n * - `-1` - number value `-1`\n *\n * **Examples**\n * ```\n * ! window.firstConst === false // this comparision will return true\n * example.org#%#//scriptlet(\"set-constant\", \"firstConst\", \"false\")\n *\n * ! window.secondConst() === true // call to the secondConst will return true\n * example.org#%#//scriptlet(\"set-constant\", \"secondConst\", \"trueFunc\")\n * ```\n */\n/* eslint-enable max-len */\nexport function setConstant(source, property, value) {\n if (!property) {\n return;\n }\n\n const nativeIsNaN = Number.isNaN || window.isNaN; // eslint-disable-line compat/compat\n\n let constantValue;\n if (value === 'undefined') {\n constantValue = undefined;\n } else if (value === 'false') {\n constantValue = false;\n } else if (value === 'true') {\n constantValue = true;\n } else if (value === 'null') {\n constantValue = null;\n } else if (value === 'noopFunc') {\n constantValue = noopFunc;\n } else if (value === 'trueFunc') {\n constantValue = trueFunc;\n } else if (value === 'falseFunc') {\n constantValue = falseFunc;\n } else if (/^\\d+$/.test(value)) {\n constantValue = parseFloat(value);\n if (nativeIsNaN(constantValue)) {\n return;\n }\n if (Math.abs(constantValue) > 0x7FFF) {\n return;\n }\n } else if (value === '-1') {\n constantValue = -1;\n } else if (value === '') {\n constantValue = '';\n } else {\n return;\n }\n\n let canceled = false;\n const mustCancel = (value) => {\n if (canceled) {\n return canceled;\n }\n canceled = value !== undefined\n && constantValue !== undefined\n && typeof value !== typeof constantValue;\n return canceled;\n };\n\n const setChainPropAccess = (owner, property) => {\n const chainInfo = getPropertyInChain(owner, property);\n let { base } = chainInfo;\n const { prop, chain } = chainInfo;\n if (chain) {\n const setter = (a) => {\n base = a;\n if (a instanceof Object) {\n setChainPropAccess(a, chain);\n }\n };\n Object.defineProperty(owner, prop, {\n get: () => base,\n set: setter,\n });\n return;\n }\n\n if (mustCancel(base[prop])) { return; }\n\n hit(source);\n setPropertyAccess(base, prop, {\n get: () => constantValue,\n set: (a) => {\n if (mustCancel(a)) {\n constantValue = a;\n }\n },\n });\n };\n\n setChainPropAccess(window, property);\n}\n\nsetConstant.names = [\n 'set-constant',\n 'set-constant.js',\n 'ubo-set-constant.js',\n 'set.js',\n 'ubo-set.js',\n];\nsetConstant.injections = [\n getPropertyInChain,\n setPropertyAccess,\n hit,\n noopFunc,\n trueFunc,\n falseFunc,\n];\n","import { hit, toRegExp } from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet remove-cookie\n *\n * @description\n * Removes current page cookies by passed string matching with name. For current domain and subdomains. Runs on load and before unload.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#cookie-removerjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"remove-cookie\"[, match])\n * ```\n *\n * **Parameters**\n * - `match` (optional) String or regex matching the cookie name. If not specified all accessible cookies will be removed.\n *\n * **Examples**\n * 1. Removes all cookies:\n * ```\n * example.org#%#//scriptlet(\"remove-cookie\")\n * ```\n *\n * 2. Removes cookies which name contains `example` string.\n * ```\n * example.org#%#//scriptlet(\"remove-cookie\", \"example\")\n * ```\n *\n * For instance this cookie will be removed\n * ```javascript\n * document.cookie = '__example=randomValue';\n * ```\n */\n/* eslint-enable max-len */\nexport function removeCookie(source, match) {\n const regex = match ? toRegExp(match) : toRegExp('/.?/');\n\n const removeCookieFromHost = (cookieName, hostName) => {\n const cookieSpec = `${cookieName}=`;\n const domain1 = `; domain=${hostName}`;\n const domain2 = `; domain=.${hostName}`;\n const path = '; path=/';\n const expiration = '; expires=Thu, 01 Jan 1970 00:00:00 GMT';\n document.cookie = cookieSpec + expiration;\n document.cookie = cookieSpec + domain1 + expiration;\n document.cookie = cookieSpec + domain2 + expiration;\n document.cookie = cookieSpec + path + expiration;\n document.cookie = cookieSpec + domain1 + path + expiration;\n document.cookie = cookieSpec + domain2 + path + expiration;\n hit(source);\n };\n\n const rmCookie = () => {\n document.cookie.split(';').forEach((cookieStr) => {\n const pos = cookieStr.indexOf('=');\n if (pos === -1) {\n return;\n }\n\n const cookieName = cookieStr.slice(0, pos).trim();\n if (!regex.test(cookieName)) {\n return;\n }\n\n const hostParts = document.location.hostname.split('.');\n for (let i = 0; i <= hostParts.length - 1; i += 1) {\n const hostName = hostParts.slice(i).join('.');\n if (hostName) {\n removeCookieFromHost(cookieName, hostName);\n }\n }\n });\n };\n rmCookie();\n window.addEventListener('beforeunload', rmCookie);\n}\n\nremoveCookie.names = [\n 'remove-cookie',\n 'cookie-remover.js',\n 'ubo-cookie-remover.js',\n];\n\nremoveCookie.injections = [toRegExp, hit];\n","import { hit, toRegExp } from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet prevent-addEventListener\n *\n * @description\n * Prevents adding event listeners for the specified events and callbacks.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#addeventlistener-defuserjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"prevent-addEventListener\"[, eventSearch[, functionSearch]])\n * ```\n *\n * **Parameters**\n * - `eventSearch` (optional) String or regex matching the event name. If not specified, the scriptlets prevents all event listeners.\n * - `functionSearch` (optional) String or regex matching the event listener function body. If not set, the scriptlet prevents all event listeners with event name matching `eventSearch`.\n *\n * **Examples**\n * 1. Prevent all `click` listeners:\n * ```\n * example.org#%#//scriptlet(\"prevent-addEventListener\", \"click\")\n * ```\n\n2. Prevent 'click' listeners with the callback body containing `searchString`.\n * ```\n * example.org#%#//scriptlet(\"prevent-addEventListener\", \"click\", \"searchString\")\n * ```\n *\n * For instance, this listener will not be called:\n * ```javascript\n * el.addEventListener('click', () => {\n * window.test = 'searchString';\n * });\n * ```\n */\n/* eslint-enable max-len */\nexport function preventAddEventListener(source, eventSearch, funcSearch) {\n eventSearch = eventSearch ? toRegExp(eventSearch) : toRegExp('/.?/');\n funcSearch = funcSearch ? toRegExp(funcSearch) : toRegExp('/.?/');\n\n const nativeAddEventListener = window.EventTarget.prototype.addEventListener;\n function addEventListenerWrapper(eventName, callback, ...args) {\n // The scriptlet might cause a website broke\n // if the website uses test addEventListener with callback = null\n // https://github.com/AdguardTeam/Scriptlets/issues/76\n let funcToCheck = callback;\n if (callback && typeof callback === 'function') {\n funcToCheck = callback.toString();\n }\n\n if (eventSearch.test(eventName.toString()) && funcSearch.test(funcToCheck)) {\n hit(source);\n return undefined;\n }\n return nativeAddEventListener.apply(this, [eventName, callback, ...args]);\n }\n\n window.EventTarget.prototype.addEventListener = addEventListenerWrapper;\n}\n\npreventAddEventListener.names = [\n 'prevent-addEventListener',\n 'addEventListener-defuser.js',\n 'ubo-addEventListener-defuser.js',\n 'aeld.js',\n 'ubo-aeld.js',\n];\n\npreventAddEventListener.injections = [toRegExp, hit];\n","/* eslint-disable consistent-return, no-eval */\nimport { hit } from '../helpers';\n\n/**\n * @scriptlet prevent-bab\n *\n * @description\n * Prevents BlockAdblock script from detecting an ad blocker.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#bab-defuserjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"prevent-bab\")\n * ```\n */\nexport function preventBab(source) {\n const nativeSetTimeout = window.setTimeout;\n const babRegex = /\\.bab_elementid.$/;\n\n window.setTimeout = (callback, ...args) => {\n if (typeof callback !== 'string' || !babRegex.test(callback)) {\n return nativeSetTimeout.call(this, callback, ...args);\n }\n hit(source);\n };\n\n const signatures = [\n ['blockadblock'],\n ['babasbm'],\n [/getItem\\('babn'\\)/],\n ['getElementById', 'String.fromCharCode', 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789', 'charAt', 'DOMContentLoaded', 'AdBlock', 'addEventListener', 'doScroll', 'fromCharCode', '<<2|r>>4', 'sessionStorage', 'clientWidth', 'localStorage', 'Math', 'random'],\n ];\n const check = (str) => {\n for (let i = 0; i < signatures.length; i += 1) {\n const tokens = signatures[i];\n let match = 0;\n for (let j = 0; j < tokens.length; j += 1) {\n const token = tokens[j];\n const found = token instanceof RegExp ? token.test(str) : str.indexOf(token) > -1;\n if (found) {\n match += 1;\n }\n }\n if (match / tokens.length >= 0.8) {\n return true;\n }\n }\n return false;\n };\n\n const nativeEval = window.eval;\n window.eval = (str) => {\n if (!check(str)) {\n return nativeEval(str);\n }\n hit(source);\n const bodyEl = document.body;\n if (bodyEl) {\n bodyEl.style.removeProperty('visibility');\n }\n const el = document.getElementById('babasbmsgx');\n if (el) {\n el.parentNode.removeChild(el);\n }\n };\n}\n\npreventBab.names = [\n 'prevent-bab',\n 'nobab.js',\n 'ubo-nobab.js',\n 'bab-defuser.js',\n 'ubo-bab-defuser.js',\n];\n\npreventBab.injections = [hit];\n","/* eslint-disable no-unused-vars, no-extra-bind, func-names */\nimport { hit, noopFunc } from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet nowebrtc\n *\n * @description\n * Disables WebRTC by overriding `RTCPeerConnection`. The overriden function will log every attempt to create a new connection.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#nowebrtcjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"nowebrtc\")\n * ```\n */\n/* eslint-enable max-len */\nexport function nowebrtc(source) {\n let propertyName = '';\n if (window.RTCPeerConnection) {\n propertyName = 'RTCPeerConnection';\n } else if (window.webkitRTCPeerConnection) {\n propertyName = 'webkitRTCPeerConnection';\n }\n\n if (propertyName === '') {\n return;\n }\n\n const rtcReplacement = (config) => {\n hit(source, `Document tried to create an RTCPeerConnection: ${config}`);\n };\n rtcReplacement.prototype = {\n close: noopFunc,\n createDataChannel: noopFunc,\n createOffer: noopFunc,\n setRemoteDescription: noopFunc,\n };\n const rtc = window[propertyName];\n window[propertyName] = rtcReplacement;\n if (rtc.prototype) {\n rtc.prototype.createDataChannel = function (a, b) {\n return {\n close: noopFunc,\n send: noopFunc,\n };\n }.bind(null);\n }\n}\n\nnowebrtc.names = [\n 'nowebrtc',\n 'nowebrtc.js',\n 'ubo-nowebrtc.js',\n];\n\nnowebrtc.injections = [hit, noopFunc];\n","/* eslint-disable no-console */\nimport { hit } from '../helpers';\n\n/**\n * @scriptlet log-addEventListener\n *\n * @description\n * Logs all addEventListener calls to the console.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#addeventlistener-loggerjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"log-addEventListener\")\n * ```\n */\nexport function logAddEventListener(source) {\n const log = console.log.bind(console);\n const nativeAddEventListener = window.EventTarget.prototype.addEventListener;\n function addEventListenerWrapper(eventName, callback, ...args) {\n hit(source);\n // The scriptlet might cause a website broke\n // if the website uses test addEventListener with callback = null\n // https://github.com/AdguardTeam/Scriptlets/issues/76\n let callbackToLog = callback;\n if (callback && typeof callback === 'function') {\n callbackToLog = callback.toString();\n }\n log(`addEventListener(\"${eventName}\", ${callbackToLog})`);\n return nativeAddEventListener.apply(this, [eventName, callback, ...args]);\n }\n window.EventTarget.prototype.addEventListener = addEventListenerWrapper;\n}\n\nlogAddEventListener.names = [\n 'log-addEventListener',\n 'addEventListener-logger.js',\n 'ubo-addEventListener-logger.js',\n 'aell.js',\n 'ubo-aell.js',\n];\n\nlogAddEventListener.injections = [hit];\n","/* eslint-disable no-console, no-eval */\nimport { hit } from '../helpers';\n\n/**\n * @scriptlet log-eval\n *\n * @description\n * Logs all `eval()` or `new Function()` calls to the console.\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"log-eval\")\n * ```\n */\nexport function logEval(source) {\n const log = console.log.bind(console);\n // wrap eval function\n const nativeEval = window.eval;\n function evalWrapper(str) {\n hit(source);\n log(`eval(\"${str}\")`);\n return nativeEval(str);\n }\n window.eval = evalWrapper;\n\n // wrap new Function\n const nativeFunction = window.Function;\n\n function FunctionWrapper(...args) {\n hit(source);\n log(`new Function(${args.join(', ')})`);\n return nativeFunction.apply(this, [...args]);\n }\n\n FunctionWrapper.prototype = Object.create(nativeFunction.prototype);\n FunctionWrapper.prototype.constructor = FunctionWrapper;\n\n window.Function = FunctionWrapper;\n}\n\nlogEval.names = [\n 'log-eval',\n];\n\nlogEval.injections = [hit];\n","/**\n * @scriptlet log\n *\n * @description\n * A simple scriptlet which only purpose is to print arguments to console.\n * This scriptlet can be helpful for debugging and troubleshooting other scriptlets.\n * **Example**\n * ```\n * example.org#%#//scriptlet(\"log\", \"arg1\", \"arg2\")\n * ```\n */\nexport function log(...args) {\n console.log(args); // eslint-disable-line no-console\n}\nlog.names = ['log'];\n","/* eslint-disable no-eval, no-extra-bind */\nimport { hit } from '../helpers';\n\n/**\n * @scriptlet noeval\n *\n * @description\n * Prevents page to use eval.\n * Notifies about attempts in the console\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#noevaljs-\n *\n * It also can be used as `$redirect` rules sometimes.\n * See [redirect description](../wiki/about-redirects.md#noeval).\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"noeval\")\n * ```\n */\nexport function noeval(source) {\n window.eval = function evalWrapper(s) {\n hit(source, `AdGuard has prevented eval:\\n${s}`);\n }.bind();\n}\n\nnoeval.names = [\n 'noeval',\n 'noeval.js',\n 'silent-noeval.js',\n 'ubo-noeval.js',\n 'ubo-silent-noeval.js',\n];\n\nnoeval.injections = [hit];\n","/* eslint-disable no-eval, no-extra-bind, func-names */\n\nimport { toRegExp, hit } from '../helpers';\n\n/**\n * @scriptlet prevent-eval-if\n *\n * @description\n * Prevents page to use eval matching payload.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#noeval-ifjs-\n *\n * **Parameters**\n * - `search` string or regexp matching stringified eval payload\n *\n * **Examples**\n * ```\n * !\n * ```\n *\n * @param {string|RegExp} [search] string or regexp matching stringified eval payload\n */\nexport function preventEvalIf(source, search) {\n search = search ? toRegExp(search) : toRegExp('/.?/');\n\n const nativeEval = window.eval;\n window.eval = function (payload) {\n if (!search.test(payload.toString())) {\n return nativeEval.call(window, payload);\n }\n hit(source, payload);\n return undefined;\n }.bind(window);\n}\n\npreventEvalIf.names = [\n 'prevent-eval-if',\n 'noeval-if.js',\n 'ubo-noeval-if.js',\n];\n\npreventEvalIf.injections = [toRegExp, hit];\n","/* eslint-disable no-console, func-names, no-multi-assign */\nimport { hit, noopFunc, noopThis } from '../helpers';\n\n/**\n * @scriptlet prevent-fab-3.2.0\n *\n * @description\n * Prevents execution of the FAB script v3.2.0.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#fuckadblockjs-320-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"prevent-fab-3.2.0\")\n * ```\n */\nexport function preventFab(source) {\n hit(source);\n const Fab = function () {};\n Fab.prototype.check = noopFunc;\n Fab.prototype.clearEvent = noopFunc;\n Fab.prototype.emitEvent = noopFunc;\n Fab.prototype.on = function (a, b) {\n if (!a) {\n b();\n }\n return this;\n };\n Fab.prototype.onDetected = noopThis;\n Fab.prototype.onNotDetected = function (a) {\n a();\n return this;\n };\n Fab.prototype.setOption = noopFunc;\n window.FuckAdBlock = window.BlockAdBlock = Fab;\n //\n window.fuckAdBlock = window.blockAdBlock = new Fab();\n}\n\npreventFab.names = [\n 'prevent-fab-3.2.0',\n 'nofab.js',\n 'ubo-nofab.js',\n 'fuckadblock.js-3.2.0',\n 'ubo-fuckadblock.js-3.2.0',\n];\n\npreventFab.injections = [hit, noopFunc, noopThis];\n","/* eslint-disable no-console, func-names, no-multi-assign */\nimport { hit } from '../helpers';\n\n/**\n * @scriptlet set-popads-dummy\n *\n * @description\n * Sets static properties PopAds and popns.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#popads-dummyjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"set-popads-dummy\")\n * ```\n */\nexport function setPopadsDummy(source) {\n delete window.PopAds;\n delete window.popns;\n Object.defineProperties(window, {\n PopAds: {\n get: () => {\n hit(source);\n return {};\n },\n },\n popns: {\n get: () => {\n hit(source);\n return {};\n },\n },\n });\n}\n\nsetPopadsDummy.names = [\n 'set-popads-dummy',\n 'popads-dummy.js',\n 'ubo-popads-dummy.js',\n];\n\nsetPopadsDummy.injections = [hit];\n","import {\n hit, createOnErrorHandler, randomId,\n} from '../helpers';\n\n/**\n * @scriptlet prevent-popads-net\n *\n * @description\n * Aborts on property write (PopAds, popns), throws reference error with random id.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#popadsnetjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"prevent-popads-net\")\n * ```\n */\nexport function preventPopadsNet(source) {\n const rid = randomId();\n\n const throwError = () => {\n throw new ReferenceError(rid);\n };\n\n delete window.PopAds;\n delete window.popns;\n Object.defineProperties(window, {\n PopAds: { set: throwError },\n popns: { set: throwError },\n });\n\n window.onerror = createOnErrorHandler(rid).bind();\n hit(source);\n}\n\npreventPopadsNet.names = [\n 'prevent-popads-net',\n 'popads.net.js',\n 'ubo-popads.net.js',\n];\n\npreventPopadsNet.injections = [createOnErrorHandler, randomId, hit];\n","/* eslint-disable func-names */\nimport { hit, setPropertyAccess } from '../helpers';\n\n/**\n * @scriptlet prevent-adfly\n *\n * @description\n * Prevents anti-adblock scripts on adfly short links.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#adfly-defuserjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"prevent-adfly\")\n * ```\n */\nexport function preventAdfly(source) {\n const isDigit = (data) => /^\\d$/.test(data);\n const handler = function (encodedURL) {\n let evenChars = '';\n let oddChars = '';\n for (let i = 0; i < encodedURL.length; i += 1) {\n if (i % 2 === 0) {\n evenChars += encodedURL.charAt(i);\n } else {\n oddChars = encodedURL.charAt(i) + oddChars;\n }\n }\n\n let data = (evenChars + oddChars).split('');\n\n for (let i = 0; i < data.length; i += 1) {\n if (isDigit(data[i])) {\n for (let ii = i + 1; ii < data.length; ii += 1) {\n if (isDigit(data[ii])) {\n // eslint-disable-next-line no-bitwise\n const temp = parseInt(data[i], 10) ^ parseInt(data[ii], 10);\n if (temp < 10) {\n data[i] = temp.toString();\n }\n i = ii;\n break;\n }\n }\n }\n }\n data = data.join('');\n const decodedURL = window.atob(data).slice(16, -16);\n /* eslint-disable compat/compat */\n if (window.stop) {\n window.stop();\n }\n /* eslint-enable compat/compat */\n window.onbeforeunload = null;\n window.location.href = decodedURL;\n };\n\n let val;\n // Do not apply handler more than one time\n let applyHandler = true;\n\n const result = setPropertyAccess(window, 'ysmm', {\n configurable: false,\n set: (value) => {\n if (applyHandler) {\n applyHandler = false;\n try {\n if (typeof value === 'string') {\n handler(value);\n }\n } catch (err) { } // eslint-disable-line no-empty\n }\n val = value;\n },\n get: () => val,\n });\n\n if (result) {\n hit(source);\n } else {\n window.console.error('Failed to set up prevent-adfly scriptlet');\n }\n}\n\npreventAdfly.names = [\n 'prevent-adfly',\n 'adfly-defuser.js',\n 'ubo-adfly-defuser.js',\n];\n\npreventAdfly.injections = [setPropertyAccess, hit];\n","import {\n randomId,\n setPropertyAccess,\n getPropertyInChain,\n createOnErrorHandler,\n hit,\n noopFunc,\n} from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet debug-on-property-read\n *\n * @description\n * This scriptlet is basically the same as [abort-on-property-read](#abort-on-property-read), but instead of aborting it starts the debugger.\n *\n * **It is not supposed to be used in production filter lists!**\n *\n * **Syntax**\n * ```\n * ! Aborts script when it tries to access `window.alert`\n * example.org#%#//scriptlet(\"debug-on-property-read\", \"alert\")\n * ```\n */\n/* eslint-enable max-len */\nexport function debugOnPropertyRead(source, property) {\n if (!property) {\n return;\n }\n const rid = randomId();\n const abort = () => {\n hit(source);\n // eslint-disable-next-line no-debugger\n debugger;\n };\n const setChainPropAccess = (owner, property) => {\n const chainInfo = getPropertyInChain(owner, property);\n let { base } = chainInfo;\n const { prop, chain } = chainInfo;\n if (chain) {\n const setter = (a) => {\n base = a;\n if (a instanceof Object) {\n setChainPropAccess(a, chain);\n }\n };\n Object.defineProperty(owner, prop, {\n get: () => base,\n set: setter,\n });\n return;\n }\n\n setPropertyAccess(base, prop, {\n get: abort,\n set: noopFunc,\n });\n };\n\n setChainPropAccess(window, property);\n\n window.onerror = createOnErrorHandler(rid)\n .bind();\n}\n\ndebugOnPropertyRead.names = [\n 'debug-on-property-read',\n];\ndebugOnPropertyRead.injections = [\n randomId,\n setPropertyAccess,\n getPropertyInChain,\n createOnErrorHandler,\n hit,\n noopFunc,\n];\n","import {\n randomId,\n setPropertyAccess,\n getPropertyInChain,\n createOnErrorHandler,\n hit,\n} from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet debug-on-property-write\n *\n * @description\n * This scriptlet is basically the same as [abort-on-property-write](#abort-on-property-write), but instead of aborting it starts the debugger.\n *\n * **It is not supposed to be used in production filter lists!**\n *\n * **Syntax**\n * ```\n * ! Aborts script when it tries to write in property `window.test`\n * example.org#%#//scriptlet(\"debug-on-property-write\", \"test\")\n * ```\n */\n/* eslint-enable max-len */\nexport function debugOnPropertyWrite(source, property) {\n if (!property) {\n return;\n }\n const rid = randomId();\n const abort = () => {\n hit(source);\n // eslint-disable-next-line no-debugger\n debugger;\n };\n const setChainPropAccess = (owner, property) => {\n const chainInfo = getPropertyInChain(owner, property);\n let { base } = chainInfo;\n const { prop, chain } = chainInfo;\n if (chain) {\n const setter = (a) => {\n base = a;\n if (a instanceof Object) {\n setChainPropAccess(a, chain);\n }\n };\n Object.defineProperty(owner, prop, {\n get: () => base,\n set: setter,\n });\n return;\n }\n\n setPropertyAccess(base, prop, { set: abort });\n };\n\n setChainPropAccess(window, property);\n\n window.onerror = createOnErrorHandler(rid).bind();\n}\n\ndebugOnPropertyWrite.names = [\n 'debug-on-property-write',\n];\n\ndebugOnPropertyWrite.injections = [\n randomId,\n setPropertyAccess,\n getPropertyInChain,\n createOnErrorHandler,\n hit,\n];\n","import {\n randomId,\n setPropertyAccess,\n getPropertyInChain,\n toRegExp,\n createOnErrorHandler,\n hit,\n} from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet debug-current-inline-script\n *\n * @description\n * This scriptlet is basically the same as [abort-current-inline-script](#abort-current-inline-script), but instead of aborting it starts the debugger.\n *\n * **It is not supposed to be used in production filter lists!**\n *\n * **Syntax**\n *```\n * ! Aborts script when it tries to access `window.alert`\n * example.org#%#//scriptlet(\"debug-current-inline-script\", \"alert\")\n * ```\n */\n/* eslint-enable max-len */\nexport function debugCurrentInlineScript(source, property, search = null) {\n const regex = search ? toRegExp(search) : null;\n const rid = randomId();\n\n const getCurrentScript = () => {\n if (!document.currentScript) { // eslint-disable-line compat/compat\n const scripts = document.getElementsByTagName('script');\n return scripts[scripts.length - 1];\n }\n return document.currentScript; // eslint-disable-line compat/compat\n };\n\n const ourScript = getCurrentScript();\n\n const abort = () => {\n const scriptEl = getCurrentScript();\n if (scriptEl instanceof HTMLScriptElement\n && scriptEl.textContent.length > 0\n && scriptEl !== ourScript\n && (!regex || regex.test(scriptEl.textContent))) {\n hit(source);\n // eslint-disable-next-line no-debugger\n debugger;\n }\n };\n\n const setChainPropAccess = (owner, property) => {\n const chainInfo = getPropertyInChain(owner, property);\n let { base } = chainInfo;\n const { prop, chain } = chainInfo;\n if (chain) {\n const setter = (a) => {\n base = a;\n if (a instanceof Object) {\n setChainPropAccess(a, chain);\n }\n };\n Object.defineProperty(owner, prop, {\n get: () => base,\n set: setter,\n });\n return;\n }\n\n let currentValue = base[prop];\n setPropertyAccess(base, prop, {\n set: (value) => {\n abort();\n currentValue = value;\n },\n get: () => {\n abort();\n return currentValue;\n },\n });\n };\n\n setChainPropAccess(window, property);\n\n window.onerror = createOnErrorHandler(rid)\n .bind();\n}\n\ndebugCurrentInlineScript.names = [\n 'debug-current-inline-script',\n];\n\ndebugCurrentInlineScript.injections = [\n randomId,\n setPropertyAccess,\n getPropertyInChain,\n toRegExp,\n createOnErrorHandler,\n hit,\n];\n","import { hit, observeDOMChanges } from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet remove-attr\n *\n * @description\n * Removes the specified attributes from DOM nodes. This scriptlet runs once when the page loads\n * and after that periodically in order to DOM tree changes.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#remove-attrjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet('remove-attr', attrs[, selector])\n * ```\n *\n * - `attrs` — required, attribute or list of attributes joined by '|';\n * - `selector` — optional, CSS selector, specifies DOM nodes from which the attributes will be removed\n *\n * **Examples**\n * 1. Removes by attribute\n * ```\n * example.org#%#//scriptlet('remove-attr', 'example|test')\n * ```\n *\n * ```html\n * \n *
Some text
\n *\n * \n *
Some text
\n * ```\n *\n * 2. Removes with specified selector\n * ```\n * example.org#%#//scriptlet('remove-attr', 'example', 'div[class=\"inner\"]')\n * ```\n *\n * ```html\n * \n *
\n *
Some text
\n *
\n *\n * \n *
\n *
Some text
\n *
\n * ```\n */\n/* eslint-enable max-len */\nexport function removeAttr(source, attrs, selector) {\n if (!attrs) { return; }\n attrs = attrs.split(/\\s*\\|\\s*/);\n if (!selector) {\n selector = `[${attrs.join('],[')}]`;\n }\n\n const rmattr = () => {\n const nodes = [].slice.call(document.querySelectorAll(selector));\n let removed = false;\n nodes.forEach((node) => {\n attrs.forEach((attr) => {\n node.removeAttribute(attr);\n removed = true;\n });\n });\n if (removed) {\n hit(source);\n }\n };\n\n rmattr();\n\n // 'true' for observing attributes\n observeDOMChanges(rmattr, true);\n}\n\nremoveAttr.names = [\n 'remove-attr',\n 'remove-attr.js',\n 'ubo-remove-attr.js',\n 'ra.js',\n 'ubo-ra.js',\n];\n\nremoveAttr.injections = [hit, observeDOMChanges];\n","import { hit, observeDOMChanges } from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet remove-class\n *\n * @description\n * Removes the specified classes from DOM nodes. This scriptlet runs once after the page loads\n * and after that periodically in order to DOM tree changes.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#remove-classjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet('remove-class', classes[, selector])\n * ```\n *\n * - `classes` — required, class or list of classes separated by '|';\n * - `selector` — optional, CSS selector, specifies DOM nodes from which the classes will be removed;\n * if there is no selector, every class independently will be removed from all nodes which has one\n *\n * **Examples**\n * 1. Removes by classes\n * ```\n * example.org#%#//scriptlet('remove-class', 'example|test')\n * ```\n *\n * ```html\n * \n *
Some text
\n *
Some text
\n *
Some text
\n *\n * \n *
Some text
\n *
Some text
\n *
Some text
\n * ```\n *\n * 2. Removes with specified selector\n * ```\n * example.org#%#//scriptlet('remove-class', 'branding', 'div[class=\"inner\"]')\n * ```\n *\n * ```html\n * \n *
\n *
Some text
\n *
\n *\n * \n *
\n *
Some text
\n *
\n * ```\n */\n/* eslint-enable max-len */\n\n\nexport function removeClass(source, classNames, selector) {\n if (!classNames) { return; }\n classNames = classNames.split(/\\s*\\|\\s*/);\n let selectors = [];\n if (!selector) {\n selectors = classNames.map((className) => {\n return `.${className}`;\n });\n }\n\n const removeClassHandler = () => {\n const nodes = new Set();\n if (selector) {\n const foundedNodes = [].slice.call(document.querySelectorAll(selector));\n foundedNodes.forEach((n) => nodes.add(n));\n } else if (selectors.length > 0) {\n selectors.forEach((s) => {\n const elements = document.querySelectorAll(s);\n for (let i = 0; i < elements.length; i += 1) {\n const element = elements[i];\n nodes.add(element);\n }\n });\n }\n\n let removed = false;\n\n nodes.forEach((node) => {\n classNames.forEach((className) => {\n if (node.classList.contains(className)) {\n node.classList.remove(className);\n removed = true;\n }\n });\n });\n\n if (removed) {\n hit(source);\n }\n };\n\n removeClassHandler();\n\n const CLASS_ATTR_NAME = ['class'];\n // 'true' for observing attributes\n // 'class' for observing only classes\n observeDOMChanges(removeClassHandler, true, CLASS_ATTR_NAME);\n}\n\nremoveClass.names = [\n 'remove-class',\n];\n\nremoveClass.injections = [hit, observeDOMChanges];\n","import { hit } from '../helpers';\n\n/**\n * @scriptlet disable-newtab-links\n *\n * @description\n * Prevents opening new tabs and windows if there is `target` attribute in element.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#disable-newtab-linksjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"disable-newtab-links\")\n * ```\n */\nexport function disableNewtabLinks(source) {\n document.addEventListener('click', (ev) => {\n let { target } = ev;\n while (target !== null) {\n if (target.localName === 'a' && target.hasAttribute('target')) {\n ev.stopPropagation();\n ev.preventDefault();\n hit(source);\n break;\n }\n target = target.parentNode;\n }\n });\n}\n\ndisableNewtabLinks.names = [\n 'disable-newtab-links',\n 'disable-newtab-links.js',\n 'ubo-disable-newtab-links.js',\n];\n\ndisableNewtabLinks.injections = [\n hit,\n];\n","import { hit, toRegExp } from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet adjust-setInterval\n *\n * @description\n * Adjusts interval for specified setInterval() callbacks.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#nano-setinterval-boosterjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"adjust-setInterval\"[, match [, interval[, boost]]])\n * ```\n *\n * - `match` - optional, string/regular expression, matching in stringified callback function\n * - `interval` - optional, defaults to 1000, decimal integer, matching interval\n * - `boost` - optional, default to 0.05, float, capped at 50 times for up and down, interval multiplier\n *\n * **Examples**\n * 1. Adjust all setInterval() x20 times where interval equal 1000ms:\n * ```\n * example.org#%#//scriptlet(\"adjust-setInterval\")\n * ```\n *\n * 2. Adjust all setInterval() x20 times where callback mathed with `example` and interval equal 1000ms\n * ```\n * example.org#%#//scriptlet(\"adjust-setInterval\", \"example\")\n * ```\n *\n * 3. Adjust all setInterval() x20 times where callback mathed with `example` and interval equal 400ms\n * ```\n * example.org#%#//scriptlet(\"adjust-setInterval\", \"example\", \"400\")\n * ```\n *\n * 4. Slow down setInterval() x2 times where callback matched with `example` and interval equal 400ms\n * ```\n * example.org#%#//scriptlet(\"adjust-setInterval\", \"example\", \"400\", \"2\")\n * ```\n */\n/* eslint-enable max-len */\nexport function adjustSetInterval(source, match, interval, boost) {\n const nativeInterval = window.setInterval;\n const nativeIsNaN = Number.isNaN || window.isNaN; // eslint-disable-line compat/compat\n const nativeIsFinite = Number.isFinite || window.isFinite; // eslint-disable-line compat/compat\n\n interval = parseInt(interval, 10);\n interval = nativeIsNaN(interval) ? 1000 : interval;\n\n boost = parseInt(boost, 10);\n boost = nativeIsNaN(interval) || !nativeIsFinite(boost) ? 0.05 : boost;\n\n match = match ? toRegExp(match) : toRegExp('/.?/');\n\n if (boost < 0.02) {\n boost = 0.02;\n }\n if (boost > 50) {\n boost = 50;\n }\n\n const intervalWrapper = (cb, d, ...args) => {\n if (d === interval && match.test(cb.toString())) {\n d *= boost;\n hit(source);\n }\n return nativeInterval.apply(window, [cb, d, ...args]);\n };\n window.setInterval = intervalWrapper;\n}\n\nadjustSetInterval.names = [\n 'adjust-setInterval',\n 'nano-setInterval-booster.js',\n 'ubo-nano-setInterval-booster.js',\n 'nano-sib.js',\n 'ubo-nano-sib.js',\n];\n\nadjustSetInterval.injections = [toRegExp, hit];\n","import { hit, toRegExp } from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet adjust-setTimeout\n *\n * @description\n * Adjusts timeout for specified setTimout() callbacks.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#nano-settimeout-boosterjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"adjust-setTimeout\"[, match [, timeout[, boost]]])\n * ```\n *\n * - `match` - optional, string/regular expression, matching in stringified callback function\n * - `timeout` - optional, defaults to 1000, decimal integer, matching interval\n * - `boost` - optional, default to 0.05, float, capped at 50 times for up and down, interval multiplier\n *\n * **Examples**\n * 1. Adjust all setTimeout() x20 times where interval equal 1000ms:\n * ```\n * example.org#%#//scriptlet(\"adjust-setTimeout\")\n * ```\n *\n * 2. Adjust all setTimeout() x20 times where callback mathed with `example` and interval equal 1000ms\n * ```\n * example.org#%#//scriptlet(\"adjust-setTimeout\", \"example\")\n * ```\n *\n * 3. Adjust all setTimeout() x20 times where callback mathed with `example` and interval equal 400ms\n * ```\n * example.org#%#//scriptlet(\"adjust-setTimeout\", \"example\", \"400\")\n * ```\n *\n * 4. Slow down setTimeout() x2 times where callback matched with `example` and interval equal 400ms\n * ```\n * example.org#%#//scriptlet(\"adjust-setTimeout\", \"example\", \"400\", \"2\")\n * ```\n */\n/* eslint-enable max-len */\nexport function adjustSetTimeout(source, match, timeout, boost) {\n const nativeTimeout = window.setTimeout;\n const nativeIsNaN = Number.isNaN || window.isNaN; // eslint-disable-line compat/compat\n const nativeIsFinite = Number.isFinite || window.isFinite; // eslint-disable-line compat/compat\n\n timeout = parseInt(timeout, 10);\n timeout = nativeIsNaN(timeout) ? 1000 : timeout;\n\n boost = parseInt(boost, 10);\n boost = nativeIsNaN(timeout) || !nativeIsFinite(boost) ? 0.05 : boost;\n\n match = match ? toRegExp(match) : toRegExp('/.?/');\n\n if (boost < 0.02) {\n boost = 0.02;\n }\n if (boost > 50) {\n boost = 50;\n }\n\n const timeoutWrapper = (cb, d, ...args) => {\n if (d === timeout && match.test(cb.toString())) {\n d *= boost;\n hit(source);\n }\n return nativeTimeout.apply(window, [cb, d, ...args]);\n };\n window.setTimeout = timeoutWrapper;\n}\n\nadjustSetTimeout.names = [\n 'adjust-setTimeout',\n 'nano-setTimeout-booster.js',\n 'ubo-nano-setTimeout-booster.js',\n 'nano-stb.js',\n 'ubo-nano-stb.js',\n];\n\nadjustSetTimeout.injections = [toRegExp, hit];\n","import { hit } from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet dir-string\n *\n * @description\n * Wraps the `console.dir` API to call the `toString` method of the argument.\n * There are several adblock circumvention systems that detect browser devtools\n * and hide themselves. Therefore, if we force them to think\n * that devtools are open (using this scrciptlet),\n * it will automatically disable the adblock circumvention script.\n *\n * Related ABP source:\n * https://github.com/adblockplus/adblockpluscore/blob/6b2a309054cc23432102b85d13f12559639ef495/lib/content/snippets.js#L766\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"dir-string\"[, times])\n * ```\n * - `times` - optional, the number of times to call the `toString` method of the argument to `console.dir`\n *\n * **Example**\n * ```\n * ! Run 2 times\n * example.org#%#//scriptlet(\"dir-string\", \"2\")\n * ```\n */\n/* eslint-enable max-len */\nexport function dirString(source, times) {\n const { dir } = console;\n times = parseInt(times, 10);\n\n function dirWrapper(object) {\n // eslint-disable-next-line no-unused-vars\n let temp;\n for (let i = 0; i < times; i += 1) {\n // eslint-disable-next-line no-unused-expressions\n temp = `${object}`;\n }\n if (typeof dir === 'function') {\n dir.call(this, object);\n }\n hit(source, temp);\n }\n // eslint-disable-next-line no-console\n console.dir = dirWrapper;\n}\n\ndirString.names = [\n 'dir-string',\n 'abp-dir-string',\n];\n\ndirString.injections = [hit];\n","import { hit, getPropertyInChain } from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet json-prune\n *\n * @description\n * Removes specified properties from the result of calling JSON.parse and returns the caller\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"json-prune\"[, propsToRemove [, obligatoryProps]])\n * ```\n *\n * - `propsToRemove` - string of space-separated properties to remove\n * - `obligatoryProps` - optional, string of space-separated properties which must be all present for the pruning to occur\n *\n * **Examples**\n * 1. Removes property `example` from the results of JSON.parse call\n * ```\n * example.org#%#//scriptlet(\"json-prune\", \"example\")\n * ```\n *\n * For instance, the following call will return `{ one: 1}`\n *\n * ```html\n * JSON.parse('{\"one\":1,\"example\":true}')\n * ```\n *\n * 2. If there are no specified properties in the result of JSON.parse call, pruning will NOT occur\n * ```\n * example.org#%#//scriptlet(\"json-prune\", \"one\", \"obligatoryProp\")\n * ```\n *\n * For instance, the following call will return `{ one: 1, two: 2}`\n *\n * ```html\n * JSON.parse('{\"one\":1,\"two\":2}')\n * ```\n *\n * 3. A property in a list of properties can be a chain of properties\n *\n * ```\n * example.org#%#//scriptlet(\"json-prune\", \"a.b\", \"adpath.url.first\")\n * ```\n *\n * 4. Call with no arguments will log the current hostname and json payload at the console\n * ```\n * example.org#%#//scriptlet(\"json-prune\")\n * ```\n */\n/* eslint-enable max-len */\nexport function jsonPrune(source, propsToRemove, requiredInitialProps) {\n // eslint-disable-next-line no-console\n const log = console.log.bind(console);\n const prunePaths = propsToRemove !== undefined && propsToRemove !== ''\n ? propsToRemove.split(/ +/)\n : [];\n const needlePaths = requiredInitialProps !== undefined && requiredInitialProps !== ''\n ? requiredInitialProps.split(/ +/)\n : [];\n\n function isPruningNeeded(root) {\n if (!root) {\n return false;\n }\n\n for (let i = 0; i < needlePaths.length; i += 1) {\n const needlePath = needlePaths[i];\n const details = getPropertyInChain(root, needlePath, false);\n const nestedPropName = needlePath.split('.').pop();\n if (details && details.base[nestedPropName] === undefined) {\n return false;\n }\n }\n return true;\n }\n\n const nativeParse = JSON.parse;\n\n const parseWrapper = (...args) => {\n const r = nativeParse.apply(window, args);\n if (prunePaths.length === 0) {\n log(window.location.hostname, r);\n return r;\n }\n if (isPruningNeeded(r) === false) {\n return r;\n }\n prunePaths.forEach((path) => {\n const ownerObj = getPropertyInChain(r, path, false);\n if (ownerObj !== undefined && ownerObj.base) {\n delete ownerObj.base[ownerObj.prop];\n }\n });\n hit(source);\n return r;\n };\n\n JSON.parse = parseWrapper;\n}\n\n\njsonPrune.names = [\n 'json-prune',\n 'json-prune.js',\n 'ubo-json-prune.js',\n];\n\njsonPrune.injections = [hit, getPropertyInChain];\n","import {\n hit, startsWith, toRegExp, noopFunc,\n} from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet prevent-requestAnimationFrame\n *\n * @description\n * Prevents a `requestAnimationFrame` call\n * if the text of the callback is matching the specified search string which does not start with `!`;\n * otherwise mismatched calls should be defused.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#requestanimationframe-ifjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet('prevent-requestAnimationFrame'[, ])\n * ```\n *\n * **Parameters**\n *\n * - `search` (optional) string or regular expression.\n * If starts with `!`, scriptlet will not match the stringified callback but all other will be defused.\n * If do not start with `!`, the stringified callback will be matched.\n *\n * Call with no argument will log all requestAnimationFrame calls while debugging.\n * So do not use the scriptlet without any parameter in production filter lists.\n *\n * **Examples**\n *\n * 1. Prevents `requestAnimationFrame` calls if the callback matches `/\\.test/`.\n * ```bash\n * example.org#%#//scriptlet('prevent-requestAnimationFrame', '/\\.test/')\n * ```\n *\n * For instance, the following call will be prevented:\n * ```javascript\n * var times = 0;\n * requestAnimationFrame(function change() {\n * window.test = 'new value';\n * if (times < 2) {\n * times += 1;\n * requestAnimationFrame(change);\n * }\n * });\n * ```\n * 2. Prevents `requestAnimationFrame` calls if **does not match** 'check'.\n * ```bash\n * example.org#%#//scriptlet('prevent-requestAnimationFrame', '!check')\n * ```\n *\n * For instance, only the first call will be prevented:\n *\n * ```javascript\n * var timesFirst = 0;\n * requestAnimationFrame(function changeFirst() {\n * window.check = 'should not be prevented';\n * if (timesFirst < 2) {\n * timesFirst += 1;\n * requestAnimationFrame(changeFirst);\n * }\n * });\n *\n * var timesSecond = 0;\n * requestAnimationFrame(function changeSecond() {\n * window.second = 'should be prevented';\n * if (timesSecond < 2) {\n * timesSecond += 1;\n * requestAnimationFrame(changeSecond);\n * }\n * });\n * ```\n */\n/* eslint-enable max-len */\n\nexport function preventRequestAnimationFrame(source, match) {\n const nativeRequestAnimationFrame = window.requestAnimationFrame;\n\n // logs requestAnimationFrame to console if no arguments have been specified\n const shouldLog = typeof match === 'undefined';\n\n const INVERT_MARKER = '!';\n\n const doNotMatch = startsWith(match, INVERT_MARKER);\n if (doNotMatch) {\n match = match.slice(1);\n }\n\n match = match ? toRegExp(match) : toRegExp('/.?/');\n\n const rafWrapper = (callback, ...args) => {\n let shouldPrevent = false;\n if (shouldLog) {\n const logMessage = `log: requestAnimationFrame(\"${callback.toString()}\")`;\n hit(source, logMessage);\n } else {\n shouldPrevent = match.test(callback.toString()) !== doNotMatch;\n }\n\n if (shouldPrevent) {\n hit(source);\n return nativeRequestAnimationFrame(noopFunc);\n }\n\n return nativeRequestAnimationFrame.apply(window, [callback, ...args]);\n };\n\n window.requestAnimationFrame = rafWrapper;\n}\n\npreventRequestAnimationFrame.names = [\n 'prevent-requestAnimationFrame',\n 'requestAnimationFrame-if.js',\n 'ubo-requestAnimationFrame-if.js',\n 'raf-if.js',\n 'ubo-raf-if.js',\n];\n\npreventRequestAnimationFrame.injections = [hit, startsWith, toRegExp, noopFunc];\n","/**\n * This file must export all scriptlets which should be accessible\n */\nexport * from './abort-on-property-read';\nexport * from './abort-on-property-write';\nexport * from './prevent-setTimeout';\nexport * from './prevent-setInterval';\nexport * from './prevent-window-open';\nexport * from './abort-current-inline-script';\nexport * from './set-constant';\nexport * from './remove-cookie';\nexport * from './prevent-addEventListener';\nexport * from './prevent-bab';\nexport * from './nowebrtc';\nexport * from './log-addEventListener';\nexport * from './log-eval';\nexport * from './log';\nexport * from './noeval';\nexport * from './prevent-eval-if';\nexport * from './prevent-fab-3.2.0';\nexport * from './set-popads-dummy';\nexport * from './prevent-popads-net';\nexport * from './prevent-adfly';\nexport * from './debug-on-property-read';\nexport * from './debug-on-property-write';\nexport * from './debug-current-inline-script';\nexport * from './remove-attr';\nexport * from './remove-class';\nexport * from './disable-newtab-links';\nexport * from './adjust-setInterval';\nexport * from './adjust-setTimeout';\nexport * from './dir-string';\nexport * from './json-prune';\nexport * from './prevent-requestAnimationFrame';\n","import {\n startsWith,\n substringAfter,\n} from './string-utils';\n\nimport { ADG_SCRIPTLET_MASK } from './parse-rule';\n\nimport * as scriptletsList from '../scriptlets/scriptletsList';\n\nimport { redirects } from '../../scripts/compatibility-table.json';\n\nconst JS_RULE_MASK = '#%#';\nconst COMMENT_MARKER = '!';\n\n/**\n * Checks if rule text is comment e.g. !!example.org##+js(set-constant.js, test, false)\n * @param {string} rule\n * @return {boolean}\n */\nconst isComment = (rule) => startsWith(rule, COMMENT_MARKER);\n\n\n/* ************************************************************************\n *\n * Scriptlets\n *\n ************************************************************************** */\n\n\n/**\n * uBlock scriptlet rule mask\n */\nconst UBO_SCRIPTLET_MASK_REG = /#@?#script:inject|#@?#\\s*\\+js/;\nconst UBO_SCRIPTLET_MASK_1 = '##+js';\nconst UBO_SCRIPTLET_MASK_2 = '##script:inject';\nconst UBO_SCRIPTLET_EXCEPTION_MASK_1 = '#@#+js';\nconst UBO_SCRIPTLET_EXCEPTION_MASK_2 = '#@#script:inject';\n\n/**\n * AdBlock Plus snippet rule mask\n */\nconst ABP_SCRIPTLET_MASK = '#$#';\nconst ABP_SCRIPTLET_EXCEPTION_MASK = '#@$#';\n\n/**\n * AdGuard CSS rule mask\n */\nconst ADG_CSS_MASK_REG = /#@?\\$#.+?\\s*\\{.*\\}\\s*$/g;\n\n\n/**\n * Checks if the `rule` is AdGuard scriptlet rule\n * @param {string} rule - rule text\n */\nconst isAdgScriptletRule = (rule) => {\n return (\n !isComment(rule)\n && rule.indexOf(ADG_SCRIPTLET_MASK) > -1\n );\n};\n\n/**\n * Checks if the `rule` is uBO scriptlet rule\n * @param {string} rule rule text\n */\nconst isUboScriptletRule = (rule) => {\n return (\n rule.indexOf(UBO_SCRIPTLET_MASK_1) > -1\n || rule.indexOf(UBO_SCRIPTLET_MASK_2) > -1\n || rule.indexOf(UBO_SCRIPTLET_EXCEPTION_MASK_1) > -1\n || rule.indexOf(UBO_SCRIPTLET_EXCEPTION_MASK_2) > -1\n )\n && UBO_SCRIPTLET_MASK_REG.test(rule)\n && !isComment(rule);\n};\n\n/**\n * Checks if the `rule` is AdBlock Plus snippet\n * @param {string} rule rule text\n */\nconst isAbpSnippetRule = (rule) => {\n return (\n rule.indexOf(ABP_SCRIPTLET_MASK) > -1\n || rule.indexOf(ABP_SCRIPTLET_EXCEPTION_MASK) > -1\n )\n && rule.search(ADG_CSS_MASK_REG) === -1\n && !isComment(rule);\n};\n\n/**\n * Finds scriptlet by it's name\n * @param {string} name - scriptlet name\n */\nconst getScriptletByName = (name) => {\n const scriptlets = Object.keys(scriptletsList).map((key) => scriptletsList[key]);\n return scriptlets\n .find((s) => s.names && s.names.indexOf(name) > -1);\n};\n\n/**\n * Checks if the scriptlet name is valid\n * @param {string} name - Scriptlet name\n */\nconst isValidScriptletName = (name) => {\n if (!name) {\n return false;\n }\n const scriptlet = getScriptletByName(name);\n if (!scriptlet) {\n return false;\n }\n return true;\n};\n\n/* ************************************************************************\n *\n * Redirects\n *\n ************************************************************************** */\n\n/**\n * Redirect resources markers\n */\nconst ADG_UBO_REDIRECT_MARKER = 'redirect=';\nconst ABP_REDIRECT_MARKER = 'rewrite=abp-resource:';\n\nconst VALID_SOURCE_TYPES = [\n 'image',\n 'subdocument',\n 'stylesheet',\n 'script',\n 'xmlhttprequest',\n 'media',\n];\n\nconst validAdgRedirects = redirects.filter((el) => el.adg);\n\n/**\n * Converts array of pairs to object.\n * Sort of Object.fromEntries() polyfill.\n * @param {Array} pairs - array of pairs\n * @returns {Object}\n */\nconst objFromEntries = (pairs) => {\n const output = pairs\n .reduce((acc, el) => {\n const [key, value] = el;\n acc[key] = value;\n return acc;\n }, {});\n return output;\n};\n\n/**\n * Compatibility object where KEYS = UBO redirect names and VALUES = ADG redirect names\n * It's used for UBO -> ADG converting\n */\nconst uboToAdgCompatibility = objFromEntries(\n validAdgRedirects\n .filter((el) => el.ubo)\n .map((el) => {\n return [el.ubo, el.adg];\n }),\n);\n\n/**\n * Compatibility object where KEYS = ABP redirect names and VALUES = ADG redirect names\n * It's used for ABP -> ADG converting\n */\nconst abpToAdgCompatibility = objFromEntries(\n validAdgRedirects\n .filter((el) => el.abp)\n .map((el) => {\n return [el.abp, el.adg];\n }),\n);\n\n/**\n * Compatibility object where KEYS = UBO redirect names and VALUES = ADG redirect names\n * It's used for ADG -> UBO converting\n */\nconst adgToUboCompatibility = objFromEntries(\n validAdgRedirects\n .filter((el) => el.ubo)\n .map((el) => {\n return [el.adg, el.ubo];\n }),\n);\n\n/**\n * Needed for AdGuard redirect names validation where KEYS = **valid** AdGuard redirect names\n * 'adgToUboCompatibility' is still needed for ADG -> UBO converting\n */\nconst validAdgCompatibility = objFromEntries(\n validAdgRedirects\n .map((el) => {\n return [el.adg, 'valid adg redirect'];\n }),\n);\n\nconst REDIRECT_RULE_TYPES = {\n VALID_ADG: {\n marker: ADG_UBO_REDIRECT_MARKER,\n compatibility: validAdgCompatibility,\n },\n ADG: {\n marker: ADG_UBO_REDIRECT_MARKER,\n compatibility: adgToUboCompatibility,\n },\n UBO: {\n marker: ADG_UBO_REDIRECT_MARKER,\n compatibility: uboToAdgCompatibility,\n },\n ABP: {\n marker: ABP_REDIRECT_MARKER,\n compatibility: abpToAdgCompatibility,\n },\n};\n\n/**\n * Parses redirect rule modifiers\n * @param {string} rule\n * @returns {Array}\n */\nconst parseModifiers = (rule) => substringAfter(rule, '$').split(',');\n\n/**\n * Gets redirect resource name\n * @param {string} rule\n * @param {string} marker - specific Adg/Ubo or Abp redirect resources marker\n * @returns {string} - redirect resource name\n */\nconst getRedirectName = (rule, marker) => {\n const ruleModifiers = parseModifiers(rule);\n const redirectNamePart = ruleModifiers\n .find((el) => el.indexOf(marker) > -1);\n return substringAfter(redirectNamePart, marker);\n};\n\n\n/**\n * Checks if the `rule` is AdGuard redirect rule.\n * Discards comments and JS rules and checks if the `rule` has 'redirect' modifier.\n * @param {string} rule - rule text\n */\nconst isAdgRedirectRule = (rule) => {\n return (\n !isComment(rule)\n // some js rules may have 'redirect=' in it, so we should get rid of them\n && !rule.indexOf(JS_RULE_MASK) > -1\n && rule.indexOf(REDIRECT_RULE_TYPES.ADG.marker) > -1\n );\n};\n\n/**\n * Checks if the `rule` satisfies the `type`\n * @param {string} rule - rule text\n * @param {'VALID_ADG'|'ADG'|'UBO'|'ABP'} type - type of a redirect rule\n */\nconst isRedirectRuleByType = (rule, type) => {\n const { marker, compatibility } = REDIRECT_RULE_TYPES[type];\n\n if (rule\n && (!isComment(rule))\n && (rule.indexOf(marker) > -1)) {\n const redirectName = getRedirectName(rule, marker);\n\n return redirectName === Object\n .keys(compatibility)\n .find((el) => el === redirectName);\n }\n return false;\n};\n\n/**\n* Checks if the `rule` is **valid** AdGuard redirect resource rule\n* @param {string} rule - rule text\n* @returns {boolean}\n*/\nconst isValidAdgRedirectRule = (rule) => {\n return isRedirectRuleByType(rule, 'VALID_ADG');\n};\n\n\n/**\n* Checks if the AdGuard redirect `rule` has Ubo analog. Needed for Adg->Ubo conversion\n* @param {string} rule - AdGuard rule text\n* @returns {boolean} - true if the rule can be converted to Ubo\n*/\nconst isAdgRedirectCompatibleWithUbo = (rule) => {\n return isRedirectRuleByType(rule, 'ADG');\n};\n\n/**\n* Checks if the Ubo redirect `rule` has AdGuard analog. Needed for Ubo->Adg conversion\n* @param {string} rule - Ubo rule text\n* @returns {boolean} - true if the rule can be converted to AdGuard\n*/\nconst isUboRedirectCompatibleWithAdg = (rule) => {\n return isRedirectRuleByType(rule, 'UBO');\n};\n\n/**\n* Checks if the Abp redirect `rule` has AdGuard analog. Needed for Abp->Adg conversion\n* @param {string} rule - Abp rule text\n* @returns {boolean} - true if the rule can be converted to AdGuard\n*/\nconst isAbpRedirectCompatibleWithAdg = (rule) => {\n return isRedirectRuleByType(rule, 'ABP');\n};\n\n\n/**\n * Checks if the rule has specified content type before Adg -> Ubo conversion.\n *\n * Used ONLY for Adg -> Ubo conversion\n * because Ubo redirect rules must contain content type, but Adg and Abp must not.\n *\n * Also source type can not be added automatically because of such valid rules:\n * ! Abp:\n * $rewrite=abp-resource:blank-js,xmlhttprequest\n * ! Adg:\n * $script,redirect=noopvast-2.0\n * $xmlhttprequest,redirect=noopvast-2.0\n *\n * @param {string} rule\n * @returns {boolean}\n */\nconst hasValidContentType = (rule) => {\n if (isRedirectRuleByType(rule, 'ADG')) {\n const ruleModifiers = parseModifiers(rule);\n const sourceType = ruleModifiers\n .find((el) => VALID_SOURCE_TYPES.indexOf(el) > -1);\n\n return sourceType !== undefined;\n }\n return false;\n};\n\nconst validator = {\n UBO_SCRIPTLET_MASK_REG,\n ABP_SCRIPTLET_MASK,\n ABP_SCRIPTLET_EXCEPTION_MASK,\n isComment,\n isAdgScriptletRule,\n isUboScriptletRule,\n isAbpSnippetRule,\n getScriptletByName,\n isValidScriptletName,\n REDIRECT_RULE_TYPES,\n isAdgRedirectRule,\n isValidAdgRedirectRule,\n isAdgRedirectCompatibleWithUbo,\n isUboRedirectCompatibleWithAdg,\n isAbpRedirectCompatibleWithAdg,\n parseModifiers,\n getRedirectName,\n hasValidContentType,\n};\n\nexport default validator;\n","function _iterableToArray(iter) {\n if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter);\n}\n\nmodule.exports = _iterableToArray;","var arrayWithHoles = require(\"./arrayWithHoles\");\n\nvar iterableToArray = require(\"./iterableToArray\");\n\nvar nonIterableRest = require(\"./nonIterableRest\");\n\nfunction _toArray(arr) {\n return arrayWithHoles(arr) || iterableToArray(arr) || nonIterableRest();\n}\n\nmodule.exports = _toArray;","import {\n getBeforeRegExp,\n substringAfter,\n substringBefore,\n wrapInSingleQuotes,\n getStringInBraces,\n} from './string-utils';\n\nimport validator from './validator';\n\nimport { parseRule } from './parse-rule';\n\nimport * as scriptletList from '../scriptlets/scriptletsList';\n\n/**\n * AdGuard scriptlet rule\n */\nconst ADGUARD_SCRIPTLET_MASK_REG = /#@?%#\\/\\/scriptlet\\(.+\\)/;\n// eslint-disable-next-line no-template-curly-in-string\nconst ADGUARD_SCRIPTLET_TEMPLATE = '${domains}#%#//scriptlet(${args})';\n// eslint-disable-next-line no-template-curly-in-string\nconst ADGUARD_SCRIPTLET_EXCEPTION_TEMPLATE = '${domains}#@%#//scriptlet(${args})';\n\n/**\n * uBlock scriptlet rule mask\n */\n// eslint-disable-next-line no-template-curly-in-string\nconst UBO_SCRIPTLET_TEMPLATE = '${domains}##+js(${args})';\n// eslint-disable-next-line no-template-curly-in-string\nconst UBO_SCRIPTLET_EXCEPTION_TEMPLATE = '${domains}#@#+js(${args})';\n\nconst UBO_ALIAS_NAME_MARKER = 'ubo-';\n\n// https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#xhr\nconst UBO_XHR_TYPE = 'xhr';\n\nconst ADG_XHR_TYPE = 'xmlhttprequest';\n\n\n/**\n * Returns array of strings separated by space which not in quotes\n * @param {string} str\n */\nconst getSentences = (str) => {\n const reg = /'.*?'|\".*?\"|\\S+/g;\n return str.match(reg);\n};\n\n/**\n * Replaces string with data by placeholders\n * @param {string} str\n * @param {Object} data - where keys are placeholders names\n */\nconst replacePlaceholders = (str, data) => {\n return Object.keys(data).reduce((acc, key) => {\n const reg = new RegExp(`\\\\$\\\\{${key}\\\\}`, 'g');\n acc = acc.replace(reg, data[key]);\n return acc;\n }, str);\n};\n\n/**\n * Converts string of UBO scriptlet rule to AdGuard scritlet rule\n * @param {string} rule - UBO scriptlet rule\n * @returns {Array} - array with one AdGuard scriptlet rule\n */\nexport const convertUboScriptletToAdg = (rule) => {\n const domains = getBeforeRegExp(rule, validator.UBO_SCRIPTLET_MASK_REG);\n const mask = rule.match(validator.UBO_SCRIPTLET_MASK_REG)[0];\n let template;\n if (mask.indexOf('@') > -1) {\n template = ADGUARD_SCRIPTLET_EXCEPTION_TEMPLATE;\n } else {\n template = ADGUARD_SCRIPTLET_TEMPLATE;\n }\n const args = getStringInBraces(rule)\n .split(/, /g)\n .map((arg, index) => {\n let outputArg;\n if (index === 0) {\n outputArg = (arg.indexOf('.js') > -1) ? `ubo-${arg}` : `ubo-${arg}.js`;\n } else {\n outputArg = arg;\n }\n // for example: dramaserial.xyz##+js(abort-current-inline-script, $, popup)\n if (arg === '$') {\n outputArg = '$$';\n }\n return outputArg;\n })\n .map((arg) => wrapInSingleQuotes(arg))\n .join(', ');\n const adgRule = replacePlaceholders(\n template,\n { domains, args },\n );\n return [adgRule];\n};\n\n/**\n * Convert string of ABP snippet rule to AdGuard scritlet rule\n * @param {string} rule - ABP snippet rule\n * @returns {Array} - array of AdGuard scriptlet rules -\n * one or few items depends on Abp-rule\n */\nexport const convertAbpSnippetToAdg = (rule) => {\n const SEMICOLON_DIVIDER = /;(?=(?:(?:[^\"]*\"){2})*[^\"]*$)/g;\n const mask = rule.indexOf(validator.ABP_SCRIPTLET_MASK) > -1\n ? validator.ABP_SCRIPTLET_MASK\n : validator.ABP_SCRIPTLET_EXCEPTION_MASK;\n const template = mask === validator.ABP_SCRIPTLET_MASK\n ? ADGUARD_SCRIPTLET_TEMPLATE\n : ADGUARD_SCRIPTLET_EXCEPTION_TEMPLATE;\n const domains = substringBefore(rule, mask);\n const args = substringAfter(rule, mask);\n\n return args.split(SEMICOLON_DIVIDER)\n .map((args) => getSentences(args)\n .filter((arg) => arg)\n .map((arg, index) => (index === 0 ? `abp-${arg}` : arg))\n .map((arg) => wrapInSingleQuotes(arg))\n .join(', '))\n .map((args) => replacePlaceholders(template, { domains, args }));\n};\n\n/**\n * Converts scriptlet rule to AdGuard one\n * @param {string} rule\n * @returns {Array} - array of AdGuard scriptlet rules -\n * one item for Adg and Ubo or few items for Abp\n */\nexport const convertScriptletToAdg = (rule) => {\n let result;\n if (validator.isUboScriptletRule(rule)) {\n result = convertUboScriptletToAdg(rule);\n } else if (validator.isAbpSnippetRule(rule)) {\n result = convertAbpSnippetToAdg(rule);\n } else if (validator.isAdgScriptletRule(rule) || (validator.isComment(rule))) {\n result = [rule];\n }\n\n return result;\n};\n\n/**\n * Converts UBO scriptlet rule to AdGuard one\n * @param {string} rule - AdGuard scriptlet rule\n * @returns {string} - UBO scriptlet rule\n */\nexport const convertAdgScriptletToUbo = (rule) => {\n let res;\n\n if (validator.isAdgScriptletRule(rule)) {\n const { name: parsedName, args: parsedParams } = parseRule(rule);\n\n // object of name and aliases for the Adg-scriptlet\n const adgScriptletObject = Object\n .keys(scriptletList)\n .map((el) => scriptletList[el])\n .map((s) => {\n const [name, ...aliases] = s.names;\n return { name, aliases };\n })\n .find((el) => (el.name === parsedName\n || el.aliases.indexOf(parsedName) >= 0));\n\n const { aliases } = adgScriptletObject;\n\n if (aliases.length > 0) {\n const uboAlias = adgScriptletObject.aliases\n // eslint-disable-next-line no-restricted-properties\n .find((alias) => alias.includes(UBO_ALIAS_NAME_MARKER));\n\n if (uboAlias) {\n const mask = rule.match(ADGUARD_SCRIPTLET_MASK_REG)[0];\n let template;\n if (mask.indexOf('@') > -1) {\n template = UBO_SCRIPTLET_EXCEPTION_TEMPLATE;\n } else {\n template = UBO_SCRIPTLET_TEMPLATE;\n }\n const domains = getBeforeRegExp(rule, ADGUARD_SCRIPTLET_MASK_REG);\n const uboName = uboAlias\n .replace(UBO_ALIAS_NAME_MARKER, '')\n // '.js' in the Ubo scriptlet name can be omitted\n // https://github.com/gorhill/uBlock/wiki/Resources-Library#general-purpose-scriptlets\n .replace('.js', '');\n\n const args = (parsedParams.length > 0) ? `${uboName}, ${parsedParams.join(', ')}` : uboName;\n\n const uboRule = replacePlaceholders(\n template,\n { domains, args },\n );\n\n res = uboRule;\n }\n }\n }\n\n return res;\n};\n\n/**\n * Validates any scriptlet rule\n * @param {string} input - can be Adguard or Ubo or Abp scriptlet rule\n */\nexport const isValidScriptletRule = (input) => {\n if (!input) {\n return false;\n }\n // ABP 'input' rule may contain more than one snippet\n const rulesArray = convertScriptletToAdg(input);\n\n // checking if each of parsed scriptlets is valid\n // if at least one of them is not valid - whole 'input' rule is not valid too\n const isValid = rulesArray.reduce((acc, rule) => {\n const parsedRule = parseRule(rule);\n return validator.isValidScriptletName(parsedRule.name) && acc;\n }, true);\n\n return isValid;\n};\n\n\n/**\n * Converts Ubo redirect rule to Adg one\n * @param {string} rule\n * @returns {string}\n */\nexport const convertUboRedirectToAdg = (rule) => {\n const firstPartOfRule = substringBefore(rule, '$');\n const uboModifiers = validator.parseModifiers(rule);\n const adgModifiers = uboModifiers\n .map((el) => {\n if (el.indexOf(validator.REDIRECT_RULE_TYPES.UBO.marker) > -1) {\n const uboName = substringAfter(el, validator.REDIRECT_RULE_TYPES.UBO.marker);\n const adgName = validator.REDIRECT_RULE_TYPES.UBO.compatibility[uboName];\n return `${validator.REDIRECT_RULE_TYPES.ADG.marker}${adgName}`;\n }\n if (el === UBO_XHR_TYPE) {\n return ADG_XHR_TYPE;\n }\n return el;\n })\n .join(',');\n\n return `${firstPartOfRule}$${adgModifiers}`;\n};\n\n/**\n * Converts Abp redirect rule to Adg one\n * @param {string} rule\n * @returns {string}\n */\nexport const convertAbpRedirectToAdg = (rule) => {\n const firstPartOfRule = substringBefore(rule, '$');\n const abpModifiers = validator.parseModifiers(rule);\n const adgModifiers = abpModifiers\n .map((el) => {\n if (el.indexOf(validator.REDIRECT_RULE_TYPES.ABP.marker) > -1) {\n const abpName = substringAfter(el, validator.REDIRECT_RULE_TYPES.ABP.marker);\n const adgName = validator.REDIRECT_RULE_TYPES.ABP.compatibility[abpName];\n return `${validator.REDIRECT_RULE_TYPES.ADG.marker}${adgName}`;\n }\n return el;\n })\n .join(',');\n\n return `${firstPartOfRule}$${adgModifiers}`;\n};\n\n/**\n * Converts redirect rule to AdGuard one\n * @param {string} rule\n * @returns {string}\n */\nexport const convertRedirectToAdg = (rule) => {\n let result;\n if (validator.isUboRedirectCompatibleWithAdg(rule)) {\n result = convertUboRedirectToAdg(rule);\n } else if (validator.isAbpRedirectCompatibleWithAdg(rule)) {\n result = convertAbpRedirectToAdg(rule);\n } else if (validator.isValidAdgRedirectRule(rule)) {\n result = rule;\n }\n\n return result;\n};\n\n/**\n * Converts Adg redirect rule to Ubo one\n * @param {string} rule\n * @returns {string}\n */\nexport const convertAdgRedirectToUbo = (rule) => {\n if (!validator.hasValidContentType(rule)) {\n throw new Error(`Rule is not valid for converting to Ubo. Source type is not specified in the rule: ${rule}`);\n } else {\n const firstPartOfRule = substringBefore(rule, '$');\n const uboModifiers = validator.parseModifiers(rule);\n const adgModifiers = uboModifiers\n .map((el) => {\n if (el.indexOf(validator.REDIRECT_RULE_TYPES.ADG.marker) > -1) {\n const adgName = substringAfter(el, validator.REDIRECT_RULE_TYPES.ADG.marker);\n const uboName = validator.REDIRECT_RULE_TYPES.ADG.compatibility[adgName];\n return `${validator.REDIRECT_RULE_TYPES.UBO.marker}${uboName}`;\n }\n return el;\n })\n .join(',');\n\n return `${firstPartOfRule}$${adgModifiers}`;\n }\n};\n","import {\n hit, noopFunc, noopNull, noopArray,\n} from '../helpers';\n\n/**\n * @redirect google-analytics\n *\n * @description\n * Mocks Google Analytics API.\n *\n * Related UBO redirect resource:\n * https://github.com/gorhill/uBlock/blob/a94df7f3b27080ae2dcb3b914ace39c0c294d2f6/src/web_accessible_resources/google-analytics_analytics.js\n *\n * **Example**\n * ```\n * ||google-analytics.com/analytics.js$script,redirect=google-analytics\n * ```\n */\nexport function GoogleAnalytics(source) {\n // eslint-disable-next-line func-names\n const Tracker = function () { }; // constructor\n const proto = Tracker.prototype;\n proto.get = noopFunc;\n proto.set = noopFunc;\n proto.send = noopFunc;\n\n const googleAnalyticsName = window.GoogleAnalyticsObject || 'ga';\n function ga() {\n const len = arguments.length;\n if (len === 0) {\n return;\n }\n // eslint-disable-next-line prefer-rest-params\n const lastArg = arguments[len - 1];\n if (typeof lastArg !== 'object'\n || lastArg === null\n || typeof lastArg.hitCallback !== 'function'\n ) {\n return;\n }\n\n try {\n lastArg.hitCallback();\n // eslint-disable-next-line no-empty\n } catch (ex) { }\n }\n\n ga.create = () => new Tracker();\n ga.getByName = noopNull;\n ga.getAll = noopArray;\n ga.remove = noopFunc;\n ga.loaded = true;\n window[googleAnalyticsName] = ga;\n\n const { dataLayer } = window;\n if (dataLayer instanceof Object\n && dataLayer.hide instanceof Object\n && typeof dataLayer.hide.end === 'function'\n ) {\n dataLayer.hide.end();\n }\n\n hit(source);\n}\n\nGoogleAnalytics.names = [\n 'google-analytics',\n 'ubo-google-analytics_analytics.js',\n 'google-analytics_analytics.js',\n];\n\nGoogleAnalytics.injections = [\n hit,\n noopFunc,\n noopNull,\n noopArray,\n];\n","/* eslint-disable no-underscore-dangle */\nimport { hit, noopFunc } from '../helpers';\n\n/**\n * @redirect google-analytics-ga\n *\n * @description\n * Mocks old Google Analytics API.\n *\n * Related UBO redirect resource:\n * https://github.com/gorhill/uBlock/blob/a94df7f3b27080ae2dcb3b914ace39c0c294d2f6/src/web_accessible_resources/google-analytics_ga.js\n *\n * **Example**\n * ```\n * ||google-analytics.com/ga.js$script,redirect=google-analytics-ga\n * ```\n */\nexport function GoogleAnalyticsGa(source) {\n // Gaq constructor\n function Gaq() { }\n\n Gaq.prototype.Na = noopFunc;\n Gaq.prototype.O = noopFunc;\n Gaq.prototype.Sa = noopFunc;\n Gaq.prototype.Ta = noopFunc;\n Gaq.prototype.Va = noopFunc;\n Gaq.prototype._createAsyncTracker = noopFunc;\n Gaq.prototype._getAsyncTracker = noopFunc;\n Gaq.prototype._getPlugin = noopFunc;\n Gaq.prototype.push = (data) => {\n if (typeof data === 'function') {\n data();\n return;\n }\n if (Array.isArray(data) === false) {\n return;\n }\n // https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiDomainDirectory#_gat.GA_Tracker_._link\n if (data[0] === '_link' && typeof data[1] === 'string') {\n window.location.assign(data[1]);\n }\n // https://github.com/gorhill/uBlock/issues/2162\n if (data[0] === '_set' && data[1] === 'hitCallback' && typeof data[2] === 'function') {\n data[2]();\n }\n };\n\n const gaq = new Gaq();\n const asyncTrackers = window._gaq || [];\n if (Array.isArray(asyncTrackers)) {\n while (asyncTrackers[0]) {\n gaq.push(asyncTrackers.shift());\n }\n }\n // eslint-disable-next-line no-multi-assign\n window._gaq = gaq.qf = gaq;\n\n\n // Gat constructor\n function Gat() { }\n\n // Mock tracker api\n const api = [\n '_addIgnoredOrganic', '_addIgnoredRef', '_addItem', '_addOrganic',\n '_addTrans', '_clearIgnoredOrganic', '_clearIgnoredRef', '_clearOrganic',\n '_cookiePathCopy', '_deleteCustomVar', '_getName', '_setAccount',\n '_getAccount', '_getClientInfo', '_getDetectFlash', '_getDetectTitle',\n '_getLinkerUrl', '_getLocalGifPath', '_getServiceMode', '_getVersion',\n '_getVisitorCustomVar', '_initData', '_link', '_linkByPost',\n '_setAllowAnchor', '_setAllowHash', '_setAllowLinker', '_setCampContentKey',\n '_setCampMediumKey', '_setCampNameKey', '_setCampNOKey', '_setCampSourceKey',\n '_setCampTermKey', '_setCampaignCookieTimeout', '_setCampaignTrack', '_setClientInfo',\n '_setCookiePath', '_setCookiePersistence', '_setCookieTimeout', '_setCustomVar',\n '_setDetectFlash', '_setDetectTitle', '_setDomainName', '_setLocalGifPath',\n '_setLocalRemoteServerMode', '_setLocalServerMode', '_setReferrerOverride', '_setRemoteServerMode',\n '_setSampleRate', '_setSessionTimeout', '_setSiteSpeedSampleRate', '_setSessionCookieTimeout',\n '_setVar', '_setVisitorCookieTimeout', '_trackEvent', '_trackPageLoadTime',\n '_trackPageview', '_trackSocial', '_trackTiming', '_trackTrans',\n '_visitCode',\n ];\n const tracker = api.reduce((res, funcName) => {\n res[funcName] = noopFunc;\n return res;\n }, {});\n tracker._getLinkerUrl = (a) => a;\n\n Gat.prototype._anonymizeIP = noopFunc;\n Gat.prototype._createTracker = noopFunc;\n Gat.prototype._forceSSL = noopFunc;\n Gat.prototype._getPlugin = noopFunc;\n Gat.prototype._getTracker = () => tracker;\n Gat.prototype._getTrackerByName = () => tracker;\n Gat.prototype._getTrackers = noopFunc;\n Gat.prototype.aa = noopFunc;\n Gat.prototype.ab = noopFunc;\n Gat.prototype.hb = noopFunc;\n Gat.prototype.la = noopFunc;\n Gat.prototype.oa = noopFunc;\n Gat.prototype.pa = noopFunc;\n Gat.prototype.u = noopFunc;\n\n const gat = new Gat();\n window._gat = gat;\n\n hit(source);\n}\n\nGoogleAnalyticsGa.names = [\n 'google-analytics-ga',\n 'ubo-google-analytics_ga.js',\n 'google-analytics_ga.js',\n];\n\nGoogleAnalyticsGa.injections = [hit, noopFunc];\n","import { hit } from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @redirect googlesyndication-adsbygoogle\n *\n * @description\n * Mocks Google AdSense API.\n *\n * Related UBO redirect resource:\n * https://github.com/gorhill/uBlock/blob/a94df7f3b27080ae2dcb3b914ace39c0c294d2f6/src/web_accessible_resources/googlesyndication_adsbygoogle.js\n *\n * **Example**\n * ```\n * ||pagead2.googlesyndication.com/pagead/js/adsbygoogle.js$script,redirect=googlesyndication-adsbygoogle\n * ```\n */\n/* eslint-enable max-len */\nexport function GoogleSyndicationAdsByGoogle(source) {\n window.adsbygoogle = window.adsbygoogle || {\n length: 0,\n loaded: true,\n push() {\n this.length += 1;\n },\n };\n const adElems = document.querySelectorAll('.adsbygoogle');\n const css = 'height:1px!important;max-height:1px!important;max-width:1px!important;width:1px!important;';\n let executed = false;\n for (let i = 0; i < adElems.length; i += 1) {\n adElems[i].setAttribute('data-adsbygoogle-status', 'done');\n\n const aswiftIframe = document.createElement('iframe');\n aswiftIframe.id = `aswift_${i + 1}`;\n aswiftIframe.style = css;\n adElems[i].appendChild(aswiftIframe);\n\n const googleadsIframe = document.createElement('iframe');\n googleadsIframe.id = `google_ads_iframe_${i}`;\n googleadsIframe.style = css;\n adElems[i].appendChild(googleadsIframe);\n\n executed = true;\n }\n\n if (executed) {\n hit(source);\n }\n}\n\nGoogleSyndicationAdsByGoogle.names = [\n 'googlesyndication-adsbygoogle',\n 'ubo-googlesyndication_adsbygoogle.js',\n 'googlesyndication_adsbygoogle.js',\n];\n\nGoogleSyndicationAdsByGoogle.injections = [\n hit,\n];\n","import { hit, noopFunc } from '../helpers';\n\n/**\n * @redirect googletagmanager-gtm\n *\n * @description\n * Mocks Google Tag Manager API.\n *\n * Related UBO redirect resource:\n * https://github.com/gorhill/uBlock/blob/a94df7f3b27080ae2dcb3b914ace39c0c294d2f6/src/web_accessible_resources/googletagmanager_gtm.js\n *\n * **Example**\n * ```\n * ||googletagmanager.com/gtm.js$script,redirect=googletagmanager-gtm\n * ```\n */\nexport function GoogleTagManagerGtm(source) {\n window.ga = window.ga || noopFunc;\n const { dataLayer } = window;\n if (dataLayer instanceof Object === false) {\n return;\n }\n\n if (dataLayer.hide instanceof Object && typeof dataLayer.hide.end === 'function') {\n dataLayer.hide.end();\n }\n\n if (typeof dataLayer.push === 'function') {\n dataLayer.push = (data) => {\n if (data instanceof Object && typeof data.eventCallback === 'function') {\n setTimeout(data.eventCallback, 1);\n }\n };\n }\n\n hit(source);\n}\n\nGoogleTagManagerGtm.names = [\n 'googletagmanager-gtm',\n 'ubo-googletagmanager_gtm.js',\n 'googletagmanager_gtm.js',\n];\n\nGoogleTagManagerGtm.injections = [hit, noopFunc];\n","import {\n hit, noopFunc, noopThis, noopNull, noopArray, noopStr,\n} from '../helpers';\n\n/**\n * @redirect googletagservices-gpt\n *\n * @description\n * Mocks Google Publisher Tag API.\n *\n * Related UBO redirect resource:\n * https://github.com/gorhill/uBlock/blob/a94df7f3b27080ae2dcb3b914ace39c0c294d2f6/src/web_accessible_resources/googletagservices_gpt.js\n *\n * **Example**\n * ```\n * ||googletagservices.com/tag/js/gpt.js$script,redirect=googletagservices-gpt\n * ```\n */\nexport function GoogleTagServicesGpt(source) {\n const companionAdsService = {\n addEventListener: noopThis,\n enableSyncLoading: noopFunc,\n setRefreshUnfilledSlots: noopFunc,\n };\n const contentService = {\n addEventListener: noopThis,\n setContent: noopFunc,\n };\n function PassbackSlot() { } // constructor\n\n PassbackSlot.prototype.display = noopFunc;\n PassbackSlot.prototype.get = noopNull;\n PassbackSlot.prototype.set = noopThis;\n PassbackSlot.prototype.setClickUrl = noopThis;\n PassbackSlot.prototype.setTagForChildDirectedTreatment = noopThis;\n PassbackSlot.prototype.setTargeting = noopThis;\n PassbackSlot.prototype.updateTargetingFromMap = noopThis;\n\n function SizeMappingBuilder() { } // constructor\n SizeMappingBuilder.prototype.addSize = noopThis;\n SizeMappingBuilder.prototype.build = noopNull;\n\n function Slot() { } // constructor\n Slot.prototype.addService = noopThis;\n Slot.prototype.clearCategoryExclusions = noopThis;\n Slot.prototype.clearTargeting = noopThis;\n Slot.prototype.defineSizeMapping = noopThis;\n Slot.prototype.get = noopNull;\n Slot.prototype.getAdUnitPath = noopArray;\n Slot.prototype.getAttributeKeys = noopArray;\n Slot.prototype.getCategoryExclusions = noopArray;\n Slot.prototype.getDomId = noopStr;\n Slot.prototype.getSlotElementId = noopStr;\n Slot.prototype.getSlotId = noopThis;\n Slot.prototype.getTargeting = noopArray;\n Slot.prototype.getTargetingKeys = noopArray;\n Slot.prototype.set = noopThis;\n Slot.prototype.setCategoryExclusion = noopThis;\n Slot.prototype.setClickUrl = noopThis;\n Slot.prototype.setCollapseEmptyDiv = noopThis;\n Slot.prototype.setTargeting = noopThis;\n\n const pubAdsService = {\n addEventListener: noopThis,\n clear: noopFunc,\n clearCategoryExclusions: noopThis,\n clearTagForChildDirectedTreatment: noopThis,\n clearTargeting: noopThis,\n collapseEmptyDivs: noopFunc,\n defineOutOfPagePassback() { return new PassbackSlot(); },\n definePassback() { return new PassbackSlot(); },\n disableInitialLoad: noopFunc,\n display: noopFunc,\n enableAsyncRendering: noopFunc,\n enableSingleRequest: noopFunc,\n enableSyncRendering: noopFunc,\n enableVideoAds: noopFunc,\n get: noopNull,\n getAttributeKeys: noopArray,\n getTargeting: noopFunc,\n getTargetingKeys: noopArray,\n getSlots: noopArray,\n refresh: noopFunc,\n set: noopThis,\n setCategoryExclusion: noopThis,\n setCentering: noopFunc,\n setCookieOptions: noopThis,\n setForceSafeFrame: noopThis,\n setLocation: noopThis,\n setPublisherProvidedId: noopThis,\n setRequestNonPersonalizedAds: noopThis,\n setSafeFrameConfig: noopThis,\n setTagForChildDirectedTreatment: noopThis,\n setTargeting: noopThis,\n setVideoContent: noopThis,\n updateCorrelator: noopFunc,\n };\n\n\n const { googletag = {} } = window;\n const { cmd = [] } = googletag;\n\n googletag.apiReady = true;\n googletag.cmd = [];\n googletag.cmd.push = (a) => {\n try {\n a();\n // eslint-disable-next-line no-empty\n } catch (ex) { }\n return 1;\n };\n googletag.companionAds = () => companionAdsService;\n googletag.content = () => contentService;\n googletag.defineOutOfPageSlot = () => new Slot();\n googletag.defineSlot = () => new Slot();\n googletag.destroySlots = noopFunc;\n googletag.disablePublisherConsole = noopFunc;\n googletag.display = noopFunc;\n googletag.enableServices = noopFunc;\n googletag.getVersion = noopStr;\n googletag.pubads = () => pubAdsService;\n googletag.pubadsReady = true;\n googletag.setAdIframeTitle = noopFunc;\n googletag.sizeMapping = () => new SizeMappingBuilder();\n\n window.googletag = googletag;\n while (cmd.length !== 0) {\n googletag.cmd.push(cmd.shift());\n }\n\n hit(source);\n}\n\nGoogleTagServicesGpt.names = [\n 'googletagservices-gpt',\n 'ubo-googletagservices_gpt.js',\n 'googletagservices_gpt.js',\n];\n\nGoogleTagServicesGpt.injections = [\n hit,\n noopFunc,\n noopThis,\n noopNull,\n noopArray,\n noopStr,\n];\n","import { hit } from '../helpers';\n\n/**\n * @redirect scorecardresearch-beacon\n *\n * @description\n * Mocks Scorecard Research API.\n *\n * Related UBO redirect resource:\n * https://github.com/gorhill/uBlock/blob/a94df7f3b27080ae2dcb3b914ace39c0c294d2f6/src/web_accessible_resources/scorecardresearch_beacon.js\n *\n * **Example**\n * ```\n * ||sb.scorecardresearch.com/beacon.js$script,redirect=scorecardresearch-beacon\n * ```\n */\nexport function ScoreCardResearchBeacon(source) {\n window.COMSCORE = {\n purge() {\n // eslint-disable-next-line no-underscore-dangle\n window._comscore = [];\n },\n beacon() {},\n };\n hit(source);\n}\n\nScoreCardResearchBeacon.names = [\n 'scorecardresearch-beacon',\n 'ubo-scorecardresearch_beacon.js',\n 'scorecardresearch_beacon.js',\n];\n\nScoreCardResearchBeacon.injections = [\n hit,\n];\n","import { hit, noopFunc } from '../helpers';\n\n/**\n * @redirect metrika-yandex-tag\n *\n * @description\n * Mocks Yandex Metrika API.\n * https://yandex.ru/support/metrica/objects/method-reference.html\n *\n * **Example**\n * ```\n * ||mc.yandex.ru/metrika/tag.js$script,redirect=metrika-yandex-tag\n * ```\n */\nexport function metrikaYandexTag(source) {\n const asyncCallbackFromOptions = (param, options = {}) => {\n let { callback } = options;\n const { ctx } = options;\n if (typeof callback === 'function') {\n callback = ctx !== undefined ? callback.bind(ctx) : callback;\n setTimeout(() => callback());\n }\n };\n\n const init = noopFunc;\n\n /**\n * https://yandex.ru/support/metrica/objects/addfileextension.html\n */\n const addFileExtension = noopFunc;\n\n /**\n * https://yandex.ru/support/metrica/objects/extlink.html\n */\n const extLink = asyncCallbackFromOptions;\n\n /**\n * https://yandex.ru/support/metrica/objects/file.html\n */\n const file = asyncCallbackFromOptions;\n\n /**\n * https://yandex.ru/support/metrica/objects/get-client-id.html\n * @param {Function} cb\n */\n const getClientID = (cb) => {\n setTimeout(cb(null));\n };\n\n /**\n * https://yandex.ru/support/metrica/objects/hit.html\n */\n const hitFunc = asyncCallbackFromOptions;\n\n /**\n * https://yandex.ru/support/metrica/objects/notbounce.html\n */\n const notBounce = asyncCallbackFromOptions;\n\n /**\n * https://yandex.ru/support/metrica/objects/params-method.html\n */\n const params = noopFunc;\n\n /**\n * https://yandex.ru/support/metrica/objects/reachgoal.html\n * @param {string} target\n * @param {Object} params\n * @param {Function} callback\n * @param {any} ctx\n */\n const reachGoal = (target, params, callback, ctx) => {\n asyncCallbackFromOptions(null, { callback, ctx });\n };\n\n /**\n * https://yandex.ru/support/metrica/objects/set-user-id.html\n */\n const setUserID = noopFunc;\n\n /**\n * https://yandex.ru/support/metrica/objects/user-params.html\n */\n const userParams = noopFunc;\n\n const api = {\n init,\n addFileExtension,\n extLink,\n file,\n getClientID,\n hit: hitFunc,\n notBounce,\n params,\n reachGoal,\n setUserID,\n userParams,\n };\n\n function ym(id, funcName, ...args) {\n return api[funcName] && api[funcName](...args);\n }\n\n window.ym = ym;\n\n hit(source);\n}\n\nmetrikaYandexTag.names = [\n 'metrika-yandex-tag',\n];\n\nmetrikaYandexTag.injections = [hit, noopFunc];\n","import { hit, noopFunc } from '../helpers';\n\n/**\n * @redirect metrika-yandex-watch\n *\n * @description\n * Mocks the old Yandex Metrika API.\n * https://yandex.ru/support/metrica/objects/_method-reference.html\n *\n * **Example**\n * ```\n * ||mc.yandex.ru/metrika/watch.js$script,redirect=metrika-yandex-watch\n * ```\n */\nexport function metrikaYandexWatch(source) {\n const cbName = 'yandex_metrika_callbacks';\n\n /**\n * Gets callback and its context from options and call it in async way\n * @param {Object} options Yandex Metrika API options\n */\n const asyncCallbackFromOptions = (options = {}) => {\n let { callback } = options;\n const { ctx } = options;\n if (typeof callback === 'function') {\n callback = ctx !== undefined ? callback.bind(ctx) : callback;\n setTimeout(() => callback());\n }\n };\n\n function Metrika() { } // constructor\n\n // Methods without options\n Metrika.prototype.addFileExtension = noopFunc;\n Metrika.prototype.getClientID = noopFunc;\n Metrika.prototype.setUserID = noopFunc;\n Metrika.prototype.userParams = noopFunc;\n\n // Methods with options\n // The order of arguments should be kept in according to API\n Metrika.prototype.extLink = (url, options) => {\n asyncCallbackFromOptions(options);\n };\n Metrika.prototype.file = (url, options) => {\n asyncCallbackFromOptions(options);\n };\n Metrika.prototype.hit = (url, options) => {\n asyncCallbackFromOptions(options);\n };\n Metrika.prototype.reachGoal = (target, params, cb, ctx) => {\n asyncCallbackFromOptions({ callback: cb, ctx });\n };\n Metrika.prototype.notBounce = asyncCallbackFromOptions;\n\n if (window.Ya) {\n window.Ya.Metrika = Metrika;\n } else {\n window.Ya = { Metrika };\n }\n\n if (window[cbName] && Array.isArray(window[cbName])) {\n window[cbName].forEach((func) => {\n if (typeof func === 'function') {\n func();\n }\n });\n }\n\n hit(source);\n}\n\nmetrikaYandexWatch.names = [\n 'metrika-yandex-watch',\n];\n\nmetrikaYandexWatch.injections = [hit, noopFunc];\n","import {\n attachDependencies,\n addCall,\n wrapInNonameFunc,\n passSourceAndProps,\n} from '../helpers/injector';\n\nimport validator from '../helpers/validator';\n\nimport {\n convertUboRedirectToAdg,\n convertAbpRedirectToAdg,\n convertRedirectToAdg,\n convertAdgRedirectToUbo,\n} from '../helpers/converter';\n\nimport * as redirectsList from './redirectsList';\n\n/**\n * Finds redirect resource by it's name\n * @param {string} name - redirect name\n */\nconst getRedirectByName = (name) => {\n const redirects = Object.keys(redirectsList).map((key) => redirectsList[key]);\n return redirects.find((r) => r.names && r.names.indexOf(name) > -1);\n};\n\n/**\n * @typedef {Object} Source - redirect properties\n * @property {string} name redirect name\n * @property {Array} args Arguments for redirect function\n * @property {'extension'|'test'} [engine] -\n * Defines the final form of redirect string presentation\n * @property {boolean} [verbose] flag to enable printing to console debug information\n */\n\n/**\n * Returns redirect code by param\n * @param {Source} source\n */\nconst getRedirectCode = (source) => {\n const redirect = getRedirectByName(source.name);\n let result = attachDependencies(redirect);\n result = addCall(redirect, result);\n\n // redirect code for different sources is checked in tests\n // so it should be just a code without any source and props passed\n result = source.engine === 'test'\n ? wrapInNonameFunc(result)\n : passSourceAndProps(source, result);\n\n return result;\n};\n\n\nexport const redirectsCjs = {\n getCode: getRedirectCode,\n isAdgRedirectRule: validator.isAdgRedirectRule,\n isValidAdgRedirectRule: validator.isValidAdgRedirectRule,\n isAdgRedirectCompatibleWithUbo: validator.isAdgRedirectCompatibleWithUbo,\n isUboRedirectCompatibleWithAdg: validator.isUboRedirectCompatibleWithAdg,\n isAbpRedirectCompatibleWithAdg: validator.isAbpRedirectCompatibleWithAdg,\n convertUboRedirectToAdg,\n convertAbpRedirectToAdg,\n convertRedirectToAdg,\n convertAdgRedirectToUbo,\n};\n","import { redirectsCjs } from '../redirects';\n\nimport {\n attachDependencies,\n addCall,\n passSourceAndProps,\n wrapInNonameFunc,\n} from '../helpers/injector';\n\nimport validator from '../helpers/validator';\n\nimport {\n isValidScriptletRule,\n convertUboScriptletToAdg,\n convertAbpSnippetToAdg,\n convertScriptletToAdg,\n convertAdgScriptletToUbo,\n} from '../helpers/converter';\n\n\n/**\n * @typedef {Object} Source - scriptlet properties\n * @property {string} name Scriptlet name\n * @property {Array} args Arguments for scriptlet function\n * @property {'extension'|'corelibs'|'test'} engine -\n * Defines the final form of scriptlet string presentation\n * @property {string} [version]\n * @property {boolean} [verbose] flag to enable printing to console debug information\n * @property {string} [ruleText] Source rule text is used for debugging purposes\n */\n\n/**\n* Returns scriptlet code by param\n* @param {Source} source\n*/\nfunction getScriptletCode(source) {\n if (!validator.isValidScriptletName(source.name)) {\n return null;\n }\n\n const scriptlet = validator.getScriptletByName(source.name);\n let result = attachDependencies(scriptlet);\n result = addCall(scriptlet, result);\n result = source.engine === 'corelibs' || source.engine === 'test'\n ? wrapInNonameFunc(result)\n : passSourceAndProps(source, result);\n return result;\n}\n\n/**\n * Scriptlets variable\n *\n * @returns {Object} object with methods:\n * `invoke` method receives one argument with `Source` type\n * `validate` method receives one argument with `String` type\n */\nconst scriptletsObject = (() => ({\n invoke: getScriptletCode,\n isValidScriptletName: validator.isValidScriptletName,\n isValidScriptletRule,\n isAdgScriptletRule: validator.isAdgScriptletRule,\n isUboScriptletRule: validator.isUboScriptletRule,\n isAbpSnippetRule: validator.isAbpSnippetRule,\n convertUboToAdg: convertUboScriptletToAdg,\n convertAbpToAdg: convertAbpSnippetToAdg,\n convertScriptletToAdg,\n convertAdgToUbo: convertAdgScriptletToUbo,\n redirects: redirectsCjs,\n}))();\n\nexport default scriptletsObject;\n","import scriptletsObject from './index';\n\n/**\n * Add module exports to be used as node package\n */\nmodule.exports = scriptletsObject;\n"],"names":["randomId","Math","random","toString","substr","setPropertyAccess","object","property","descriptor","currentDescriptor","Object","getOwnPropertyDescriptor","configurable","defineProperty","getPropertyInChain","base","chain","addProp","pos","indexOf","prop","slice","own","undefined","escapeRegExp","str","replace","toRegExp","length","RegExp","escaped","getBeforeRegExp","rx","index","search","substring","startsWith","prefix","endsWith","substringAfter","separator","substringBefore","wrapInSingleQuotes","getStringInBraces","firstIndex","lastIndex","lastIndexOf","createOnErrorHandler","rid","nativeOnError","window","onerror","onError","error","Function","args","apply","noopFunc","noopNull","trueFunc","falseFunc","noopThis","noopArray","noopStr","hit","source","message","verbose","log","console","bind","trace","ruleText","LOG_MARKER","e","__debug","observeDOMChanges","callback","observeAttrs","attrsToObserv","throttle","method","delay","wait","savedArgs","wrapper","setTimeout","THROTTLE_DELAY_MS","observer","MutationObserver","callbackWrapper","connect","observe","document","documentElement","childList","subtree","attributes","attributeFilter","disconnect","attachDependencies","scriptlet","injections","reduce","accum","dep","dependencies","name","addCall","code","passSourceAndProps","sourceString","JSON","stringify","argsString","map","params","wrapInNonameFunc","iterateWithTransitions","iterable","transitions","init","state","keys","i","ADG_SCRIPTLET_MASK","wordSaver","strs","saveSymb","s","saveStr","push","getAll","parseRule","TRANSITION","OPENED","PARAM","CLOSED","opened","rule","sep","char","transition","symb","Error","param","saver","preIndex","before","abortOnPropertyRead","abort","ReferenceError","setChainPropAccess","owner","chainInfo","setter","a","get","set","names","abortOnPropertyWrite","preventSetTimeout","match","nativeTimeout","nativeIsNaN","Number","isNaN","shouldLog","INVERT_MARKER","isNotMatch","isNotDelay","parseInt","timeoutWrapper","timeout","shouldPrevent","test","preventSetInterval","nativeInterval","setInterval","intervalWrapper","interval","preventWindowOpen","replacement","nativeOpen","open","openWrapper","result","isProp","propertyPart","propertyName","propertyValue","resObj","abortCurrentInlineScript","regex","getCurrentScript","currentScript","scripts","getElementsByTagName","ourScript","scriptEl","content","textContent","textContentGetter","Node","prototype","call","HTMLScriptElement","props","split","propIndex","baseName","currentValue","value","setConstant","constantValue","parseFloat","abs","canceled","mustCancel","removeCookie","removeCookieFromHost","cookieName","hostName","cookieSpec","domain1","domain2","path","expiration","cookie","rmCookie","forEach","cookieStr","trim","hostParts","location","hostname","join","addEventListener","preventAddEventListener","eventSearch","funcSearch","nativeAddEventListener","EventTarget","addEventListenerWrapper","eventName","funcToCheck","preventBab","nativeSetTimeout","babRegex","signatures","check","tokens","j","token","found","nativeEval","eval","bodyEl","body","style","removeProperty","el","getElementById","parentNode","removeChild","nowebrtc","RTCPeerConnection","webkitRTCPeerConnection","rtcReplacement","config","close","createDataChannel","createOffer","setRemoteDescription","rtc","b","send","logAddEventListener","callbackToLog","logEval","evalWrapper","nativeFunction","FunctionWrapper","create","constructor","noeval","preventEvalIf","payload","preventFab","Fab","clearEvent","emitEvent","on","onDetected","onNotDetected","setOption","FuckAdBlock","BlockAdBlock","fuckAdBlock","blockAdBlock","setPopadsDummy","PopAds","popns","defineProperties","preventPopadsNet","throwError","preventAdfly","isDigit","data","handler","encodedURL","evenChars","oddChars","charAt","ii","temp","decodedURL","atob","stop","onbeforeunload","href","val","applyHandler","err","debugOnPropertyRead","debugOnPropertyWrite","debugCurrentInlineScript","removeAttr","attrs","selector","rmattr","nodes","querySelectorAll","removed","node","attr","removeAttribute","removeClass","classNames","selectors","className","removeClassHandler","Set","foundedNodes","n","add","elements","element","classList","contains","remove","CLASS_ATTR_NAME","disableNewtabLinks","ev","target","localName","hasAttribute","stopPropagation","preventDefault","adjustSetInterval","boost","nativeIsFinite","isFinite","cb","d","adjustSetTimeout","dirString","times","dir","dirWrapper","jsonPrune","propsToRemove","requiredInitialProps","prunePaths","needlePaths","isPruningNeeded","root","needlePath","details","nestedPropName","pop","nativeParse","parse","parseWrapper","r","ownerObj","preventRequestAnimationFrame","nativeRequestAnimationFrame","requestAnimationFrame","doNotMatch","rafWrapper","logMessage","JS_RULE_MASK","COMMENT_MARKER","isComment","UBO_SCRIPTLET_MASK_REG","UBO_SCRIPTLET_MASK_1","UBO_SCRIPTLET_MASK_2","UBO_SCRIPTLET_EXCEPTION_MASK_1","UBO_SCRIPTLET_EXCEPTION_MASK_2","ABP_SCRIPTLET_MASK","ABP_SCRIPTLET_EXCEPTION_MASK","ADG_CSS_MASK_REG","isAdgScriptletRule","isUboScriptletRule","isAbpSnippetRule","getScriptletByName","scriptlets","scriptletsList","key","find","isValidScriptletName","ADG_UBO_REDIRECT_MARKER","ABP_REDIRECT_MARKER","VALID_SOURCE_TYPES","validAdgRedirects","redirects","filter","adg","objFromEntries","pairs","output","acc","uboToAdgCompatibility","ubo","abpToAdgCompatibility","abp","adgToUboCompatibility","validAdgCompatibility","REDIRECT_RULE_TYPES","VALID_ADG","marker","compatibility","ADG","UBO","ABP","parseModifiers","getRedirectName","ruleModifiers","redirectNamePart","isAdgRedirectRule","isRedirectRuleByType","type","redirectName","isValidAdgRedirectRule","isAdgRedirectCompatibleWithUbo","isUboRedirectCompatibleWithAdg","isAbpRedirectCompatibleWithAdg","hasValidContentType","sourceType","validator","ADGUARD_SCRIPTLET_MASK_REG","ADGUARD_SCRIPTLET_TEMPLATE","ADGUARD_SCRIPTLET_EXCEPTION_TEMPLATE","UBO_SCRIPTLET_TEMPLATE","UBO_SCRIPTLET_EXCEPTION_TEMPLATE","UBO_ALIAS_NAME_MARKER","UBO_XHR_TYPE","ADG_XHR_TYPE","getSentences","reg","replacePlaceholders","convertUboScriptletToAdg","domains","mask","template","arg","outputArg","adgRule","convertAbpSnippetToAdg","SEMICOLON_DIVIDER","convertScriptletToAdg","convertAdgScriptletToUbo","res","parsedName","parsedParams","adgScriptletObject","scriptletList","aliases","uboAlias","alias","includes","uboName","uboRule","isValidScriptletRule","input","rulesArray","isValid","parsedRule","convertUboRedirectToAdg","firstPartOfRule","uboModifiers","adgModifiers","adgName","convertAbpRedirectToAdg","abpModifiers","abpName","convertRedirectToAdg","convertAdgRedirectToUbo","GoogleAnalytics","Tracker","proto","googleAnalyticsName","GoogleAnalyticsObject","ga","len","arguments","lastArg","hitCallback","ex","getByName","loaded","dataLayer","hide","end","GoogleAnalyticsGa","Gaq","Na","O","Sa","Ta","Va","_createAsyncTracker","_getAsyncTracker","_getPlugin","Array","isArray","assign","gaq","asyncTrackers","_gaq","shift","qf","Gat","api","tracker","funcName","_getLinkerUrl","_anonymizeIP","_createTracker","_forceSSL","_getTracker","_getTrackerByName","_getTrackers","aa","ab","hb","la","oa","pa","u","gat","_gat","GoogleSyndicationAdsByGoogle","adsbygoogle","adElems","css","executed","setAttribute","aswiftIframe","createElement","id","appendChild","googleadsIframe","GoogleTagManagerGtm","eventCallback","GoogleTagServicesGpt","companionAdsService","enableSyncLoading","setRefreshUnfilledSlots","contentService","setContent","PassbackSlot","display","setClickUrl","setTagForChildDirectedTreatment","setTargeting","updateTargetingFromMap","SizeMappingBuilder","addSize","build","Slot","addService","clearCategoryExclusions","clearTargeting","defineSizeMapping","getAdUnitPath","getAttributeKeys","getCategoryExclusions","getDomId","getSlotElementId","getSlotId","getTargeting","getTargetingKeys","setCategoryExclusion","setCollapseEmptyDiv","pubAdsService","clear","clearTagForChildDirectedTreatment","collapseEmptyDivs","defineOutOfPagePassback","definePassback","disableInitialLoad","enableAsyncRendering","enableSingleRequest","enableSyncRendering","enableVideoAds","getSlots","refresh","setCentering","setCookieOptions","setForceSafeFrame","setLocation","setPublisherProvidedId","setRequestNonPersonalizedAds","setSafeFrameConfig","setVideoContent","updateCorrelator","googletag","cmd","apiReady","companionAds","defineOutOfPageSlot","defineSlot","destroySlots","disablePublisherConsole","enableServices","getVersion","pubads","pubadsReady","setAdIframeTitle","sizeMapping","ScoreCardResearchBeacon","COMSCORE","purge","_comscore","beacon","metrikaYandexTag","asyncCallbackFromOptions","options","ctx","addFileExtension","extLink","file","getClientID","hitFunc","notBounce","reachGoal","setUserID","userParams","ym","metrikaYandexWatch","cbName","Metrika","url","Ya","func","getRedirectByName","redirectsList","getRedirectCode","redirect","engine","redirectsCjs","getCode","getScriptletCode","scriptletsObject","invoke","convertUboToAdg","convertAbpToAdg","convertAdgToUbo","module","exports"],"mappings":";;;;;;AACA;;;AAGO,SAASA,QAAT,GAAoB;AACvB,SAAOC,IAAI,CAACC,MAAL,GAAcC,QAAd,CAAuB,EAAvB,EAA2BC,MAA3B,CAAkC,CAAlC,EAAqC,CAArC,CAAP;AACH;;ACND;;;;;;;AAOA,AAAO,SAASC,iBAAT,CAA2BC,MAA3B,EAAmCC,QAAnC,EAA6CC,UAA7C,EAAyD;AAC5D,MAAMC,iBAAiB,GAAGC,MAAM,CAACC,wBAAP,CAAgCL,MAAhC,EAAwCC,QAAxC,CAA1B;;AACA,MAAIE,iBAAiB,IAAI,CAACA,iBAAiB,CAACG,YAA5C,EAA0D;AACtD,WAAO,KAAP;AACH;;AACDF,EAAAA,MAAM,CAACG,cAAP,CAAsBP,MAAtB,EAA8BC,QAA9B,EAAwCC,UAAxC;AACA,SAAO,IAAP;AACH;;ACdD;;;;;;;AAOA;;;;;;;;;;;;;AAaA,AAAO,SAASM,kBAAT,CAA4BC,IAA5B,EAAkCC,KAAlC,EAAyD;AAAA,MAAhBC,OAAgB,uEAAN,IAAM;AAC5D,MAAMC,GAAG,GAAGF,KAAK,CAACG,OAAN,CAAc,GAAd,CAAZ;;AACA,MAAID,GAAG,KAAK,CAAC,CAAb,EAAgB;AACZ,WAAO;AAAEH,MAAAA,IAAI,EAAJA,IAAF;AAAQK,MAAAA,IAAI,EAAEJ;AAAd,KAAP;AACH;;AACD,MAAMI,IAAI,GAAGJ,KAAK,CAACK,KAAN,CAAY,CA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MAAD,CADb,GAEH5E,kBAAkB,CAAC7C,MAAD,EAASyH,MAAT,CAFxB;AAGA,SAAOA,MAAP;AACH;AAED;;;;;;;;;AAOA,IAAM+d,gBAAgB,GAAI;AAAA,SAAO;AAC7BC,IAAAA,MAAM,EAAEF,gBADqB;AAE7B7P,IAAAA,oBAAoB,EAAEuC,SAAS,CAACvC,oBAFH;AAG7ByE,IAAAA,oBAAoB,EAApBA,oBAH6B;AAI7BjF,IAAAA,kBAAkB,EAAE+C,SAAS,CAAC/C,kBAJD;AAK7BC,IAAAA,kBAAkB,EAAE8C,SAAS,CAAC9C,kBALD;AAM7BC,IAAAA,gBAAgB,EAAE6C,SAAS,CAAC7C,gBANC;AAO7BsQ,IAAAA,eAAe,EAAE7M,wBAPY;AAQ7B8M,IAAAA,eAAe,EAAEvM,sBARY;AAS7BE,IAAAA,qBAAqB,EAArBA,qBAT6B;AAU7BsM,IAAAA,eAAe,EAAErM,wBAVY;AAW7BxD,IAAAA,SAAS,EAAEsP;AAXkB,GAAP;AAAA,CAAD,EAAzB;;ACtDA;;;;AAGAQ,MAAM,CAACC,OAAP,GAAiBN,gBAAjB;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"scriptletsCjs.js","sources":["../../src/helpers/random-id.js","../../src/helpers/set-property-access.js","../../src/helpers/get-property-in-chain.js","../../src/helpers/string-utils.js","../../src/helpers/create-on-error-handler.js","../../src/helpers/noop.js","../../src/helpers/hit.js","../../src/helpers/observer.js","../../src/helpers/index.js","../../src/helpers/injector.js","../../node_modules/@babel/runtime/helpers/arrayWithHoles.js","../../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js","../../node_modules/@babel/runtime/helpers/nonIterableRest.js","../../node_modules/@babel/runtime/helpers/slicedToArray.js","../../node_modules/@babel/runtime/helpers/defineProperty.js","../../src/helpers/parse-rule.js","../../src/scriptlets/abort-on-property-read.js","../../src/scriptlets/abort-on-property-write.js","../../src/scriptlets/prevent-setTimeout.js","../../src/scriptlets/prevent-setInterval.js","../../src/scriptlets/prevent-window-open.js","../../src/scriptlets/abort-current-inline-script.js","../../src/scriptlets/set-constant.js","../../src/scriptlets/remove-cookie.js","../../src/scriptlets/prevent-addEventListener.js","../../src/scriptlets/prevent-bab.js","../../src/scriptlets/nowebrtc.js","../../src/scriptlets/log-addEventListener.js","../../src/scriptlets/log-eval.js","../../src/scriptlets/log.js","../../src/scriptlets/noeval.js","../../src/scriptlets/prevent-eval-if.js","../../src/scriptlets/prevent-fab-3.2.0.js","../../src/scriptlets/set-popads-dummy.js","../../src/scriptlets/prevent-popads-net.js","../../src/scriptlets/prevent-adfly.js","../../src/scriptlets/debug-on-property-read.js","../../src/scriptlets/debug-on-property-write.js","../../src/scriptlets/debug-current-inline-script.js","../../src/scriptlets/remove-attr.js","../../src/scriptlets/remove-class.js","../../src/scriptlets/disable-newtab-links.js","../../src/scriptlets/adjust-setInterval.js","../../src/scriptlets/adjust-setTimeout.js","../../src/scriptlets/dir-string.js","../../src/scriptlets/json-prune.js","../../src/scriptlets/prevent-requestAnimationFrame.js","../../src/scriptlets/scriptletsList.js","../../src/helpers/validator.js","../../node_modules/@babel/runtime/helpers/iterableToArray.js","../../node_modules/@babel/runtime/helpers/toArray.js","../../src/helpers/converter.js","../../src/redirects/google-analytics.js","../../src/redirects/google-analytics-ga.js","../../src/redirects/googlesyndication-adsbygoogle.js","../../src/redirects/googletagmanager-gtm.js","../../src/redirects/googletagservices-gpt.js","../../src/redirects/scorecardresearch-beacon.js","../../src/redirects/metrika-yandex-tag.js","../../src/redirects/metrika-yandex-watch.js","../../src/redirects/index.js","../../src/scriptlets/index.js","../../src/scriptlets/scriptletsCjsWrapper.js"],"sourcesContent":["\n/**\n * Generate random six symbols id\n */\nexport function randomId() {\n return Math.random().toString(36).substr(2, 9);\n}\n","/**\n * Set getter and setter to property if it's configurable\n * @param {Object} object target object with property\n * @param {string} property property name\n * @param {Object} descriptor contains getter and setter functions\n * @returns {boolean} is operation successful\n */\nexport function setPropertyAccess(object, property, descriptor) {\n const currentDescriptor = Object.getOwnPropertyDescriptor(object, property);\n if (currentDescriptor && !currentDescriptor.configurable) {\n return false;\n }\n Object.defineProperty(object, property, descriptor);\n return true;\n}\n","/**\n * @typedef Chain\n * @property {Object} base\n * @property {string} prop\n * @property {string} [chain]\n */\n\n/**\n * Check is property exist in base object recursively\n *\n * If property doesn't exist in base object,\n * defines this property (for addProp = true)\n * and returns base, property name and remaining part of property chain\n *\n * @param {Object} base\n * @param {string} chain\n * @param {boolean} [addProp=true]\n * defines is nonexistent base property should be assigned as 'undefined'\n * @returns {Chain}\n */\nexport function getPropertyInChain(base, chain, addProp = true) {\n const pos = chain.indexOf('.');\n if (pos === -1) {\n return { base, prop: chain };\n }\n const prop = chain.slice(0, pos);\n const own = base[prop];\n chain = chain.slice(pos + 1);\n if (own !== undefined) {\n return getPropertyInChain(own, chain, addProp);\n }\n\n if (!addProp) {\n return false;\n }\n\n Object.defineProperty(base, prop, { configurable: true });\n return { base: own, prop, chain };\n}\n","/**\n * Escapes special chars in string\n * @param {string} str\n * @returns {string}\n */\nexport const escapeRegExp = (str) => str.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n\n/**\n * Converts search string to the regexp\n * TODO think about nested dependencies, but be careful with dependency loops\n * @param {string} str search string\n * @returns {RegExp}\n */\nexport const toRegExp = (str) => {\n if (str[0] === '/' && str[str.length - 1] === '/') {\n return new RegExp(str.slice(1, -1));\n }\n const escaped = str.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n return new RegExp(escaped);\n};\n\n/**\n * Get string before regexp first match\n * @param {string} str\n * @param {RegExp} rx\n */\nexport const getBeforeRegExp = (str, rx) => {\n const index = str.search(rx);\n return str.substring(0, index);\n};\n\nexport const startsWith = (str, prefix) => {\n return str && str.indexOf(prefix) === 0;\n};\n\nexport const endsWith = (str, prefix) => {\n return str && str.indexOf(prefix) === str.length - 1;\n};\n\nexport const substringAfter = (str, separator) => {\n if (!str) {\n return str;\n }\n const index = str.indexOf(separator);\n return index < 0 ? '' : str.substring(index + separator.length);\n};\n\nexport const substringBefore = (str, separator) => {\n if (!str || !separator) {\n return str;\n }\n const index = str.indexOf(separator);\n return index < 0 ? str : str.substring(0, index);\n};\n\n/**\n * Wrap str in single qoutes and replaces single quotes to doudle one\n * @param {string} str\n */\nexport const wrapInSingleQuotes = (str) => {\n if ((str[0] === '\\'' && str[str.length - 1] === '\\'')\n || (str[0] === '\"' && str[str.length - 1] === '\"')) {\n str = str.substring(1, str.length - 1);\n }\n // eslint-disable-next-line no-useless-escape\n str = str.replace(/\\'/g, '\"');\n\n return `'${str}'`;\n};\n\n/**\n * Returns substring enclosed in the widest braces\n * @param {string} str\n */\nexport const getStringInBraces = (str) => {\n const firstIndex = str.indexOf('(');\n const lastIndex = str.lastIndexOf(')');\n return str.substring(firstIndex + 1, lastIndex);\n};\n","/**\n * Generates function which silents global errors on page generated by scriptlet\n * If error doesn't belong to our error we transfer it to the native onError handler\n * @param {string} rid - unique identifier of scriptlet\n * @return {onError}\n */\nexport function createOnErrorHandler(rid) {\n // eslint-disable-next-line consistent-return\n const nativeOnError = window.onerror;\n return function onError(error, ...args) {\n if (typeof error === 'string' && error.indexOf(rid) !== -1) {\n return true;\n }\n if (nativeOnError instanceof Function) {\n return nativeOnError.apply(this, [error, ...args]);\n }\n return false;\n };\n}\n","/**\n * Noop function\n */\nexport const noopFunc = () => { };\n\n/**\n * Function returns null\n */\nexport const noopNull = () => null;\n\n/**\n * Function returns true\n */\nexport const trueFunc = () => true;\n\n/**\n * Function returns false\n */\nexport const falseFunc = () => false;\n\n/**\n * Function returns this\n */\nexport function noopThis() {\n return this;\n}\n\n/**\n * Function returns empty array\n */\nexport const noopArray = () => [];\n\n/**\n * Function returns empty string\n */\nexport const noopStr = () => '';\n","/* eslint-disable no-console, no-underscore-dangle */\n/**\n * Hit used only for debug purposes now\n * @param {Source} source\n * @param {string} [message] - optional message;\n * use LOG_MARKER = 'log: ' at the start of a message\n * for logging scriptlets\n */\nexport const hit = (source, message) => {\n if (source.verbose !== true) {\n return;\n }\n\n try {\n const log = console.log.bind(console);\n const trace = console.trace.bind(console);\n\n const prefix = source.ruleText || '';\n\n // Used to check if scriptlet uses 'hit' function for logging\n const LOG_MARKER = 'log: ';\n\n if (message) {\n if (message.indexOf(LOG_MARKER) === -1) {\n log(`${prefix} message:\\n${message}`);\n } else {\n log(message.slice(LOG_MARKER.length));\n }\n }\n\n log(`${prefix} trace start`);\n if (trace) {\n trace();\n }\n log(`${prefix} trace end`);\n } catch (e) {\n // try catch for Edge 15\n // In according to this issue https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/14495220/\n // console.log throws an error\n }\n\n // This is necessary for unit-tests only!\n if (typeof window.__debug === 'function') {\n window.__debug(source);\n }\n};\n","/**\n * DOM tree changes observer. Used for 'remove-attr' and 'remove-class' scriptlets\n * @param {Function} callback\n * @param {Boolean} observeAttrs - optional parameter - should observer check attibutes changes\n */\nexport const observeDOMChanges = (callback, observeAttrs = false, attrsToObserv = []) => {\n /**\n * Returns a wrapper, passing the call to 'method' at maximum once per 'delay' milliseconds.\n * Those calls that fall into the \"cooldown\" period, are ignored\n * @param {Function} method\n * @param {Number} delay - milliseconds\n */\n const throttle = (method, delay) => {\n let wait = false;\n let savedArgs;\n const wrapper = (...args) => {\n if (wait) {\n savedArgs = args;\n return;\n }\n method(...args);\n wait = true;\n setTimeout(() => {\n wait = false;\n if (savedArgs) {\n wrapper(savedArgs);\n savedArgs = null;\n }\n }, delay);\n };\n return wrapper;\n };\n\n /**\n * 'delay' in milliseconds for 'throttle' method\n */\n const THROTTLE_DELAY_MS = 20;\n /**\n * Used for remove-class\n */\n // eslint-disable-next-line no-use-before-define\n const observer = new MutationObserver(throttle(callbackWrapper, THROTTLE_DELAY_MS));\n\n const connect = () => {\n if (attrsToObserv.length > 0) {\n observer.observe(document.documentElement, {\n childList: true,\n subtree: true,\n attributes: observeAttrs,\n attributeFilter: attrsToObserv,\n });\n } else {\n observer.observe(document.documentElement, {\n childList: true,\n subtree: true,\n attributes: observeAttrs,\n });\n }\n };\n const disconnect = () => {\n observer.disconnect();\n };\n function callbackWrapper() {\n disconnect();\n callback();\n connect();\n }\n\n connect();\n};\n","/**\n * This file must export all used dependencies\n */\nexport * from './random-id';\nexport * from './set-property-access';\nexport * from './get-property-in-chain';\nexport * from './string-utils';\nexport * from './create-on-error-handler';\nexport * from './noop';\nexport * from './hit';\nexport * from './observer';\n","import * as dependencies from '.';\n\n\n/**\n * Concat dependencies to scriptlet code\n * @param {string} scriptlet string view of scriptlet\n */\nexport function attachDependencies(scriptlet) {\n const { injections = [] } = scriptlet;\n return injections.reduce((accum, dep) => `${accum}\\n${dependencies[dep.name]}`, scriptlet.toString());\n}\n\n/**\n * Add scriptlet call to existing code\n * @param {Function} scriptlet\n * @param {string} code\n */\nexport function addCall(scriptlet, code) {\n return `${code};\n const updatedArgs = args ? [].concat(source).concat(args) : [source];\n ${scriptlet.name}.apply(this, updatedArgs);\n `;\n}\n\n/**\n * Wrap function into IIFE (Immediately invoked function expression)\n *\n * @param {Source} source - object with scriptlet properties\n * @param {string} code - scriptlet source code with dependencies\n *\n * @returns {string} full scriptlet code\n *\n * @example\n * const source = {\n * args: [\"aaa\", \"bbb\"],\n * name: 'noeval',\n * };\n * const code = \"function noeval(source, args) { alert(source); } noeval.apply(this, args);\"\n * const result = wrapInIIFE(source, code);\n *\n * // result\n * `(function(source, args) {\n * function noeval(source) { alert(source); }\n * noeval.apply(this, args);\n * )({\"args\": [\"aaa\", \"bbb\"], \"name\":\"noeval\"}, [\"aaa\", \"bbb\"])`\n */\nexport function passSourceAndProps(source, code) {\n if (source.hit) {\n source.hit = source.hit.toString();\n }\n const sourceString = JSON.stringify(source);\n const argsString = source.args ? `[${source.args.map(JSON.stringify)}]` : undefined;\n const params = argsString ? `${sourceString}, ${argsString}` : sourceString;\n return `(function(source, args){\\n${code}\\n})(${params});`;\n}\n\n/**\n * Wrap code in no name function\n * @param {string} code which must be wrapped\n */\nexport function wrapInNonameFunc(code) {\n return `function(source, args){\\n${code}\\n}`;\n}\n","function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\n\nmodule.exports = _arrayWithHoles;","function _iterableToArrayLimit(arr, i) {\n if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === \"[object Arguments]\")) {\n return;\n }\n\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}\n\nmodule.exports = _iterableToArrayLimit;","function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance\");\n}\n\nmodule.exports = _nonIterableRest;","var arrayWithHoles = require(\"./arrayWithHoles\");\n\nvar iterableToArrayLimit = require(\"./iterableToArrayLimit\");\n\nvar nonIterableRest = require(\"./nonIterableRest\");\n\nfunction _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || nonIterableRest();\n}\n\nmodule.exports = _slicedToArray;","function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nmodule.exports = _defineProperty;","/**\n * Iterate over iterable argument and evaluate current state with transitions\n * @param {string} init first transition name\n * @param {Array|Collection|string} iterable\n * @param {Object} transitions transtion functions\n * @param {any} args arguments which should be passed to transition functions\n */\nfunction iterateWithTransitions(iterable, transitions, init, args) {\n let state = init || Object.keys(transitions)[0];\n for (let i = 0; i < iterable.length; i += 1) {\n state = transitions[state](iterable, i, args);\n }\n return state;\n}\n\n/**\n * AdGuard scriptlet rule mask\n */\nexport const ADG_SCRIPTLET_MASK = '#//scriptlet';\n\n/**\n * Helper to accumulate an array of strings char by char\n */\nconst wordSaver = () => {\n let str = '';\n const strs = [];\n const saveSymb = (s) => {\n str += s;\n return str;\n };\n const saveStr = () => {\n strs.push(str);\n str = '';\n };\n const getAll = () => [...strs];\n\n return { saveSymb, saveStr, getAll };\n};\n\nconst substringAfter = (str, separator) => {\n if (!str) {\n return str;\n }\n const index = str.indexOf(separator);\n return index < 0 ? '' : str.substring(index + separator.length);\n};\n\n/**\n * Parse and validate scriptlet rule\n * @param {*} ruleText\n * @returns {{name: string, args: Array}}\n */\nexport const parseRule = (ruleText) => {\n ruleText = substringAfter(ruleText, ADG_SCRIPTLET_MASK);\n /**\n * Transition names\n */\n const TRANSITION = {\n OPENED: 'opened',\n PARAM: 'param',\n CLOSED: 'closed',\n };\n\n /**\n * Transition function: the current index position in start, end or between params\n * @param {string} rule\n * @param {number} index\n * @param {Object} Object\n * @property {Object} Object.sep contains prop symb with current separator char\n */\n const opened = (rule, index, { sep }) => {\n const char = rule[index];\n let transition;\n switch (char) {\n case ' ':\n case '(':\n case ',': {\n transition = TRANSITION.OPENED;\n break;\n }\n case '\\'':\n case '\"': {\n sep.symb = char;\n transition = TRANSITION.PARAM;\n break;\n }\n case ')': {\n transition = index === rule.length - 1\n ? TRANSITION.CLOSED\n : TRANSITION.OPENED;\n break;\n }\n default: {\n throw new Error('The rule is not a scriptlet');\n }\n }\n\n return transition;\n };\n /**\n * Transition function: the current index position inside param\n * @param {string} rule\n * @param {number} index\n * @param {Object} Object\n * @property {Object} Object.sep contains prop `symb` with current separator char\n * @property {Object} Object.saver helper which allow to save strings by car by char\n */\n const param = (rule, index, { saver, sep }) => {\n const char = rule[index];\n switch (char) {\n case '\\'':\n case '\"': {\n const preIndex = index - 1;\n const before = rule[preIndex];\n if (char === sep.symb && before !== '\\\\') {\n sep.symb = null;\n saver.saveStr();\n return TRANSITION.OPENED;\n }\n }\n // eslint-disable-next-line no-fallthrough\n default: {\n saver.saveSymb(char);\n return TRANSITION.PARAM;\n }\n }\n };\n const transitions = {\n [TRANSITION.OPENED]: opened,\n [TRANSITION.PARAM]: param,\n [TRANSITION.CLOSED]: () => { },\n };\n const sep = { symb: null };\n const saver = wordSaver();\n const state = iterateWithTransitions(ruleText, transitions, TRANSITION.OPENED, { sep, saver });\n\n if (state !== 'closed') {\n throw new Error(`Invalid scriptlet rule ${ruleText}`);\n }\n\n const args = saver.getAll();\n return {\n name: args[0],\n args: args.slice(1),\n };\n};\n","import {\n randomId, setPropertyAccess, getPropertyInChain, createOnErrorHandler, hit,\n} from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet abort-on-property-read\n *\n * @description\n * Aborts a script when it attempts to **read** the specified property.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#abort-on-property-readjs-\n *\n * Related ABP source:\n * https://github.com/adblockplus/adblockpluscore/blob/6b2a309054cc23432102b85d13f12559639ef495/lib/content/snippets.js#L864\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet('abort-on-property-read', )\n * ```\n *\n * **Parameters**\n * - `property` (required) path to a property (joined with `.` if needed). The property must be attached to `window`.\n *\n * **Examples**\n * ```\n * ! Aborts script when it tries to access `window.alert`\n * example.org#%#//scriptlet('abort-on-property-read', 'alert')\n *\n * ! Aborts script when it tries to access `navigator.language`\n * example.org#%#//scriptlet('abort-on-property-read', 'navigator.language')\n * ```\n */\n/* eslint-enable max-len */\nexport function abortOnPropertyRead(source, property) {\n if (!property) {\n return;\n }\n const rid = randomId();\n const abort = () => {\n hit(source);\n throw new ReferenceError(rid);\n };\n const setChainPropAccess = (owner, property) => {\n const chainInfo = getPropertyInChain(owner, property);\n let { base } = chainInfo;\n const { prop, chain } = chainInfo;\n if (chain) {\n const setter = (a) => {\n base = a;\n if (a instanceof Object) {\n setChainPropAccess(a, chain);\n }\n };\n Object.defineProperty(owner, prop, {\n get: () => base,\n set: setter,\n });\n return;\n }\n\n setPropertyAccess(base, prop, {\n get: abort,\n set: () => {\n },\n });\n };\n\n setChainPropAccess(window, property);\n\n window.onerror = createOnErrorHandler(rid)\n .bind();\n}\n\nabortOnPropertyRead.names = [\n 'abort-on-property-read',\n 'abort-on-property-read.js',\n 'ubo-abort-on-property-read.js',\n 'aopr.js',\n 'ubo-aopr.js',\n 'abp-abort-on-property-read',\n];\nabortOnPropertyRead.injections = [\n randomId,\n setPropertyAccess,\n getPropertyInChain,\n createOnErrorHandler,\n hit,\n];\n","import {\n randomId, setPropertyAccess, getPropertyInChain, createOnErrorHandler, hit,\n} from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet abort-on-property-write\n *\n * @description\n * Aborts a script when it attempts to **write** the specified property.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#abort-on-property-writejs-\n *\n * Related ABP source:\n * https://github.com/adblockplus/adblockpluscore/blob/6b2a309054cc23432102b85d13f12559639ef495/lib/content/snippets.js#L896\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet('abort-on-property-write', )\n * ```\n *\n * **Parameters**\n * - `property` (required) path to a property (joined with `.` if needed). The property must be attached to `window`.\n *\n * **Examples**\n * ```\n * ! Aborts script when it tries to set `window.adblock` value\n * example.org#%#//scriptlet('abort-on-property-write', 'adblock')\n * ```\n */\n/* eslint-enable max-len */\nexport function abortOnPropertyWrite(source, property) {\n if (!property) {\n return;\n }\n const rid = randomId();\n const abort = () => {\n hit(source);\n throw new ReferenceError(rid);\n };\n const setChainPropAccess = (owner, property) => {\n const chainInfo = getPropertyInChain(owner, property);\n let { base } = chainInfo;\n const { prop, chain } = chainInfo;\n if (chain) {\n const setter = (a) => {\n base = a;\n if (a instanceof Object) {\n setChainPropAccess(a, chain);\n }\n };\n Object.defineProperty(owner, prop, {\n get: () => base,\n set: setter,\n });\n return;\n }\n\n setPropertyAccess(base, prop, { set: abort });\n };\n\n setChainPropAccess(window, property);\n\n window.onerror = createOnErrorHandler(rid).bind();\n}\n\nabortOnPropertyWrite.names = [\n 'abort-on-property-write',\n 'abort-on-property-write.js',\n 'ubo-abort-on-property-write.js',\n 'aopw.js',\n 'ubo-aopw.js',\n 'abp-abort-on-property-write',\n];\n\nabortOnPropertyWrite.injections = [\n randomId,\n setPropertyAccess,\n getPropertyInChain,\n createOnErrorHandler,\n hit,\n];\n","import {\n hit, noopFunc, toRegExp, startsWith,\n} from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet prevent-setTimeout\n *\n * @description\n * Prevents a `setTimeout` call if:\n * 1) the text of the callback is matching the specified search string/regexp which does not start with `!`;\n * otherwise mismatched calls should be defused;\n * 2) the timeout is matching the specified delay; otherwise mismatched calls should be defused.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#no-settimeout-ifjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"prevent-setTimeout\"[, [, ]])\n * ```\n *\n * **Parameters**\n *\n * Call with no arguments will log calls to setTimeout while debugging (`log-setTimeout` superseding),\n * so production filter lists' rules definitely require at least one of the parameters:\n * - `search` (optional) string or regular expression.\n * If starts with `!`, scriptlet will not match the stringified callback but all other will be defused.\n * If do not start with `!`, the stringified callback will be matched.\n * If not set, prevents all `setTimeout` calls due to specified `delay`.\n * - `delay` (optional) must be an integer.\n * If starts with `!`, scriptlet will not match the delay but all other will be defused.\n * If do not start with `!`, the delay passed to the `setTimeout` call will be matched.\n *\n * **Examples**\n *\n * 1. Prevents `setTimeout` calls if the callback matches `/\\.test/` regardless of the delay.\n * ```bash\n * example.org#%#//scriptlet(\"prevent-setTimeout\", \"/\\.test/\")\n * ```\n *\n * For instance, the following call will be prevented:\n * ```javascript\n * setTimeout(function () {\n * window.test = \"value\";\n * }, 100);\n * ```\n *\n * 2. Prevents `setTimeout` calls if the callback does not contain `value`.\n * ```\n * example.org#%#//scriptlet(\"prevent-setTimeout\", \"!value\")\n * ```\n *\n * For instance, only the first of the following calls will be prevented:\n * ```javascript\n * setTimeout(function () {\n * window.test = \"test -- prevented\";\n * }, 300);\n * setTimeout(function () {\n * window.test = \"value -- executed\";\n * }, 400);\n * setTimeout(function () {\n * window.value = \"test -- executed\";\n * }, 500);\n * ```\n *\n * 3. Prevents `setTimeout` calls if the callback contains `value` and the delay is not set to `300`.\n * ```\n * example.org#%#//scriptlet(\"prevent-setTimeout\", \"value\", \"!300\")\n * ```\n *\n * For instance, only the first of the following calls will not be prevented:\n * ```javascript\n * setTimeout(function () {\n * window.test = \"value 1 -- executed\";\n * }, 300);\n * setTimeout(function () {\n * window.test = \"value 2 -- prevented\";\n * }, 400);\n * setTimeout(function () {\n * window.test = \"value 3 -- prevented\";\n * }, 500);\n * ```\n *\n * 4. Prevents `setTimeout` calls if the callback does not contain `value` and the delay is not set to `300`.\n * ```\n * example.org#%#//scriptlet(\"prevent-setTimeout\", \"!value\", \"!300\")\n * ```\n *\n * For instance, only the second of the following calls will be prevented:\n * ```javascript\n * setTimeout(function () {\n * window.test = \"test -- executed\";\n * }, 300);\n * setTimeout(function () {\n * window.test = \"test -- prevented\";\n * }, 400);\n * setTimeout(function () {\n * window.test = \"value -- executed\";\n * }, 400);\n * setTimeout(function () {\n * window.value = \"test -- executed\";\n * }, 500);\n * ```\n */\n/* eslint-enable max-len */\nexport function preventSetTimeout(source, match, delay) {\n const nativeTimeout = window.setTimeout;\n const nativeIsNaN = Number.isNaN || window.isNaN; // eslint-disable-line compat/compat\n const log = console.log.bind(console); // eslint-disable-line no-console\n\n // logs setTimeouts to console if no arguments have been specified\n const shouldLog = ((typeof match === 'undefined') && (typeof delay === 'undefined'));\n\n const INVERT_MARKER = '!';\n\n const isNotMatch = startsWith(match, INVERT_MARKER);\n if (isNotMatch) {\n match = match.slice(1);\n }\n const isNotDelay = startsWith(delay, INVERT_MARKER);\n if (isNotDelay) {\n delay = delay.slice(1);\n }\n\n delay = parseInt(delay, 10);\n delay = nativeIsNaN(delay) ? null : delay;\n\n match = match ? toRegExp(match) : toRegExp('/.?/');\n\n const timeoutWrapper = (callback, timeout, ...args) => {\n let shouldPrevent = false;\n if (shouldLog) {\n hit(source);\n log(`setTimeout(\"${callback.toString()}\", ${timeout})`);\n } else if (!delay) {\n shouldPrevent = match.test(callback.toString()) !== isNotMatch;\n } else if (match === '/.?/') {\n shouldPrevent = (timeout === delay) !== isNotDelay;\n } else {\n shouldPrevent = match.test(callback.toString()) !== isNotMatch\n && (timeout === delay) !== isNotDelay;\n }\n\n if (shouldPrevent) {\n hit(source);\n return nativeTimeout(noopFunc, timeout);\n }\n\n return nativeTimeout.apply(window, [callback, timeout, ...args]);\n };\n window.setTimeout = timeoutWrapper;\n}\n\npreventSetTimeout.names = [\n 'prevent-setTimeout',\n 'no-setTimeout-if.js', // new implementation of setTimeout-defuser.js\n 'ubo-no-setTimeout-if.js',\n 'setTimeout-defuser.js', // old name should be supported as well\n 'ubo-setTimeout-defuser.js',\n 'nostif.js', // new short name of no-setTimeout-if\n 'ubo-nostif.js',\n 'std.js', // old short scriptlet name\n 'ubo-std.js',\n];\n\npreventSetTimeout.injections = [toRegExp, startsWith, hit, noopFunc];\n","import {\n hit, noopFunc, toRegExp, startsWith,\n} from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet prevent-setInterval\n *\n * @description\n * Prevents a `setInterval` call if:\n * 1) the text of the callback is matching the specified `search` string/regexp which does not start with `!`;\n * otherwise mismatched calls should be defused;\n * 2) the interval is matching the specified `delay`; otherwise mismatched calls should be defused.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#no-setinterval-ifjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"prevent-setInterval\"[, [, ]])\n * ```\n *\n * **Parameters**\n *\n * Call with no arguments will log calls to setInterval while debugging (`log-setInterval` superseding),\n * so production filter lists' rules definitely require at least one of the parameters:\n * - `search` (optional) string or regular expression.\n * If starts with `!`, scriptlet will not match the stringified callback but all other will be defused.\n * If do not start with `!`, the stringified callback will be matched.\n * If not set, prevents all `setInterval` calls due to specified `delay`.\n * - `delay` (optional) must be an integer.\n * If starts with `!`, scriptlet will not match the delay but all other will be defused.\n * If do not start with `!`, the delay passed to the `setInterval` call will be matched.\n *\n * **Examples**\n *\n * 1. Prevents `setInterval` calls if the callback matches `/\\.test/` regardless of the delay.\n * ```bash\n * example.org#%#//scriptlet(\"prevent-setInterval\", \"/\\.test/\")\n * ```\n *\n * For instance, the following call will be prevented:\n * ```javascript\n * setInterval(function () {\n * window.test = \"value\";\n * }, 100);\n * ```\n *\n * 2. Prevents `setInterval` calls if the callback does not contain `value`.\n * ```\n * example.org#%#//scriptlet(\"prevent-setInterval\", \"!value\")\n * ```\n *\n * For instance, only the first of the following calls will be prevented:\n * ```javascript\n * setInterval(function () {\n * window.test = \"test -- prevented\";\n * }, 300);\n * setInterval(function () {\n * window.test = \"value -- executed\";\n * }, 400);\n * setInterval(function () {\n * window.value = \"test -- executed\";\n * }, 500);\n * ```\n *\n * 3. Prevents `setInterval` calls if the callback contains `value` and the delay is not set to `300`.\n * ```\n * example.org#%#//scriptlet(\"prevent-setInterval\", \"value\", \"!300\")\n * ```\n *\n * For instance, only the first of the following calls will not be prevented:\n * ```javascript\n * setInterval(function () {\n * window.test = \"value 1 -- executed\";\n * }, 300);\n * setInterval(function () {\n * window.test = \"value 2 -- prevented\";\n * }, 400);\n * setInterval(function () {\n * window.test = \"value 3 -- prevented\";\n * }, 500);\n * ```\n *\n * 4. Prevents `setInterval` calls if the callback does not contain `value` and the delay is not set to `300`.\n * ```\n * example.org#%#//scriptlet(\"prevent-setInterval\", \"!value\", \"!300\")\n * ```\n *\n * For instance, only the second of the following calls will be prevented:\n * ```javascript\n * setInterval(function () {\n * window.test = \"test -- executed\";\n * }, 300);\n * setInterval(function () {\n * window.test = \"test -- prevented\";\n * }, 400);\n * setInterval(function () {\n * window.test = \"value -- executed\";\n * }, 400);\n * setInterval(function () {\n * window.value = \"test -- executed\";\n * }, 500);\n * ```\n */\n/* eslint-enable max-len */\nexport function preventSetInterval(source, match, delay) {\n const nativeInterval = window.setInterval;\n const nativeIsNaN = Number.isNaN || window.isNaN; // eslint-disable-line compat/compat\n const log = console.log.bind(console); // eslint-disable-line no-console\n\n // logs setIntervals to console if no arguments have been specified\n const shouldLog = ((typeof match === 'undefined') && (typeof delay === 'undefined'));\n\n const INVERT_MARKER = '!';\n\n const isNotMatch = startsWith(match, INVERT_MARKER);\n if (isNotMatch) {\n match = match.slice(1);\n }\n const isNotDelay = startsWith(delay, INVERT_MARKER);\n if (isNotDelay) {\n delay = delay.slice(1);\n }\n\n delay = parseInt(delay, 10);\n delay = nativeIsNaN(delay) ? null : delay;\n\n match = match ? toRegExp(match) : toRegExp('/.?/');\n\n const intervalWrapper = (callback, interval, ...args) => {\n let shouldPrevent = false;\n if (shouldLog) {\n hit(source);\n log(`setInterval(\"${callback.toString()}\", ${interval})`);\n } else if (!delay) {\n shouldPrevent = match.test(callback.toString()) !== isNotMatch;\n } else if (match === '/.?/') {\n shouldPrevent = (interval === delay) !== isNotDelay;\n } else {\n shouldPrevent = match.test(callback.toString()) !== isNotMatch\n && (interval === delay) !== isNotDelay;\n }\n\n if (shouldPrevent) {\n hit(source);\n return nativeInterval(noopFunc, interval);\n }\n\n return nativeInterval.apply(window, [callback, interval, ...args]);\n };\n window.setInterval = intervalWrapper;\n}\n\npreventSetInterval.names = [\n 'prevent-setInterval',\n 'no-setInterval-if.js', // new implementation of setInterval-defuser.js\n 'ubo-no-setInterval-if.js',\n 'setInterval-defuser.js', // old name should be supported as well\n 'ubo-setInterval-defuser.js',\n 'nosiif.js', // new short name of no-setInterval-if\n 'ubo-nosiif.js',\n 'sid.js', // old short scriptlet name\n 'ubo-sid.js',\n];\n\npreventSetInterval.injections = [toRegExp, startsWith, hit, noopFunc];\n","import {\n toRegExp,\n substringBefore,\n substringAfter,\n startsWith,\n endsWith,\n hit,\n noopFunc,\n trueFunc,\n} from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet prevent-window-open\n *\n * @description\n * Prevents `window.open` calls when URL either matches or not matches the specified string/regexp. Using it without parameters prevents all `window.open` calls.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#windowopen-defuserjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet('prevent-window-open'[, [, [, ]]])\n * ```\n *\n * **Parameters**\n * - `match` (optional) defaults to \"matching\", any positive number or nothing for \"matching\", 0 or empty string for \"not matching\",\n * - `search` (optional) string or regexp for matching the URL passed to `window.open` call; defaults to search all `window.open` call.\n * - `replacement` (optional) string to return prop value or property instead of window.open; defaults to return noopFunc\n * **Example**\n *\n * 1. Prevent all `window.open` calls:\n * ```\n * example.org#%#//scriptlet('prevent-window-open')\n * ```\n *\n * 2. Prevent `window.open` for all URLs containing `example`:\n * ```\n * example.org#%#//scriptlet('prevent-window-open', '1', 'example')\n * ```\n *\n * 3. Prevent `window.open` for all URLs matching RegExp `/example\\./`:\n * ```\n * example.org#%#//scriptlet('prevent-window-open', '1', '/example\\./')\n * ```\n *\n * 4. Prevent `window.open` for all URLs **NOT** containing `example`:\n * ```\n * example.org#%#//scriptlet('prevent-window-open', '0', 'example')\n * ```\n * 5. Prevent all `window.open` calls and return 'trueFunc' instead of it if website checks it:\n * ```\n * example.org#%#//scriptlet('prevent-window-open', , , 'trueFunc')\n * ```\n * 6. Prevent all `window.open` and returns callback\n * which returns object with property 'propName'=noopFunc\n * as a property of window.open if website checks it:\n * ```\n * example.org#%#//scriptlet('prevent-window-open', '1', , '{propName=noopFunc}')\n * ```\n */\n/* eslint-enable max-len */\nexport function preventWindowOpen(source, match = 1, search, replacement) {\n // Default value of 'match' is needed to prevent all `window.open` calls\n // if the scriptlet is used without parameters\n const nativeOpen = window.open;\n\n // unary plus converts 'match' to a number\n // e.g.: +'1' -> 1; +false -> 0\n match = +match > 0;\n\n search = search\n ? toRegExp(search)\n : toRegExp('/.?/');\n\n // eslint-disable-next-line consistent-return\n const openWrapper = (str, ...args) => {\n if (match !== search.test(str)) {\n return nativeOpen.apply(window, [str, ...args]);\n }\n\n hit(source);\n\n let result;\n\n // defaults to return noopFunc instead of window.open\n if (!replacement) {\n result = noopFunc;\n } else if (replacement === 'trueFunc') {\n result = trueFunc;\n } else if (replacement.indexOf('=') > -1) {\n // We should return noopFunc instead of window.open\n // but with some property if website checks it (examples 5, 6)\n // https://github.com/AdguardTeam/Scriptlets/issues/71\n const isProp = startsWith(replacement, '{') && endsWith(replacement, '}');\n if (isProp) {\n const propertyPart = replacement.slice(1, -1);\n const propertyName = substringBefore(propertyPart, '=');\n const propertyValue = substringAfter(propertyPart, '=');\n if (propertyValue === 'noopFunc') {\n result = () => {\n const resObj = { };\n resObj[propertyName] = noopFunc;\n return resObj;\n };\n }\n }\n }\n\n return result;\n };\n\n window.open = openWrapper;\n}\n\npreventWindowOpen.names = [\n 'prevent-window-open',\n 'window.open-defuser.js',\n 'ubo-window.open-defuser.js',\n];\n\npreventWindowOpen.injections = [\n toRegExp,\n startsWith,\n endsWith,\n substringBefore,\n substringAfter,\n hit,\n noopFunc,\n trueFunc,\n];\n","import {\n randomId,\n setPropertyAccess,\n getPropertyInChain,\n toRegExp,\n createOnErrorHandler,\n hit,\n} from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet abort-current-inline-script\n *\n * @description\n * Aborts an inline script when it attempts to **read** the specified property\n * AND when the contents of the `\n * ```\n *\n * 3. Aborts inline scripts which are trying to access `window.alert` and match this regexp: `/Hello.+world/`.\n * ```\n * example.org#%#//scriptlet('abort-current-inline-script', 'alert', '/Hello.+world/')\n * ```\n *\n * For instance, the following scripts will be aborted:\n * ```html\n * \n * ```\n * ```html\n * \n * ```\n *\n * This script will not be aborted:\n * ```html\n * \n * ```\n */\n/* eslint-enable max-len */\nexport function abortCurrentInlineScript(source, property, search = null) {\n const regex = search ? toRegExp(search) : null;\n const rid = randomId();\n\n const getCurrentScript = () => {\n if (!document.currentScript) { // eslint-disable-line compat/compat\n const scripts = document.getElementsByTagName('script');\n return scripts[scripts.length - 1];\n }\n return document.currentScript; // eslint-disable-line compat/compat\n };\n\n const ourScript = getCurrentScript();\n\n const abort = () => {\n const scriptEl = getCurrentScript();\n let content = scriptEl.textContent;\n\n // We are using Node.prototype.textContent property descriptor\n // to get the real script content\n // even when document.currentScript.textContent is replaced.\n // https://github.com/AdguardTeam/Scriptlets/issues/57#issuecomment-593638991\n try {\n const textContentGetter = Object.getOwnPropertyDescriptor(Node.prototype, 'textContent').get;\n content = textContentGetter.call(scriptEl);\n } catch (e) { } // eslint-disable-line no-empty\n\n if (scriptEl instanceof HTMLScriptElement\n && content.length > 0\n && scriptEl !== ourScript\n && (!regex || regex.test(content))) {\n hit(source);\n throw new ReferenceError(rid);\n }\n };\n\n const setChainPropAccess = (owner, property) => {\n const chainInfo = getPropertyInChain(owner, property);\n let { base } = chainInfo;\n const { prop, chain } = chainInfo;\n\n // The scriptlet might be executed before the chain property has been created\n // (for instance, document.body before the HTML body was loaded).\n // In this case we're checking whether the base element exists or not\n // and if not, we simply exit without overriding anything.\n // e.g. https://github.com/AdguardTeam/Scriptlets/issues/57#issuecomment-575841092\n if (base instanceof Object === false && base === null) {\n const props = property.split('.');\n const propIndex = props.indexOf(prop);\n const baseName = props[propIndex - 1];\n console.log(`The scriptlet had been executed before the ${baseName} was loaded.`); // eslint-disable-line no-console\n return;\n }\n\n if (chain) {\n const setter = (a) => {\n base = a;\n if (a instanceof Object) {\n setChainPropAccess(a, chain);\n }\n };\n Object.defineProperty(owner, prop, {\n get: () => base,\n set: setter,\n });\n return;\n }\n\n let currentValue = base[prop];\n setPropertyAccess(base, prop, {\n set: (value) => {\n abort();\n currentValue = value;\n },\n get: () => {\n abort();\n return currentValue;\n },\n });\n };\n\n setChainPropAccess(window, property);\n\n window.onerror = createOnErrorHandler(rid)\n .bind();\n}\n\nabortCurrentInlineScript.names = [\n 'abort-current-inline-script',\n 'abort-current-inline-script.js',\n 'ubo-abort-current-inline-script.js',\n 'acis.js',\n 'ubo-acis.js',\n 'abp-abort-current-inline-script',\n];\n\nabortCurrentInlineScript.injections = [\n randomId,\n setPropertyAccess,\n getPropertyInChain,\n toRegExp,\n createOnErrorHandler,\n hit,\n];\n","import {\n hit,\n noopFunc,\n trueFunc,\n falseFunc,\n getPropertyInChain,\n setPropertyAccess,\n} from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet set-constant\n *\n * @description\n * Creates a constant property and assigns it one of the values from the predefined list.\n *\n * > Actually, it's not a constant. Please note, that it can be rewritten with a value of a different type.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#set-constantjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"set-constant\", , )\n * ```\n *\n * **Parameters**\n * - `property` (required) path to a property (joined with `.` if needed). The property must be attached to `window`.\n * - `value` (required). Possible values:\n * - positive decimal integer `<= 32767`\n * - one of the predefined constants:\n * - `undefined`\n * - `false`\n * - `true`\n * - `null`\n * - `noopFunc` - function with empty body\n * - `trueFunc` - function returning true\n * - `falseFunc` - function returning false\n * - `''` - empty string\n * - `-1` - number value `-1`\n *\n * **Examples**\n * ```\n * ! window.firstConst === false // this comparision will return true\n * example.org#%#//scriptlet(\"set-constant\", \"firstConst\", \"false\")\n *\n * ! window.secondConst() === true // call to the secondConst will return true\n * example.org#%#//scriptlet(\"set-constant\", \"secondConst\", \"trueFunc\")\n * ```\n */\n/* eslint-enable max-len */\nexport function setConstant(source, property, value) {\n if (!property) {\n return;\n }\n\n const nativeIsNaN = Number.isNaN || window.isNaN; // eslint-disable-line compat/compat\n\n let constantValue;\n if (value === 'undefined') {\n constantValue = undefined;\n } else if (value === 'false') {\n constantValue = false;\n } else if (value === 'true') {\n constantValue = true;\n } else if (value === 'null') {\n constantValue = null;\n } else if (value === 'noopFunc') {\n constantValue = noopFunc;\n } else if (value === 'trueFunc') {\n constantValue = trueFunc;\n } else if (value === 'falseFunc') {\n constantValue = falseFunc;\n } else if (/^\\d+$/.test(value)) {\n constantValue = parseFloat(value);\n if (nativeIsNaN(constantValue)) {\n return;\n }\n if (Math.abs(constantValue) > 0x7FFF) {\n return;\n }\n } else if (value === '-1') {\n constantValue = -1;\n } else if (value === '') {\n constantValue = '';\n } else {\n return;\n }\n\n let canceled = false;\n const mustCancel = (value) => {\n if (canceled) {\n return canceled;\n }\n canceled = value !== undefined\n && constantValue !== undefined\n && typeof value !== typeof constantValue;\n return canceled;\n };\n\n const setChainPropAccess = (owner, property) => {\n const chainInfo = getPropertyInChain(owner, property);\n let { base } = chainInfo;\n const { prop, chain } = chainInfo;\n if (chain) {\n const setter = (a) => {\n base = a;\n if (a instanceof Object) {\n setChainPropAccess(a, chain);\n }\n };\n Object.defineProperty(owner, prop, {\n get: () => base,\n set: setter,\n });\n return;\n }\n\n if (mustCancel(base[prop])) { return; }\n\n hit(source);\n setPropertyAccess(base, prop, {\n get: () => constantValue,\n set: (a) => {\n if (mustCancel(a)) {\n constantValue = a;\n }\n },\n });\n };\n\n setChainPropAccess(window, property);\n}\n\nsetConstant.names = [\n 'set-constant',\n 'set-constant.js',\n 'ubo-set-constant.js',\n 'set.js',\n 'ubo-set.js',\n];\nsetConstant.injections = [\n getPropertyInChain,\n setPropertyAccess,\n hit,\n noopFunc,\n trueFunc,\n falseFunc,\n];\n","import { hit, toRegExp } from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet remove-cookie\n *\n * @description\n * Removes current page cookies by passed string matching with name. For current domain and subdomains. Runs on load and before unload.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#cookie-removerjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"remove-cookie\"[, match])\n * ```\n *\n * **Parameters**\n * - `match` (optional) String or regex matching the cookie name. If not specified all accessible cookies will be removed.\n *\n * **Examples**\n * 1. Removes all cookies:\n * ```\n * example.org#%#//scriptlet(\"remove-cookie\")\n * ```\n *\n * 2. Removes cookies which name contains `example` string.\n * ```\n * example.org#%#//scriptlet(\"remove-cookie\", \"example\")\n * ```\n *\n * For instance this cookie will be removed\n * ```javascript\n * document.cookie = '__example=randomValue';\n * ```\n */\n/* eslint-enable max-len */\nexport function removeCookie(source, match) {\n const regex = match ? toRegExp(match) : toRegExp('/.?/');\n\n const removeCookieFromHost = (cookieName, hostName) => {\n const cookieSpec = `${cookieName}=`;\n const domain1 = `; domain=${hostName}`;\n const domain2 = `; domain=.${hostName}`;\n const path = '; path=/';\n const expiration = '; expires=Thu, 01 Jan 1970 00:00:00 GMT';\n document.cookie = cookieSpec + expiration;\n document.cookie = cookieSpec + domain1 + expiration;\n document.cookie = cookieSpec + domain2 + expiration;\n document.cookie = cookieSpec + path + expiration;\n document.cookie = cookieSpec + domain1 + path + expiration;\n document.cookie = cookieSpec + domain2 + path + expiration;\n hit(source);\n };\n\n const rmCookie = () => {\n document.cookie.split(';').forEach((cookieStr) => {\n const pos = cookieStr.indexOf('=');\n if (pos === -1) {\n return;\n }\n\n const cookieName = cookieStr.slice(0, pos).trim();\n if (!regex.test(cookieName)) {\n return;\n }\n\n const hostParts = document.location.hostname.split('.');\n for (let i = 0; i <= hostParts.length - 1; i += 1) {\n const hostName = hostParts.slice(i).join('.');\n if (hostName) {\n removeCookieFromHost(cookieName, hostName);\n }\n }\n });\n };\n rmCookie();\n window.addEventListener('beforeunload', rmCookie);\n}\n\nremoveCookie.names = [\n 'remove-cookie',\n 'cookie-remover.js',\n 'ubo-cookie-remover.js',\n];\n\nremoveCookie.injections = [toRegExp, hit];\n","import { hit, toRegExp } from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet prevent-addEventListener\n *\n * @description\n * Prevents adding event listeners for the specified events and callbacks.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#addeventlistener-defuserjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"prevent-addEventListener\"[, eventSearch[, functionSearch]])\n * ```\n *\n * **Parameters**\n * - `eventSearch` (optional) String or regex matching the event name. If not specified, the scriptlets prevents all event listeners.\n * - `functionSearch` (optional) String or regex matching the event listener function body. If not set, the scriptlet prevents all event listeners with event name matching `eventSearch`.\n *\n * **Examples**\n * 1. Prevent all `click` listeners:\n * ```\n * example.org#%#//scriptlet(\"prevent-addEventListener\", \"click\")\n * ```\n\n2. Prevent 'click' listeners with the callback body containing `searchString`.\n * ```\n * example.org#%#//scriptlet(\"prevent-addEventListener\", \"click\", \"searchString\")\n * ```\n *\n * For instance, this listener will not be called:\n * ```javascript\n * el.addEventListener('click', () => {\n * window.test = 'searchString';\n * });\n * ```\n */\n/* eslint-enable max-len */\nexport function preventAddEventListener(source, eventSearch, funcSearch) {\n eventSearch = eventSearch ? toRegExp(eventSearch) : toRegExp('/.?/');\n funcSearch = funcSearch ? toRegExp(funcSearch) : toRegExp('/.?/');\n\n const nativeAddEventListener = window.EventTarget.prototype.addEventListener;\n function addEventListenerWrapper(eventName, callback, ...args) {\n // The scriptlet might cause a website broke\n // if the website uses test addEventListener with callback = null\n // https://github.com/AdguardTeam/Scriptlets/issues/76\n let funcToCheck = callback;\n if (callback && typeof callback === 'function') {\n funcToCheck = callback.toString();\n }\n\n if (eventSearch.test(eventName.toString()) && funcSearch.test(funcToCheck)) {\n hit(source);\n return undefined;\n }\n return nativeAddEventListener.apply(this, [eventName, callback, ...args]);\n }\n\n window.EventTarget.prototype.addEventListener = addEventListenerWrapper;\n}\n\npreventAddEventListener.names = [\n 'prevent-addEventListener',\n 'addEventListener-defuser.js',\n 'ubo-addEventListener-defuser.js',\n 'aeld.js',\n 'ubo-aeld.js',\n];\n\npreventAddEventListener.injections = [toRegExp, hit];\n","/* eslint-disable consistent-return, no-eval */\nimport { hit } from '../helpers';\n\n/**\n * @scriptlet prevent-bab\n *\n * @description\n * Prevents BlockAdblock script from detecting an ad blocker.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#bab-defuserjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"prevent-bab\")\n * ```\n */\nexport function preventBab(source) {\n const nativeSetTimeout = window.setTimeout;\n const babRegex = /\\.bab_elementid.$/;\n\n window.setTimeout = (callback, ...args) => {\n if (typeof callback !== 'string' || !babRegex.test(callback)) {\n return nativeSetTimeout.call(this, callback, ...args);\n }\n hit(source);\n };\n\n const signatures = [\n ['blockadblock'],\n ['babasbm'],\n [/getItem\\('babn'\\)/],\n ['getElementById', 'String.fromCharCode', 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789', 'charAt', 'DOMContentLoaded', 'AdBlock', 'addEventListener', 'doScroll', 'fromCharCode', '<<2|r>>4', 'sessionStorage', 'clientWidth', 'localStorage', 'Math', 'random'],\n ];\n const check = (str) => {\n for (let i = 0; i < signatures.length; i += 1) {\n const tokens = signatures[i];\n let match = 0;\n for (let j = 0; j < tokens.length; j += 1) {\n const token = tokens[j];\n const found = token instanceof RegExp ? token.test(str) : str.indexOf(token) > -1;\n if (found) {\n match += 1;\n }\n }\n if (match / tokens.length >= 0.8) {\n return true;\n }\n }\n return false;\n };\n\n const nativeEval = window.eval;\n window.eval = (str) => {\n if (!check(str)) {\n return nativeEval(str);\n }\n hit(source);\n const bodyEl = document.body;\n if (bodyEl) {\n bodyEl.style.removeProperty('visibility');\n }\n const el = document.getElementById('babasbmsgx');\n if (el) {\n el.parentNode.removeChild(el);\n }\n };\n}\n\npreventBab.names = [\n 'prevent-bab',\n 'nobab.js',\n 'ubo-nobab.js',\n 'bab-defuser.js',\n 'ubo-bab-defuser.js',\n];\n\npreventBab.injections = [hit];\n","/* eslint-disable no-unused-vars, no-extra-bind, func-names */\nimport { hit, noopFunc } from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet nowebrtc\n *\n * @description\n * Disables WebRTC by overriding `RTCPeerConnection`. The overriden function will log every attempt to create a new connection.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#nowebrtcjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"nowebrtc\")\n * ```\n */\n/* eslint-enable max-len */\nexport function nowebrtc(source) {\n let propertyName = '';\n if (window.RTCPeerConnection) {\n propertyName = 'RTCPeerConnection';\n } else if (window.webkitRTCPeerConnection) {\n propertyName = 'webkitRTCPeerConnection';\n }\n\n if (propertyName === '') {\n return;\n }\n\n const rtcReplacement = (config) => {\n hit(source, `Document tried to create an RTCPeerConnection: ${config}`);\n };\n rtcReplacement.prototype = {\n close: noopFunc,\n createDataChannel: noopFunc,\n createOffer: noopFunc,\n setRemoteDescription: noopFunc,\n };\n const rtc = window[propertyName];\n window[propertyName] = rtcReplacement;\n if (rtc.prototype) {\n rtc.prototype.createDataChannel = function (a, b) {\n return {\n close: noopFunc,\n send: noopFunc,\n };\n }.bind(null);\n }\n}\n\nnowebrtc.names = [\n 'nowebrtc',\n 'nowebrtc.js',\n 'ubo-nowebrtc.js',\n];\n\nnowebrtc.injections = [hit, noopFunc];\n","/* eslint-disable no-console */\nimport { hit } from '../helpers';\n\n/**\n * @scriptlet log-addEventListener\n *\n * @description\n * Logs all addEventListener calls to the console.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#addeventlistener-loggerjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"log-addEventListener\")\n * ```\n */\nexport function logAddEventListener(source) {\n const log = console.log.bind(console);\n const nativeAddEventListener = window.EventTarget.prototype.addEventListener;\n function addEventListenerWrapper(eventName, callback, ...args) {\n hit(source);\n // The scriptlet might cause a website broke\n // if the website uses test addEventListener with callback = null\n // https://github.com/AdguardTeam/Scriptlets/issues/76\n let callbackToLog = callback;\n if (callback && typeof callback === 'function') {\n callbackToLog = callback.toString();\n }\n log(`addEventListener(\"${eventName}\", ${callbackToLog})`);\n return nativeAddEventListener.apply(this, [eventName, callback, ...args]);\n }\n window.EventTarget.prototype.addEventListener = addEventListenerWrapper;\n}\n\nlogAddEventListener.names = [\n 'log-addEventListener',\n 'addEventListener-logger.js',\n 'ubo-addEventListener-logger.js',\n 'aell.js',\n 'ubo-aell.js',\n];\n\nlogAddEventListener.injections = [hit];\n","/* eslint-disable no-console, no-eval */\nimport { hit } from '../helpers';\n\n/**\n * @scriptlet log-eval\n *\n * @description\n * Logs all `eval()` or `new Function()` calls to the console.\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"log-eval\")\n * ```\n */\nexport function logEval(source) {\n const log = console.log.bind(console);\n // wrap eval function\n const nativeEval = window.eval;\n function evalWrapper(str) {\n hit(source);\n log(`eval(\"${str}\")`);\n return nativeEval(str);\n }\n window.eval = evalWrapper;\n\n // wrap new Function\n const nativeFunction = window.Function;\n\n function FunctionWrapper(...args) {\n hit(source);\n log(`new Function(${args.join(', ')})`);\n return nativeFunction.apply(this, [...args]);\n }\n\n FunctionWrapper.prototype = Object.create(nativeFunction.prototype);\n FunctionWrapper.prototype.constructor = FunctionWrapper;\n\n window.Function = FunctionWrapper;\n}\n\nlogEval.names = [\n 'log-eval',\n];\n\nlogEval.injections = [hit];\n","/**\n * @scriptlet log\n *\n * @description\n * A simple scriptlet which only purpose is to print arguments to console.\n * This scriptlet can be helpful for debugging and troubleshooting other scriptlets.\n * **Example**\n * ```\n * example.org#%#//scriptlet(\"log\", \"arg1\", \"arg2\")\n * ```\n */\nexport function log(...args) {\n console.log(args); // eslint-disable-line no-console\n}\nlog.names = ['log'];\n","/* eslint-disable no-eval, no-extra-bind */\nimport { hit } from '../helpers';\n\n/**\n * @scriptlet noeval\n *\n * @description\n * Prevents page to use eval.\n * Notifies about attempts in the console\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#noevaljs-\n *\n * It also can be used as `$redirect` rules sometimes.\n * See [redirect description](../wiki/about-redirects.md#noeval).\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet('noeval')\n * ```\n */\nexport function noeval(source) {\n window.eval = function evalWrapper(s) {\n hit(source, `AdGuard has prevented eval:\\n${s}`);\n }.bind();\n}\n\nnoeval.names = [\n 'noeval',\n 'noeval.js',\n 'silent-noeval.js',\n 'ubo-noeval.js',\n 'ubo-silent-noeval.js',\n];\n\nnoeval.injections = [hit];\n","/* eslint-disable no-eval, no-extra-bind, func-names */\n\nimport { toRegExp, hit } from '../helpers';\n\n/**\n * @scriptlet prevent-eval-if\n *\n * @description\n * Prevents page to use eval matching payload.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#noeval-ifjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet('prevent-eval-if'[, ])\n * ```\n *\n * **Parameters**\n * - `search` - optional string or regexp for matching stringified eval payload.\n * If 'search is not specified — all stringified eval payload will be matched.\n *\n * **Examples**\n * ```\n * ! Prevents eval if it matches 'test'\n * example.org#%#//scriptlet('prevent-eval-if', 'test')\n * ```\n *\n * @param {string|RegExp} [search] string or regexp matching stringified eval payload\n */\nexport function preventEvalIf(source, search) {\n search = search ? toRegExp(search) : toRegExp('/.?/');\n\n const nativeEval = window.eval;\n window.eval = function (payload) {\n if (!search.test(payload.toString())) {\n return nativeEval.call(window, payload);\n }\n hit(source, payload);\n return undefined;\n }.bind(window);\n}\n\npreventEvalIf.names = [\n 'prevent-eval-if',\n 'noeval-if.js',\n 'ubo-noeval-if.js',\n];\n\npreventEvalIf.injections = [toRegExp, hit];\n","/* eslint-disable no-console, func-names, no-multi-assign */\nimport { hit, noopFunc, noopThis } from '../helpers';\n\n/**\n * @scriptlet prevent-fab-3.2.0\n *\n * @description\n * Prevents execution of the FAB script v3.2.0.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#fuckadblockjs-320-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"prevent-fab-3.2.0\")\n * ```\n */\nexport function preventFab(source) {\n hit(source);\n const Fab = function () {};\n Fab.prototype.check = noopFunc;\n Fab.prototype.clearEvent = noopFunc;\n Fab.prototype.emitEvent = noopFunc;\n Fab.prototype.on = function (a, b) {\n if (!a) {\n b();\n }\n return this;\n };\n Fab.prototype.onDetected = noopThis;\n Fab.prototype.onNotDetected = function (a) {\n a();\n return this;\n };\n Fab.prototype.setOption = noopFunc;\n window.FuckAdBlock = window.BlockAdBlock = Fab;\n //\n window.fuckAdBlock = window.blockAdBlock = new Fab();\n}\n\npreventFab.names = [\n 'prevent-fab-3.2.0',\n 'nofab.js',\n 'ubo-nofab.js',\n 'fuckadblock.js-3.2.0',\n 'ubo-fuckadblock.js-3.2.0',\n];\n\npreventFab.injections = [hit, noopFunc, noopThis];\n","/* eslint-disable no-console, func-names, no-multi-assign */\nimport { hit } from '../helpers';\n\n/**\n * @scriptlet set-popads-dummy\n *\n * @description\n * Sets static properties PopAds and popns.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#popads-dummyjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"set-popads-dummy\")\n * ```\n */\nexport function setPopadsDummy(source) {\n delete window.PopAds;\n delete window.popns;\n Object.defineProperties(window, {\n PopAds: {\n get: () => {\n hit(source);\n return {};\n },\n },\n popns: {\n get: () => {\n hit(source);\n return {};\n },\n },\n });\n}\n\nsetPopadsDummy.names = [\n 'set-popads-dummy',\n 'popads-dummy.js',\n 'ubo-popads-dummy.js',\n];\n\nsetPopadsDummy.injections = [hit];\n","import {\n hit, createOnErrorHandler, randomId,\n} from '../helpers';\n\n/**\n * @scriptlet prevent-popads-net\n *\n * @description\n * Aborts on property write (PopAds, popns), throws reference error with random id.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#popadsnetjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"prevent-popads-net\")\n * ```\n */\nexport function preventPopadsNet(source) {\n const rid = randomId();\n\n const throwError = () => {\n throw new ReferenceError(rid);\n };\n\n delete window.PopAds;\n delete window.popns;\n Object.defineProperties(window, {\n PopAds: { set: throwError },\n popns: { set: throwError },\n });\n\n window.onerror = createOnErrorHandler(rid).bind();\n hit(source);\n}\n\npreventPopadsNet.names = [\n 'prevent-popads-net',\n 'popads.net.js',\n 'ubo-popads.net.js',\n];\n\npreventPopadsNet.injections = [createOnErrorHandler, randomId, hit];\n","/* eslint-disable func-names */\nimport { hit, setPropertyAccess } from '../helpers';\n\n/**\n * @scriptlet prevent-adfly\n *\n * @description\n * Prevents anti-adblock scripts on adfly short links.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#adfly-defuserjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"prevent-adfly\")\n * ```\n */\nexport function preventAdfly(source) {\n const isDigit = (data) => /^\\d$/.test(data);\n const handler = function (encodedURL) {\n let evenChars = '';\n let oddChars = '';\n for (let i = 0; i < encodedURL.length; i += 1) {\n if (i % 2 === 0) {\n evenChars += encodedURL.charAt(i);\n } else {\n oddChars = encodedURL.charAt(i) + oddChars;\n }\n }\n\n let data = (evenChars + oddChars).split('');\n\n for (let i = 0; i < data.length; i += 1) {\n if (isDigit(data[i])) {\n for (let ii = i + 1; ii < data.length; ii += 1) {\n if (isDigit(data[ii])) {\n // eslint-disable-next-line no-bitwise\n const temp = parseInt(data[i], 10) ^ parseInt(data[ii], 10);\n if (temp < 10) {\n data[i] = temp.toString();\n }\n i = ii;\n break;\n }\n }\n }\n }\n data = data.join('');\n const decodedURL = window.atob(data).slice(16, -16);\n /* eslint-disable compat/compat */\n if (window.stop) {\n window.stop();\n }\n /* eslint-enable compat/compat */\n window.onbeforeunload = null;\n window.location.href = decodedURL;\n };\n\n let val;\n // Do not apply handler more than one time\n let applyHandler = true;\n\n const result = setPropertyAccess(window, 'ysmm', {\n configurable: false,\n set: (value) => {\n if (applyHandler) {\n applyHandler = false;\n try {\n if (typeof value === 'string') {\n handler(value);\n }\n } catch (err) { } // eslint-disable-line no-empty\n }\n val = value;\n },\n get: () => val,\n });\n\n if (result) {\n hit(source);\n } else {\n window.console.error('Failed to set up prevent-adfly scriptlet');\n }\n}\n\npreventAdfly.names = [\n 'prevent-adfly',\n 'adfly-defuser.js',\n 'ubo-adfly-defuser.js',\n];\n\npreventAdfly.injections = [setPropertyAccess, hit];\n","import {\n randomId,\n setPropertyAccess,\n getPropertyInChain,\n createOnErrorHandler,\n hit,\n noopFunc,\n} from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet debug-on-property-read\n *\n * @description\n * This scriptlet is basically the same as [abort-on-property-read](#abort-on-property-read), but instead of aborting it starts the debugger.\n *\n * **It is not supposed to be used in production filter lists!**\n *\n * **Syntax**\n * ```\n * ! Aborts script when it tries to access `window.alert`\n * example.org#%#//scriptlet(\"debug-on-property-read\", \"alert\")\n * ```\n */\n/* eslint-enable max-len */\nexport function debugOnPropertyRead(source, property) {\n if (!property) {\n return;\n }\n const rid = randomId();\n const abort = () => {\n hit(source);\n // eslint-disable-next-line no-debugger\n debugger;\n };\n const setChainPropAccess = (owner, property) => {\n const chainInfo = getPropertyInChain(owner, property);\n let { base } = chainInfo;\n const { prop, chain } = chainInfo;\n if (chain) {\n const setter = (a) => {\n base = a;\n if (a instanceof Object) {\n setChainPropAccess(a, chain);\n }\n };\n Object.defineProperty(owner, prop, {\n get: () => base,\n set: setter,\n });\n return;\n }\n\n setPropertyAccess(base, prop, {\n get: abort,\n set: noopFunc,\n });\n };\n\n setChainPropAccess(window, property);\n\n window.onerror = createOnErrorHandler(rid)\n .bind();\n}\n\ndebugOnPropertyRead.names = [\n 'debug-on-property-read',\n];\ndebugOnPropertyRead.injections = [\n randomId,\n setPropertyAccess,\n getPropertyInChain,\n createOnErrorHandler,\n hit,\n noopFunc,\n];\n","import {\n randomId,\n setPropertyAccess,\n getPropertyInChain,\n createOnErrorHandler,\n hit,\n} from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet debug-on-property-write\n *\n * @description\n * This scriptlet is basically the same as [abort-on-property-write](#abort-on-property-write), but instead of aborting it starts the debugger.\n *\n * **It is not supposed to be used in production filter lists!**\n *\n * **Syntax**\n * ```\n * ! Aborts script when it tries to write in property `window.test`\n * example.org#%#//scriptlet(\"debug-on-property-write\", \"test\")\n * ```\n */\n/* eslint-enable max-len */\nexport function debugOnPropertyWrite(source, property) {\n if (!property) {\n return;\n }\n const rid = randomId();\n const abort = () => {\n hit(source);\n // eslint-disable-next-line no-debugger\n debugger;\n };\n const setChainPropAccess = (owner, property) => {\n const chainInfo = getPropertyInChain(owner, property);\n let { base } = chainInfo;\n const { prop, chain } = chainInfo;\n if (chain) {\n const setter = (a) => {\n base = a;\n if (a instanceof Object) {\n setChainPropAccess(a, chain);\n }\n };\n Object.defineProperty(owner, prop, {\n get: () => base,\n set: setter,\n });\n return;\n }\n\n setPropertyAccess(base, prop, { set: abort });\n };\n\n setChainPropAccess(window, property);\n\n window.onerror = createOnErrorHandler(rid).bind();\n}\n\ndebugOnPropertyWrite.names = [\n 'debug-on-property-write',\n];\n\ndebugOnPropertyWrite.injections = [\n randomId,\n setPropertyAccess,\n getPropertyInChain,\n createOnErrorHandler,\n hit,\n];\n","import {\n randomId,\n setPropertyAccess,\n getPropertyInChain,\n toRegExp,\n createOnErrorHandler,\n hit,\n} from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet debug-current-inline-script\n *\n * @description\n * This scriptlet is basically the same as [abort-current-inline-script](#abort-current-inline-script), but instead of aborting it starts the debugger.\n *\n * **It is not supposed to be used in production filter lists!**\n *\n * **Syntax**\n *```\n * ! Aborts script when it tries to access `window.alert`\n * example.org#%#//scriptlet(\"debug-current-inline-script\", \"alert\")\n * ```\n */\n/* eslint-enable max-len */\nexport function debugCurrentInlineScript(source, property, search = null) {\n const regex = search ? toRegExp(search) : null;\n const rid = randomId();\n\n const getCurrentScript = () => {\n if (!document.currentScript) { // eslint-disable-line compat/compat\n const scripts = document.getElementsByTagName('script');\n return scripts[scripts.length - 1];\n }\n return document.currentScript; // eslint-disable-line compat/compat\n };\n\n const ourScript = getCurrentScript();\n\n const abort = () => {\n const scriptEl = getCurrentScript();\n if (scriptEl instanceof HTMLScriptElement\n && scriptEl.textContent.length > 0\n && scriptEl !== ourScript\n && (!regex || regex.test(scriptEl.textContent))) {\n hit(source);\n // eslint-disable-next-line no-debugger\n debugger;\n }\n };\n\n const setChainPropAccess = (owner, property) => {\n const chainInfo = getPropertyInChain(owner, property);\n let { base } = chainInfo;\n const { prop, chain } = chainInfo;\n if (chain) {\n const setter = (a) => {\n base = a;\n if (a instanceof Object) {\n setChainPropAccess(a, chain);\n }\n };\n Object.defineProperty(owner, prop, {\n get: () => base,\n set: setter,\n });\n return;\n }\n\n let currentValue = base[prop];\n setPropertyAccess(base, prop, {\n set: (value) => {\n abort();\n currentValue = value;\n },\n get: () => {\n abort();\n return currentValue;\n },\n });\n };\n\n setChainPropAccess(window, property);\n\n window.onerror = createOnErrorHandler(rid)\n .bind();\n}\n\ndebugCurrentInlineScript.names = [\n 'debug-current-inline-script',\n];\n\ndebugCurrentInlineScript.injections = [\n randomId,\n setPropertyAccess,\n getPropertyInChain,\n toRegExp,\n createOnErrorHandler,\n hit,\n];\n","import { hit, observeDOMChanges } from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet remove-attr\n *\n * @description\n * Removes the specified attributes from DOM nodes. This scriptlet runs once when the page loads\n * and after that periodically in order to DOM tree changes.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#remove-attrjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet('remove-attr', attrs[, selector])\n * ```\n *\n * - `attrs` — required, attribute or list of attributes joined by '|';\n * - `selector` — optional, CSS selector, specifies DOM nodes from which the attributes will be removed\n *\n * **Examples**\n * 1. Removes by attribute\n * ```\n * example.org#%#//scriptlet('remove-attr', 'example|test')\n * ```\n *\n * ```html\n * \n *
Some text
\n *\n * \n *
Some text
\n * ```\n *\n * 2. Removes with specified selector\n * ```\n * example.org#%#//scriptlet('remove-attr', 'example', 'div[class=\"inner\"]')\n * ```\n *\n * ```html\n * \n *
\n *
Some text
\n *
\n *\n * \n *
\n *
Some text
\n *
\n * ```\n */\n/* eslint-enable max-len */\nexport function removeAttr(source, attrs, selector) {\n if (!attrs) { return; }\n attrs = attrs.split(/\\s*\\|\\s*/);\n if (!selector) {\n selector = `[${attrs.join('],[')}]`;\n }\n\n const rmattr = () => {\n const nodes = [].slice.call(document.querySelectorAll(selector));\n let removed = false;\n nodes.forEach((node) => {\n attrs.forEach((attr) => {\n node.removeAttribute(attr);\n removed = true;\n });\n });\n if (removed) {\n hit(source);\n }\n };\n\n rmattr();\n\n // 'true' for observing attributes\n observeDOMChanges(rmattr, true);\n}\n\nremoveAttr.names = [\n 'remove-attr',\n 'remove-attr.js',\n 'ubo-remove-attr.js',\n 'ra.js',\n 'ubo-ra.js',\n];\n\nremoveAttr.injections = [hit, observeDOMChanges];\n","import { hit, observeDOMChanges } from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet remove-class\n *\n * @description\n * Removes the specified classes from DOM nodes. This scriptlet runs once after the page loads\n * and after that periodically in order to DOM tree changes.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#remove-classjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet('remove-class', classes[, selector])\n * ```\n *\n * - `classes` — required, class or list of classes separated by '|';\n * - `selector` — optional, CSS selector, specifies DOM nodes from which the classes will be removed;\n * if there is no selector, every class independently will be removed from all nodes which has one\n *\n * **Examples**\n * 1. Removes by classes\n * ```\n * example.org#%#//scriptlet('remove-class', 'example|test')\n * ```\n *\n * ```html\n * \n *
Some text
\n *
Some text
\n *
Some text
\n *\n * \n *
Some text
\n *
Some text
\n *
Some text
\n * ```\n *\n * 2. Removes with specified selector\n * ```\n * example.org#%#//scriptlet('remove-class', 'branding', 'div[class^=\"inner\"]')\n * ```\n *\n * ```html\n * \n *
\n *
Some text
\n *
\n *\n * \n *
\n *
Some text
\n *
\n * ```\n */\n/* eslint-enable max-len */\n\n\nexport function removeClass(source, classNames, selector) {\n if (!classNames) { return; }\n classNames = classNames.split(/\\s*\\|\\s*/);\n let selectors = [];\n if (!selector) {\n selectors = classNames.map((className) => {\n return `.${className}`;\n });\n }\n\n const removeClassHandler = () => {\n const nodes = new Set();\n if (selector) {\n const foundedNodes = [].slice.call(document.querySelectorAll(selector));\n foundedNodes.forEach((n) => nodes.add(n));\n } else if (selectors.length > 0) {\n selectors.forEach((s) => {\n const elements = document.querySelectorAll(s);\n for (let i = 0; i < elements.length; i += 1) {\n const element = elements[i];\n nodes.add(element);\n }\n });\n }\n\n let removed = false;\n\n nodes.forEach((node) => {\n classNames.forEach((className) => {\n if (node.classList.contains(className)) {\n node.classList.remove(className);\n removed = true;\n }\n });\n });\n\n if (removed) {\n hit(source);\n }\n };\n\n removeClassHandler();\n\n const CLASS_ATTR_NAME = ['class'];\n // 'true' for observing attributes\n // 'class' for observing only classes\n observeDOMChanges(removeClassHandler, true, CLASS_ATTR_NAME);\n}\n\nremoveClass.names = [\n 'remove-class',\n 'remove-class.js',\n 'ubo-remove-class.js',\n 'rc.js',\n 'ubo-rc.js',\n];\n\nremoveClass.injections = [hit, observeDOMChanges];\n","import { hit } from '../helpers';\n\n/**\n * @scriptlet disable-newtab-links\n *\n * @description\n * Prevents opening new tabs and windows if there is `target` attribute in element.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#disable-newtab-linksjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"disable-newtab-links\")\n * ```\n */\nexport function disableNewtabLinks(source) {\n document.addEventListener('click', (ev) => {\n let { target } = ev;\n while (target !== null) {\n if (target.localName === 'a' && target.hasAttribute('target')) {\n ev.stopPropagation();\n ev.preventDefault();\n hit(source);\n break;\n }\n target = target.parentNode;\n }\n });\n}\n\ndisableNewtabLinks.names = [\n 'disable-newtab-links',\n 'disable-newtab-links.js',\n 'ubo-disable-newtab-links.js',\n];\n\ndisableNewtabLinks.injections = [\n hit,\n];\n","import { hit, toRegExp } from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet adjust-setInterval\n *\n * @description\n * Adjusts interval for specified setInterval() callbacks.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#nano-setinterval-boosterjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"adjust-setInterval\"[, match [, interval[, boost]]])\n * ```\n *\n * - `match` - optional, string/regular expression, matching in stringified callback function\n * - `interval` - optional, defaults to 1000, decimal integer, matching interval\n * - `boost` - optional, default to 0.05, float, capped at 50 times for up and down, interval multiplier\n *\n * **Examples**\n * 1. Adjust all setInterval() x20 times where interval equal 1000ms:\n * ```\n * example.org#%#//scriptlet(\"adjust-setInterval\")\n * ```\n *\n * 2. Adjust all setInterval() x20 times where callback mathed with `example` and interval equal 1000ms\n * ```\n * example.org#%#//scriptlet(\"adjust-setInterval\", \"example\")\n * ```\n *\n * 3. Adjust all setInterval() x20 times where callback mathed with `example` and interval equal 400ms\n * ```\n * example.org#%#//scriptlet(\"adjust-setInterval\", \"example\", \"400\")\n * ```\n *\n * 4. Slow down setInterval() x2 times where callback matched with `example` and interval equal 400ms\n * ```\n * example.org#%#//scriptlet(\"adjust-setInterval\", \"example\", \"400\", \"2\")\n * ```\n */\n/* eslint-enable max-len */\nexport function adjustSetInterval(source, match, interval, boost) {\n const nativeInterval = window.setInterval;\n const nativeIsNaN = Number.isNaN || window.isNaN; // eslint-disable-line compat/compat\n const nativeIsFinite = Number.isFinite || window.isFinite; // eslint-disable-line compat/compat\n\n interval = parseInt(interval, 10);\n interval = nativeIsNaN(interval) ? 1000 : interval;\n\n boost = parseInt(boost, 10);\n boost = nativeIsNaN(interval) || !nativeIsFinite(boost) ? 0.05 : boost;\n\n match = match ? toRegExp(match) : toRegExp('/.?/');\n\n if (boost < 0.02) {\n boost = 0.02;\n }\n if (boost > 50) {\n boost = 50;\n }\n\n const intervalWrapper = (cb, d, ...args) => {\n if (d === interval && match.test(cb.toString())) {\n d *= boost;\n hit(source);\n }\n return nativeInterval.apply(window, [cb, d, ...args]);\n };\n window.setInterval = intervalWrapper;\n}\n\nadjustSetInterval.names = [\n 'adjust-setInterval',\n 'nano-setInterval-booster.js',\n 'ubo-nano-setInterval-booster.js',\n 'nano-sib.js',\n 'ubo-nano-sib.js',\n];\n\nadjustSetInterval.injections = [toRegExp, hit];\n","import { hit, toRegExp } from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet adjust-setTimeout\n *\n * @description\n * Adjusts timeout for specified setTimout() callbacks.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#nano-settimeout-boosterjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"adjust-setTimeout\"[, match [, timeout[, boost]]])\n * ```\n *\n * - `match` - optional, string/regular expression, matching in stringified callback function\n * - `timeout` - optional, defaults to 1000, decimal integer, matching interval\n * - `boost` - optional, default to 0.05, float, capped at 50 times for up and down, interval multiplier\n *\n * **Examples**\n * 1. Adjust all setTimeout() x20 times where interval equal 1000ms:\n * ```\n * example.org#%#//scriptlet(\"adjust-setTimeout\")\n * ```\n *\n * 2. Adjust all setTimeout() x20 times where callback mathed with `example` and interval equal 1000ms\n * ```\n * example.org#%#//scriptlet(\"adjust-setTimeout\", \"example\")\n * ```\n *\n * 3. Adjust all setTimeout() x20 times where callback mathed with `example` and interval equal 400ms\n * ```\n * example.org#%#//scriptlet(\"adjust-setTimeout\", \"example\", \"400\")\n * ```\n *\n * 4. Slow down setTimeout() x2 times where callback matched with `example` and interval equal 400ms\n * ```\n * example.org#%#//scriptlet(\"adjust-setTimeout\", \"example\", \"400\", \"2\")\n * ```\n */\n/* eslint-enable max-len */\nexport function adjustSetTimeout(source, match, timeout, boost) {\n const nativeTimeout = window.setTimeout;\n const nativeIsNaN = Number.isNaN || window.isNaN; // eslint-disable-line compat/compat\n const nativeIsFinite = Number.isFinite || window.isFinite; // eslint-disable-line compat/compat\n\n timeout = parseInt(timeout, 10);\n timeout = nativeIsNaN(timeout) ? 1000 : timeout;\n\n boost = parseInt(boost, 10);\n boost = nativeIsNaN(timeout) || !nativeIsFinite(boost) ? 0.05 : boost;\n\n match = match ? toRegExp(match) : toRegExp('/.?/');\n\n if (boost < 0.02) {\n boost = 0.02;\n }\n if (boost > 50) {\n boost = 50;\n }\n\n const timeoutWrapper = (cb, d, ...args) => {\n if (d === timeout && match.test(cb.toString())) {\n d *= boost;\n hit(source);\n }\n return nativeTimeout.apply(window, [cb, d, ...args]);\n };\n window.setTimeout = timeoutWrapper;\n}\n\nadjustSetTimeout.names = [\n 'adjust-setTimeout',\n 'nano-setTimeout-booster.js',\n 'ubo-nano-setTimeout-booster.js',\n 'nano-stb.js',\n 'ubo-nano-stb.js',\n];\n\nadjustSetTimeout.injections = [toRegExp, hit];\n","import { hit } from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet dir-string\n *\n * @description\n * Wraps the `console.dir` API to call the `toString` method of the argument.\n * There are several adblock circumvention systems that detect browser devtools\n * and hide themselves. Therefore, if we force them to think\n * that devtools are open (using this scrciptlet),\n * it will automatically disable the adblock circumvention script.\n *\n * Related ABP source:\n * https://github.com/adblockplus/adblockpluscore/blob/6b2a309054cc23432102b85d13f12559639ef495/lib/content/snippets.js#L766\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"dir-string\"[, times])\n * ```\n * - `times` - optional, the number of times to call the `toString` method of the argument to `console.dir`\n *\n * **Example**\n * ```\n * ! Run 2 times\n * example.org#%#//scriptlet(\"dir-string\", \"2\")\n * ```\n */\n/* eslint-enable max-len */\nexport function dirString(source, times) {\n const { dir } = console;\n times = parseInt(times, 10);\n\n function dirWrapper(object) {\n // eslint-disable-next-line no-unused-vars\n let temp;\n for (let i = 0; i < times; i += 1) {\n // eslint-disable-next-line no-unused-expressions\n temp = `${object}`;\n }\n if (typeof dir === 'function') {\n dir.call(this, object);\n }\n hit(source, temp);\n }\n // eslint-disable-next-line no-console\n console.dir = dirWrapper;\n}\n\ndirString.names = [\n 'dir-string',\n 'abp-dir-string',\n];\n\ndirString.injections = [hit];\n","import { hit, getPropertyInChain } from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet json-prune\n *\n * @description\n * Removes specified properties from the result of calling JSON.parse and returns the caller\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"json-prune\"[, propsToRemove [, obligatoryProps]])\n * ```\n *\n * - `propsToRemove` - string of space-separated properties to remove\n * - `obligatoryProps` - optional, string of space-separated properties which must be all present for the pruning to occur\n *\n * **Examples**\n * 1. Removes property `example` from the results of JSON.parse call\n * ```\n * example.org#%#//scriptlet(\"json-prune\", \"example\")\n * ```\n *\n * For instance, the following call will return `{ one: 1}`\n *\n * ```html\n * JSON.parse('{\"one\":1,\"example\":true}')\n * ```\n *\n * 2. If there are no specified properties in the result of JSON.parse call, pruning will NOT occur\n * ```\n * example.org#%#//scriptlet(\"json-prune\", \"one\", \"obligatoryProp\")\n * ```\n *\n * For instance, the following call will return `{ one: 1, two: 2}`\n *\n * ```html\n * JSON.parse('{\"one\":1,\"two\":2}')\n * ```\n *\n * 3. A property in a list of properties can be a chain of properties\n *\n * ```\n * example.org#%#//scriptlet(\"json-prune\", \"a.b\", \"adpath.url.first\")\n * ```\n *\n * 4. Call with no arguments will log the current hostname and json payload at the console\n * ```\n * example.org#%#//scriptlet(\"json-prune\")\n * ```\n */\n/* eslint-enable max-len */\nexport function jsonPrune(source, propsToRemove, requiredInitialProps) {\n // eslint-disable-next-line no-console\n const log = console.log.bind(console);\n const prunePaths = propsToRemove !== undefined && propsToRemove !== ''\n ? propsToRemove.split(/ +/)\n : [];\n const needlePaths = requiredInitialProps !== undefined && requiredInitialProps !== ''\n ? requiredInitialProps.split(/ +/)\n : [];\n\n function isPruningNeeded(root) {\n if (!root) {\n return false;\n }\n\n for (let i = 0; i < needlePaths.length; i += 1) {\n const needlePath = needlePaths[i];\n const details = getPropertyInChain(root, needlePath, false);\n const nestedPropName = needlePath.split('.').pop();\n if (details && details.base[nestedPropName] === undefined) {\n return false;\n }\n }\n return true;\n }\n\n const nativeParse = JSON.parse;\n\n const parseWrapper = (...args) => {\n const r = nativeParse.apply(window, args);\n if (prunePaths.length === 0) {\n log(window.location.hostname, r);\n return r;\n }\n if (isPruningNeeded(r) === false) {\n return r;\n }\n prunePaths.forEach((path) => {\n const ownerObj = getPropertyInChain(r, path, false);\n if (ownerObj !== undefined && ownerObj.base) {\n delete ownerObj.base[ownerObj.prop];\n }\n });\n hit(source);\n return r;\n };\n\n JSON.parse = parseWrapper;\n}\n\n\njsonPrune.names = [\n 'json-prune',\n 'json-prune.js',\n 'ubo-json-prune.js',\n];\n\njsonPrune.injections = [hit, getPropertyInChain];\n","import {\n hit, startsWith, toRegExp, noopFunc,\n} from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet prevent-requestAnimationFrame\n *\n * @description\n * Prevents a `requestAnimationFrame` call\n * if the text of the callback is matching the specified search string which does not start with `!`;\n * otherwise mismatched calls should be defused.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#requestanimationframe-ifjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet('prevent-requestAnimationFrame'[, ])\n * ```\n *\n * **Parameters**\n *\n * - `search` (optional) string or regular expression.\n * If starts with `!`, scriptlet will not match the stringified callback but all other will be defused.\n * If do not start with `!`, the stringified callback will be matched.\n *\n * Call with no argument will log all requestAnimationFrame calls while debugging.\n * So do not use the scriptlet without any parameter in production filter lists.\n *\n * **Examples**\n *\n * 1. Prevents `requestAnimationFrame` calls if the callback matches `/\\.test/`.\n * ```bash\n * example.org#%#//scriptlet('prevent-requestAnimationFrame', '/\\.test/')\n * ```\n *\n * For instance, the following call will be prevented:\n * ```javascript\n * var times = 0;\n * requestAnimationFrame(function change() {\n * window.test = 'new value';\n * if (times < 2) {\n * times += 1;\n * requestAnimationFrame(change);\n * }\n * });\n * ```\n * 2. Prevents `requestAnimationFrame` calls if **does not match** 'check'.\n * ```bash\n * example.org#%#//scriptlet('prevent-requestAnimationFrame', '!check')\n * ```\n *\n * For instance, only the first call will be prevented:\n *\n * ```javascript\n * var timesFirst = 0;\n * requestAnimationFrame(function changeFirst() {\n * window.check = 'should not be prevented';\n * if (timesFirst < 2) {\n * timesFirst += 1;\n * requestAnimationFrame(changeFirst);\n * }\n * });\n *\n * var timesSecond = 0;\n * requestAnimationFrame(function changeSecond() {\n * window.second = 'should be prevented';\n * if (timesSecond < 2) {\n * timesSecond += 1;\n * requestAnimationFrame(changeSecond);\n * }\n * });\n * ```\n */\n/* eslint-enable max-len */\n\nexport function preventRequestAnimationFrame(source, match) {\n const nativeRequestAnimationFrame = window.requestAnimationFrame;\n\n // logs requestAnimationFrame to console if no arguments have been specified\n const shouldLog = typeof match === 'undefined';\n\n const INVERT_MARKER = '!';\n\n const doNotMatch = startsWith(match, INVERT_MARKER);\n if (doNotMatch) {\n match = match.slice(1);\n }\n\n match = match ? toRegExp(match) : toRegExp('/.?/');\n\n const rafWrapper = (callback, ...args) => {\n let shouldPrevent = false;\n if (shouldLog) {\n const logMessage = `log: requestAnimationFrame(\"${callback.toString()}\")`;\n hit(source, logMessage);\n } else {\n shouldPrevent = match.test(callback.toString()) !== doNotMatch;\n }\n\n if (shouldPrevent) {\n hit(source);\n return nativeRequestAnimationFrame(noopFunc);\n }\n\n return nativeRequestAnimationFrame.apply(window, [callback, ...args]);\n };\n\n window.requestAnimationFrame = rafWrapper;\n}\n\npreventRequestAnimationFrame.names = [\n 'prevent-requestAnimationFrame',\n 'requestAnimationFrame-if.js',\n 'ubo-requestAnimationFrame-if.js',\n 'raf-if.js',\n 'ubo-raf-if.js',\n];\n\npreventRequestAnimationFrame.injections = [hit, startsWith, toRegExp, noopFunc];\n","/**\n * This file must export all scriptlets which should be accessible\n */\nexport * from './abort-on-property-read';\nexport * from './abort-on-property-write';\nexport * from './prevent-setTimeout';\nexport * from './prevent-setInterval';\nexport * from './prevent-window-open';\nexport * from './abort-current-inline-script';\nexport * from './set-constant';\nexport * from './remove-cookie';\nexport * from './prevent-addEventListener';\nexport * from './prevent-bab';\nexport * from './nowebrtc';\nexport * from './log-addEventListener';\nexport * from './log-eval';\nexport * from './log';\nexport * from './noeval';\nexport * from './prevent-eval-if';\nexport * from './prevent-fab-3.2.0';\nexport * from './set-popads-dummy';\nexport * from './prevent-popads-net';\nexport * from './prevent-adfly';\nexport * from './debug-on-property-read';\nexport * from './debug-on-property-write';\nexport * from './debug-current-inline-script';\nexport * from './remove-attr';\nexport * from './remove-class';\nexport * from './disable-newtab-links';\nexport * from './adjust-setInterval';\nexport * from './adjust-setTimeout';\nexport * from './dir-string';\nexport * from './json-prune';\nexport * from './prevent-requestAnimationFrame';\n","import {\n startsWith,\n substringAfter,\n} from './string-utils';\n\nimport { ADG_SCRIPTLET_MASK } from './parse-rule';\n\nimport * as scriptletsList from '../scriptlets/scriptletsList';\n\nimport { redirects } from '../../scripts/compatibility-table.json';\n\nconst JS_RULE_MASK = '#%#';\nconst COMMENT_MARKER = '!';\n\n/**\n * Checks if rule text is comment e.g. !!example.org##+js(set-constant.js, test, false)\n * @param {string} rule\n * @return {boolean}\n */\nconst isComment = (rule) => startsWith(rule, COMMENT_MARKER);\n\n\n/* ************************************************************************\n *\n * Scriptlets\n *\n ************************************************************************** */\n\n\n/**\n * uBlock scriptlet rule mask\n */\nconst UBO_SCRIPTLET_MASK_REG = /#@?#script:inject|#@?#\\s*\\+js/;\nconst UBO_SCRIPTLET_MASK_1 = '##+js';\nconst UBO_SCRIPTLET_MASK_2 = '##script:inject';\nconst UBO_SCRIPTLET_EXCEPTION_MASK_1 = '#@#+js';\nconst UBO_SCRIPTLET_EXCEPTION_MASK_2 = '#@#script:inject';\n\n/**\n * AdBlock Plus snippet rule mask\n */\nconst ABP_SCRIPTLET_MASK = '#$#';\nconst ABP_SCRIPTLET_EXCEPTION_MASK = '#@$#';\n\n/**\n * AdGuard CSS rule mask\n */\nconst ADG_CSS_MASK_REG = /#@?\\$#.+?\\s*\\{.*\\}\\s*$/g;\n\n\n/**\n * Checks if the `rule` is AdGuard scriptlet rule\n * @param {string} rule - rule text\n */\nconst isAdgScriptletRule = (rule) => {\n return (\n !isComment(rule)\n && rule.indexOf(ADG_SCRIPTLET_MASK) > -1\n );\n};\n\n/**\n * Checks if the `rule` is uBO scriptlet rule\n * @param {string} rule rule text\n */\nconst isUboScriptletRule = (rule) => {\n return (\n rule.indexOf(UBO_SCRIPTLET_MASK_1) > -1\n || rule.indexOf(UBO_SCRIPTLET_MASK_2) > -1\n || rule.indexOf(UBO_SCRIPTLET_EXCEPTION_MASK_1) > -1\n || rule.indexOf(UBO_SCRIPTLET_EXCEPTION_MASK_2) > -1\n )\n && UBO_SCRIPTLET_MASK_REG.test(rule)\n && !isComment(rule);\n};\n\n/**\n * Checks if the `rule` is AdBlock Plus snippet\n * @param {string} rule rule text\n */\nconst isAbpSnippetRule = (rule) => {\n return (\n rule.indexOf(ABP_SCRIPTLET_MASK) > -1\n || rule.indexOf(ABP_SCRIPTLET_EXCEPTION_MASK) > -1\n )\n && rule.search(ADG_CSS_MASK_REG) === -1\n && !isComment(rule);\n};\n\n/**\n * Finds scriptlet by it's name\n * @param {string} name - scriptlet name\n */\nconst getScriptletByName = (name) => {\n const scriptlets = Object.keys(scriptletsList).map((key) => scriptletsList[key]);\n return scriptlets\n .find((s) => s.names && s.names.indexOf(name) > -1);\n};\n\n/**\n * Checks if the scriptlet name is valid\n * @param {string} name - Scriptlet name\n */\nconst isValidScriptletName = (name) => {\n if (!name) {\n return false;\n }\n const scriptlet = getScriptletByName(name);\n if (!scriptlet) {\n return false;\n }\n return true;\n};\n\n/* ************************************************************************\n *\n * Redirects\n *\n ************************************************************************** */\n\n/**\n * Redirect resources markers\n */\nconst ADG_UBO_REDIRECT_MARKER = 'redirect=';\nconst ABP_REDIRECT_MARKER = 'rewrite=abp-resource:';\n\nconst VALID_SOURCE_TYPES = [\n 'image',\n 'subdocument',\n 'stylesheet',\n 'script',\n 'xmlhttprequest',\n 'media',\n];\n\nconst validAdgRedirects = redirects.filter((el) => el.adg);\n\n/**\n * Converts array of pairs to object.\n * Sort of Object.fromEntries() polyfill.\n * @param {Array} pairs - array of pairs\n * @returns {Object}\n */\nconst objFromEntries = (pairs) => {\n const output = pairs\n .reduce((acc, el) => {\n const [key, value] = el;\n acc[key] = value;\n return acc;\n }, {});\n return output;\n};\n\n/**\n * Compatibility object where KEYS = UBO redirect names and VALUES = ADG redirect names\n * It's used for UBO -> ADG converting\n */\nconst uboToAdgCompatibility = objFromEntries(\n validAdgRedirects\n .filter((el) => el.ubo)\n .map((el) => {\n return [el.ubo, el.adg];\n }),\n);\n\n/**\n * Compatibility object where KEYS = ABP redirect names and VALUES = ADG redirect names\n * It's used for ABP -> ADG converting\n */\nconst abpToAdgCompatibility = objFromEntries(\n validAdgRedirects\n .filter((el) => el.abp)\n .map((el) => {\n return [el.abp, el.adg];\n }),\n);\n\n/**\n * Compatibility object where KEYS = UBO redirect names and VALUES = ADG redirect names\n * It's used for ADG -> UBO converting\n */\nconst adgToUboCompatibility = objFromEntries(\n validAdgRedirects\n .filter((el) => el.ubo)\n .map((el) => {\n return [el.adg, el.ubo];\n }),\n);\n\n/**\n * Needed for AdGuard redirect names validation where KEYS = **valid** AdGuard redirect names\n * 'adgToUboCompatibility' is still needed for ADG -> UBO converting\n */\nconst validAdgCompatibility = objFromEntries(\n validAdgRedirects\n .map((el) => {\n return [el.adg, 'valid adg redirect'];\n }),\n);\n\nconst REDIRECT_RULE_TYPES = {\n VALID_ADG: {\n marker: ADG_UBO_REDIRECT_MARKER,\n compatibility: validAdgCompatibility,\n },\n ADG: {\n marker: ADG_UBO_REDIRECT_MARKER,\n compatibility: adgToUboCompatibility,\n },\n UBO: {\n marker: ADG_UBO_REDIRECT_MARKER,\n compatibility: uboToAdgCompatibility,\n },\n ABP: {\n marker: ABP_REDIRECT_MARKER,\n compatibility: abpToAdgCompatibility,\n },\n};\n\n/**\n * Parses redirect rule modifiers\n * @param {string} rule\n * @returns {Array}\n */\nconst parseModifiers = (rule) => substringAfter(rule, '$').split(',');\n\n/**\n * Gets redirect resource name\n * @param {string} rule\n * @param {string} marker - specific Adg/Ubo or Abp redirect resources marker\n * @returns {string} - redirect resource name\n */\nconst getRedirectName = (rule, marker) => {\n const ruleModifiers = parseModifiers(rule);\n const redirectNamePart = ruleModifiers\n .find((el) => el.indexOf(marker) > -1);\n return substringAfter(redirectNamePart, marker);\n};\n\n\n/**\n * Checks if the `rule` is AdGuard redirect rule.\n * Discards comments and JS rules and checks if the `rule` has 'redirect' modifier.\n * @param {string} rule - rule text\n */\nconst isAdgRedirectRule = (rule) => {\n return (\n !isComment(rule)\n // some js rules may have 'redirect=' in it, so we should get rid of them\n && !rule.indexOf(JS_RULE_MASK) > -1\n && rule.indexOf(REDIRECT_RULE_TYPES.ADG.marker) > -1\n );\n};\n\n/**\n * Checks if the `rule` satisfies the `type`\n * @param {string} rule - rule text\n * @param {'VALID_ADG'|'ADG'|'UBO'|'ABP'} type - type of a redirect rule\n */\nconst isRedirectRuleByType = (rule, type) => {\n const { marker, compatibility } = REDIRECT_RULE_TYPES[type];\n\n if (rule\n && (!isComment(rule))\n && (rule.indexOf(marker) > -1)) {\n const redirectName = getRedirectName(rule, marker);\n\n return redirectName === Object\n .keys(compatibility)\n .find((el) => el === redirectName);\n }\n return false;\n};\n\n/**\n* Checks if the `rule` is **valid** AdGuard redirect resource rule\n* @param {string} rule - rule text\n* @returns {boolean}\n*/\nconst isValidAdgRedirectRule = (rule) => {\n return isRedirectRuleByType(rule, 'VALID_ADG');\n};\n\n\n/**\n* Checks if the AdGuard redirect `rule` has Ubo analog. Needed for Adg->Ubo conversion\n* @param {string} rule - AdGuard rule text\n* @returns {boolean} - true if the rule can be converted to Ubo\n*/\nconst isAdgRedirectCompatibleWithUbo = (rule) => {\n return isRedirectRuleByType(rule, 'ADG');\n};\n\n/**\n* Checks if the Ubo redirect `rule` has AdGuard analog. Needed for Ubo->Adg conversion\n* @param {string} rule - Ubo rule text\n* @returns {boolean} - true if the rule can be converted to AdGuard\n*/\nconst isUboRedirectCompatibleWithAdg = (rule) => {\n return isRedirectRuleByType(rule, 'UBO');\n};\n\n/**\n* Checks if the Abp redirect `rule` has AdGuard analog. Needed for Abp->Adg conversion\n* @param {string} rule - Abp rule text\n* @returns {boolean} - true if the rule can be converted to AdGuard\n*/\nconst isAbpRedirectCompatibleWithAdg = (rule) => {\n return isRedirectRuleByType(rule, 'ABP');\n};\n\n\n/**\n * Checks if the rule has specified content type before Adg -> Ubo conversion.\n *\n * Used ONLY for Adg -> Ubo conversion\n * because Ubo redirect rules must contain content type, but Adg and Abp must not.\n *\n * Also source type can not be added automatically because of such valid rules:\n * ! Abp:\n * $rewrite=abp-resource:blank-js,xmlhttprequest\n * ! Adg:\n * $script,redirect=noopvast-2.0\n * $xmlhttprequest,redirect=noopvast-2.0\n *\n * @param {string} rule\n * @returns {boolean}\n */\nconst hasValidContentType = (rule) => {\n if (isRedirectRuleByType(rule, 'ADG')) {\n const ruleModifiers = parseModifiers(rule);\n const sourceType = ruleModifiers\n .find((el) => VALID_SOURCE_TYPES.indexOf(el) > -1);\n\n return sourceType !== undefined;\n }\n return false;\n};\n\nconst validator = {\n UBO_SCRIPTLET_MASK_REG,\n ABP_SCRIPTLET_MASK,\n ABP_SCRIPTLET_EXCEPTION_MASK,\n isComment,\n isAdgScriptletRule,\n isUboScriptletRule,\n isAbpSnippetRule,\n getScriptletByName,\n isValidScriptletName,\n REDIRECT_RULE_TYPES,\n isAdgRedirectRule,\n isValidAdgRedirectRule,\n isAdgRedirectCompatibleWithUbo,\n isUboRedirectCompatibleWithAdg,\n isAbpRedirectCompatibleWithAdg,\n parseModifiers,\n getRedirectName,\n hasValidContentType,\n};\n\nexport default validator;\n","function _iterableToArray(iter) {\n if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter);\n}\n\nmodule.exports = _iterableToArray;","var arrayWithHoles = require(\"./arrayWithHoles\");\n\nvar iterableToArray = require(\"./iterableToArray\");\n\nvar nonIterableRest = require(\"./nonIterableRest\");\n\nfunction _toArray(arr) {\n return arrayWithHoles(arr) || iterableToArray(arr) || nonIterableRest();\n}\n\nmodule.exports = _toArray;","import {\n getBeforeRegExp,\n substringAfter,\n substringBefore,\n wrapInSingleQuotes,\n getStringInBraces,\n} from './string-utils';\n\nimport validator from './validator';\n\nimport { parseRule } from './parse-rule';\n\nimport * as scriptletList from '../scriptlets/scriptletsList';\n\n/**\n * AdGuard scriptlet rule\n */\nconst ADGUARD_SCRIPTLET_MASK_REG = /#@?%#\\/\\/scriptlet\\(.+\\)/;\n// eslint-disable-next-line no-template-curly-in-string\nconst ADGUARD_SCRIPTLET_TEMPLATE = '${domains}#%#//scriptlet(${args})';\n// eslint-disable-next-line no-template-curly-in-string\nconst ADGUARD_SCRIPTLET_EXCEPTION_TEMPLATE = '${domains}#@%#//scriptlet(${args})';\n\n/**\n * uBlock scriptlet rule mask\n */\n// eslint-disable-next-line no-template-curly-in-string\nconst UBO_SCRIPTLET_TEMPLATE = '${domains}##+js(${args})';\n// eslint-disable-next-line no-template-curly-in-string\nconst UBO_SCRIPTLET_EXCEPTION_TEMPLATE = '${domains}#@#+js(${args})';\n\nconst UBO_ALIAS_NAME_MARKER = 'ubo-';\n\n// https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#xhr\nconst UBO_XHR_TYPE = 'xhr';\n\nconst ADG_XHR_TYPE = 'xmlhttprequest';\n\n\n/**\n * Returns array of strings separated by space which not in quotes\n * @param {string} str\n */\nconst getSentences = (str) => {\n const reg = /'.*?'|\".*?\"|\\S+/g;\n return str.match(reg);\n};\n\n/**\n * Replaces string with data by placeholders\n * @param {string} str\n * @param {Object} data - where keys are placeholders names\n */\nconst replacePlaceholders = (str, data) => {\n return Object.keys(data).reduce((acc, key) => {\n const reg = new RegExp(`\\\\$\\\\{${key}\\\\}`, 'g');\n acc = acc.replace(reg, data[key]);\n return acc;\n }, str);\n};\n\n/**\n * Converts string of UBO scriptlet rule to AdGuard scritlet rule\n * @param {string} rule - UBO scriptlet rule\n * @returns {Array} - array with one AdGuard scriptlet rule\n */\nexport const convertUboScriptletToAdg = (rule) => {\n const domains = getBeforeRegExp(rule, validator.UBO_SCRIPTLET_MASK_REG);\n const mask = rule.match(validator.UBO_SCRIPTLET_MASK_REG)[0];\n let template;\n if (mask.indexOf('@') > -1) {\n template = ADGUARD_SCRIPTLET_EXCEPTION_TEMPLATE;\n } else {\n template = ADGUARD_SCRIPTLET_TEMPLATE;\n }\n const args = getStringInBraces(rule)\n .split(/, /g)\n .map((arg, index) => {\n let outputArg;\n if (index === 0) {\n outputArg = (arg.indexOf('.js') > -1) ? `ubo-${arg}` : `ubo-${arg}.js`;\n } else {\n outputArg = arg;\n }\n // for example: dramaserial.xyz##+js(abort-current-inline-script, $, popup)\n if (arg === '$') {\n outputArg = '$$';\n }\n return outputArg;\n })\n .map((arg) => wrapInSingleQuotes(arg))\n .join(', ');\n const adgRule = replacePlaceholders(\n template,\n { domains, args },\n );\n return [adgRule];\n};\n\n/**\n * Convert string of ABP snippet rule to AdGuard scritlet rule\n * @param {string} rule - ABP snippet rule\n * @returns {Array} - array of AdGuard scriptlet rules -\n * one or few items depends on Abp-rule\n */\nexport const convertAbpSnippetToAdg = (rule) => {\n const SEMICOLON_DIVIDER = /;(?=(?:(?:[^\"]*\"){2})*[^\"]*$)/g;\n const mask = rule.indexOf(validator.ABP_SCRIPTLET_MASK) > -1\n ? validator.ABP_SCRIPTLET_MASK\n : validator.ABP_SCRIPTLET_EXCEPTION_MASK;\n const template = mask === validator.ABP_SCRIPTLET_MASK\n ? ADGUARD_SCRIPTLET_TEMPLATE\n : ADGUARD_SCRIPTLET_EXCEPTION_TEMPLATE;\n const domains = substringBefore(rule, mask);\n const args = substringAfter(rule, mask);\n\n return args.split(SEMICOLON_DIVIDER)\n .map((args) => getSentences(args)\n .filter((arg) => arg)\n .map((arg, index) => (index === 0 ? `abp-${arg}` : arg))\n .map((arg) => wrapInSingleQuotes(arg))\n .join(', '))\n .map((args) => replacePlaceholders(template, { domains, args }));\n};\n\n/**\n * Converts scriptlet rule to AdGuard one\n * @param {string} rule\n * @returns {Array} - array of AdGuard scriptlet rules -\n * one item for Adg and Ubo or few items for Abp\n */\nexport const convertScriptletToAdg = (rule) => {\n let result;\n if (validator.isUboScriptletRule(rule)) {\n result = convertUboScriptletToAdg(rule);\n } else if (validator.isAbpSnippetRule(rule)) {\n result = convertAbpSnippetToAdg(rule);\n } else if (validator.isAdgScriptletRule(rule) || (validator.isComment(rule))) {\n result = [rule];\n }\n\n return result;\n};\n\n/**\n * Converts UBO scriptlet rule to AdGuard one\n * @param {string} rule - AdGuard scriptlet rule\n * @returns {string} - UBO scriptlet rule\n */\nexport const convertAdgScriptletToUbo = (rule) => {\n let res;\n\n if (validator.isAdgScriptletRule(rule)) {\n const { name: parsedName, args: parsedParams } = parseRule(rule);\n\n // object of name and aliases for the Adg-scriptlet\n const adgScriptletObject = Object\n .keys(scriptletList)\n .map((el) => scriptletList[el])\n .map((s) => {\n const [name, ...aliases] = s.names;\n return { name, aliases };\n })\n .find((el) => (el.name === parsedName\n || el.aliases.indexOf(parsedName) >= 0));\n\n const { aliases } = adgScriptletObject;\n\n if (aliases.length > 0) {\n const uboAlias = adgScriptletObject.aliases\n // eslint-disable-next-line no-restricted-properties\n .find((alias) => alias.includes(UBO_ALIAS_NAME_MARKER));\n\n if (uboAlias) {\n const mask = rule.match(ADGUARD_SCRIPTLET_MASK_REG)[0];\n let template;\n if (mask.indexOf('@') > -1) {\n template = UBO_SCRIPTLET_EXCEPTION_TEMPLATE;\n } else {\n template = UBO_SCRIPTLET_TEMPLATE;\n }\n const domains = getBeforeRegExp(rule, ADGUARD_SCRIPTLET_MASK_REG);\n const uboName = uboAlias\n .replace(UBO_ALIAS_NAME_MARKER, '')\n // '.js' in the Ubo scriptlet name can be omitted\n // https://github.com/gorhill/uBlock/wiki/Resources-Library#general-purpose-scriptlets\n .replace('.js', '');\n\n const args = (parsedParams.length > 0) ? `${uboName}, ${parsedParams.join(', ')}` : uboName;\n\n const uboRule = replacePlaceholders(\n template,\n { domains, args },\n );\n\n res = uboRule;\n }\n }\n }\n\n return res;\n};\n\n/**\n * Validates any scriptlet rule\n * @param {string} input - can be Adguard or Ubo or Abp scriptlet rule\n */\nexport const isValidScriptletRule = (input) => {\n if (!input) {\n return false;\n }\n // ABP 'input' rule may contain more than one snippet\n const rulesArray = convertScriptletToAdg(input);\n\n // checking if each of parsed scriptlets is valid\n // if at least one of them is not valid - whole 'input' rule is not valid too\n const isValid = rulesArray.reduce((acc, rule) => {\n const parsedRule = parseRule(rule);\n return validator.isValidScriptletName(parsedRule.name) && acc;\n }, true);\n\n return isValid;\n};\n\n\n/**\n * Converts Ubo redirect rule to Adg one\n * @param {string} rule\n * @returns {string}\n */\nexport const convertUboRedirectToAdg = (rule) => {\n const firstPartOfRule = substringBefore(rule, '$');\n const uboModifiers = validator.parseModifiers(rule);\n const adgModifiers = uboModifiers\n .map((el) => {\n if (el.indexOf(validator.REDIRECT_RULE_TYPES.UBO.marker) > -1) {\n const uboName = substringAfter(el, validator.REDIRECT_RULE_TYPES.UBO.marker);\n const adgName = validator.REDIRECT_RULE_TYPES.UBO.compatibility[uboName];\n return `${validator.REDIRECT_RULE_TYPES.ADG.marker}${adgName}`;\n }\n if (el === UBO_XHR_TYPE) {\n return ADG_XHR_TYPE;\n }\n return el;\n })\n .join(',');\n\n return `${firstPartOfRule}$${adgModifiers}`;\n};\n\n/**\n * Converts Abp redirect rule to Adg one\n * @param {string} rule\n * @returns {string}\n */\nexport const convertAbpRedirectToAdg = (rule) => {\n const firstPartOfRule = substringBefore(rule, '$');\n const abpModifiers = validator.parseModifiers(rule);\n const adgModifiers = abpModifiers\n .map((el) => {\n if (el.indexOf(validator.REDIRECT_RULE_TYPES.ABP.marker) > -1) {\n const abpName = substringAfter(el, validator.REDIRECT_RULE_TYPES.ABP.marker);\n const adgName = validator.REDIRECT_RULE_TYPES.ABP.compatibility[abpName];\n return `${validator.REDIRECT_RULE_TYPES.ADG.marker}${adgName}`;\n }\n return el;\n })\n .join(',');\n\n return `${firstPartOfRule}$${adgModifiers}`;\n};\n\n/**\n * Converts redirect rule to AdGuard one\n * @param {string} rule\n * @returns {string}\n */\nexport const convertRedirectToAdg = (rule) => {\n let result;\n if (validator.isUboRedirectCompatibleWithAdg(rule)) {\n result = convertUboRedirectToAdg(rule);\n } else if (validator.isAbpRedirectCompatibleWithAdg(rule)) {\n result = convertAbpRedirectToAdg(rule);\n } else if (validator.isValidAdgRedirectRule(rule)) {\n result = rule;\n }\n\n return result;\n};\n\n/**\n * Converts Adg redirect rule to Ubo one\n * @param {string} rule\n * @returns {string}\n */\nexport const convertAdgRedirectToUbo = (rule) => {\n if (!validator.hasValidContentType(rule)) {\n throw new Error(`Rule is not valid for converting to Ubo. Source type is not specified in the rule: ${rule}`);\n } else {\n const firstPartOfRule = substringBefore(rule, '$');\n const uboModifiers = validator.parseModifiers(rule);\n const adgModifiers = uboModifiers\n .map((el) => {\n if (el.indexOf(validator.REDIRECT_RULE_TYPES.ADG.marker) > -1) {\n const adgName = substringAfter(el, validator.REDIRECT_RULE_TYPES.ADG.marker);\n const uboName = validator.REDIRECT_RULE_TYPES.ADG.compatibility[adgName];\n return `${validator.REDIRECT_RULE_TYPES.UBO.marker}${uboName}`;\n }\n return el;\n })\n .join(',');\n\n return `${firstPartOfRule}$${adgModifiers}`;\n }\n};\n","import {\n hit, noopFunc, noopNull, noopArray,\n} from '../helpers';\n\n/**\n * @redirect google-analytics\n *\n * @description\n * Mocks Google Analytics API.\n *\n * Related UBO redirect resource:\n * https://github.com/gorhill/uBlock/blob/a94df7f3b27080ae2dcb3b914ace39c0c294d2f6/src/web_accessible_resources/google-analytics_analytics.js\n *\n * **Example**\n * ```\n * ||google-analytics.com/analytics.js$script,redirect=google-analytics\n * ```\n */\nexport function GoogleAnalytics(source) {\n // eslint-disable-next-line func-names\n const Tracker = function () { }; // constructor\n const proto = Tracker.prototype;\n proto.get = noopFunc;\n proto.set = noopFunc;\n proto.send = noopFunc;\n\n const googleAnalyticsName = window.GoogleAnalyticsObject || 'ga';\n function ga() {\n const len = arguments.length;\n if (len === 0) {\n return;\n }\n // eslint-disable-next-line prefer-rest-params\n const lastArg = arguments[len - 1];\n if (typeof lastArg !== 'object'\n || lastArg === null\n || typeof lastArg.hitCallback !== 'function'\n ) {\n return;\n }\n\n try {\n lastArg.hitCallback();\n // eslint-disable-next-line no-empty\n } catch (ex) { }\n }\n\n ga.create = () => new Tracker();\n ga.getByName = noopNull;\n ga.getAll = noopArray;\n ga.remove = noopFunc;\n ga.loaded = true;\n window[googleAnalyticsName] = ga;\n\n const { dataLayer } = window;\n if (dataLayer instanceof Object\n && dataLayer.hide instanceof Object\n && typeof dataLayer.hide.end === 'function'\n ) {\n dataLayer.hide.end();\n }\n\n hit(source);\n}\n\nGoogleAnalytics.names = [\n 'google-analytics',\n 'ubo-google-analytics_analytics.js',\n 'google-analytics_analytics.js',\n];\n\nGoogleAnalytics.injections = [\n hit,\n noopFunc,\n noopNull,\n noopArray,\n];\n","/* eslint-disable no-underscore-dangle */\nimport { hit, noopFunc } from '../helpers';\n\n/**\n * @redirect google-analytics-ga\n *\n * @description\n * Mocks old Google Analytics API.\n *\n * Related UBO redirect resource:\n * https://github.com/gorhill/uBlock/blob/a94df7f3b27080ae2dcb3b914ace39c0c294d2f6/src/web_accessible_resources/google-analytics_ga.js\n *\n * **Example**\n * ```\n * ||google-analytics.com/ga.js$script,redirect=google-analytics-ga\n * ```\n */\nexport function GoogleAnalyticsGa(source) {\n // Gaq constructor\n function Gaq() { }\n\n Gaq.prototype.Na = noopFunc;\n Gaq.prototype.O = noopFunc;\n Gaq.prototype.Sa = noopFunc;\n Gaq.prototype.Ta = noopFunc;\n Gaq.prototype.Va = noopFunc;\n Gaq.prototype._createAsyncTracker = noopFunc;\n Gaq.prototype._getAsyncTracker = noopFunc;\n Gaq.prototype._getPlugin = noopFunc;\n Gaq.prototype.push = (data) => {\n if (typeof data === 'function') {\n data();\n return;\n }\n if (Array.isArray(data) === false) {\n return;\n }\n // https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiDomainDirectory#_gat.GA_Tracker_._link\n if (data[0] === '_link' && typeof data[1] === 'string') {\n window.location.assign(data[1]);\n }\n // https://github.com/gorhill/uBlock/issues/2162\n if (data[0] === '_set' && data[1] === 'hitCallback' && typeof data[2] === 'function') {\n data[2]();\n }\n };\n\n const gaq = new Gaq();\n const asyncTrackers = window._gaq || [];\n if (Array.isArray(asyncTrackers)) {\n while (asyncTrackers[0]) {\n gaq.push(asyncTrackers.shift());\n }\n }\n // eslint-disable-next-line no-multi-assign\n window._gaq = gaq.qf = gaq;\n\n\n // Gat constructor\n function Gat() { }\n\n // Mock tracker api\n const api = [\n '_addIgnoredOrganic', '_addIgnoredRef', '_addItem', '_addOrganic',\n '_addTrans', '_clearIgnoredOrganic', '_clearIgnoredRef', '_clearOrganic',\n '_cookiePathCopy', '_deleteCustomVar', '_getName', '_setAccount',\n '_getAccount', '_getClientInfo', '_getDetectFlash', '_getDetectTitle',\n '_getLinkerUrl', '_getLocalGifPath', '_getServiceMode', '_getVersion',\n '_getVisitorCustomVar', '_initData', '_link', '_linkByPost',\n '_setAllowAnchor', '_setAllowHash', '_setAllowLinker', '_setCampContentKey',\n '_setCampMediumKey', '_setCampNameKey', '_setCampNOKey', '_setCampSourceKey',\n '_setCampTermKey', '_setCampaignCookieTimeout', '_setCampaignTrack', '_setClientInfo',\n '_setCookiePath', '_setCookiePersistence', '_setCookieTimeout', '_setCustomVar',\n '_setDetectFlash', '_setDetectTitle', '_setDomainName', '_setLocalGifPath',\n '_setLocalRemoteServerMode', '_setLocalServerMode', '_setReferrerOverride', '_setRemoteServerMode',\n '_setSampleRate', '_setSessionTimeout', '_setSiteSpeedSampleRate', '_setSessionCookieTimeout',\n '_setVar', '_setVisitorCookieTimeout', '_trackEvent', '_trackPageLoadTime',\n '_trackPageview', '_trackSocial', '_trackTiming', '_trackTrans',\n '_visitCode',\n ];\n const tracker = api.reduce((res, funcName) => {\n res[funcName] = noopFunc;\n return res;\n }, {});\n tracker._getLinkerUrl = (a) => a;\n\n Gat.prototype._anonymizeIP = noopFunc;\n Gat.prototype._createTracker = noopFunc;\n Gat.prototype._forceSSL = noopFunc;\n Gat.prototype._getPlugin = noopFunc;\n Gat.prototype._getTracker = () => tracker;\n Gat.prototype._getTrackerByName = () => tracker;\n Gat.prototype._getTrackers = noopFunc;\n Gat.prototype.aa = noopFunc;\n Gat.prototype.ab = noopFunc;\n Gat.prototype.hb = noopFunc;\n Gat.prototype.la = noopFunc;\n Gat.prototype.oa = noopFunc;\n Gat.prototype.pa = noopFunc;\n Gat.prototype.u = noopFunc;\n\n const gat = new Gat();\n window._gat = gat;\n\n hit(source);\n}\n\nGoogleAnalyticsGa.names = [\n 'google-analytics-ga',\n 'ubo-google-analytics_ga.js',\n 'google-analytics_ga.js',\n];\n\nGoogleAnalyticsGa.injections = [hit, noopFunc];\n","import { hit } from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @redirect googlesyndication-adsbygoogle\n *\n * @description\n * Mocks Google AdSense API.\n *\n * Related UBO redirect resource:\n * https://github.com/gorhill/uBlock/blob/a94df7f3b27080ae2dcb3b914ace39c0c294d2f6/src/web_accessible_resources/googlesyndication_adsbygoogle.js\n *\n * **Example**\n * ```\n * ||pagead2.googlesyndication.com/pagead/js/adsbygoogle.js$script,redirect=googlesyndication-adsbygoogle\n * ```\n */\n/* eslint-enable max-len */\nexport function GoogleSyndicationAdsByGoogle(source) {\n window.adsbygoogle = window.adsbygoogle || {\n length: 0,\n loaded: true,\n push() {\n this.length += 1;\n },\n };\n const adElems = document.querySelectorAll('.adsbygoogle');\n const css = 'height:1px!important;max-height:1px!important;max-width:1px!important;width:1px!important;';\n let executed = false;\n for (let i = 0; i < adElems.length; i += 1) {\n adElems[i].setAttribute('data-adsbygoogle-status', 'done');\n\n const aswiftIframe = document.createElement('iframe');\n aswiftIframe.id = `aswift_${i + 1}`;\n aswiftIframe.style = css;\n adElems[i].appendChild(aswiftIframe);\n\n const googleadsIframe = document.createElement('iframe');\n googleadsIframe.id = `google_ads_iframe_${i}`;\n googleadsIframe.style = css;\n adElems[i].appendChild(googleadsIframe);\n\n executed = true;\n }\n\n if (executed) {\n hit(source);\n }\n}\n\nGoogleSyndicationAdsByGoogle.names = [\n 'googlesyndication-adsbygoogle',\n 'ubo-googlesyndication_adsbygoogle.js',\n 'googlesyndication_adsbygoogle.js',\n];\n\nGoogleSyndicationAdsByGoogle.injections = [\n hit,\n];\n","import { hit, noopFunc } from '../helpers';\n\n/**\n * @redirect googletagmanager-gtm\n *\n * @description\n * Mocks Google Tag Manager API.\n *\n * Related UBO redirect resource:\n * https://github.com/gorhill/uBlock/blob/a94df7f3b27080ae2dcb3b914ace39c0c294d2f6/src/web_accessible_resources/googletagmanager_gtm.js\n *\n * **Example**\n * ```\n * ||googletagmanager.com/gtm.js$script,redirect=googletagmanager-gtm\n * ```\n */\nexport function GoogleTagManagerGtm(source) {\n window.ga = window.ga || noopFunc;\n const { dataLayer } = window;\n if (dataLayer instanceof Object === false) {\n return;\n }\n\n if (dataLayer.hide instanceof Object && typeof dataLayer.hide.end === 'function') {\n dataLayer.hide.end();\n }\n\n if (typeof dataLayer.push === 'function') {\n dataLayer.push = (data) => {\n if (data instanceof Object && typeof data.eventCallback === 'function') {\n setTimeout(data.eventCallback, 1);\n }\n };\n }\n\n hit(source);\n}\n\nGoogleTagManagerGtm.names = [\n 'googletagmanager-gtm',\n 'ubo-googletagmanager_gtm.js',\n 'googletagmanager_gtm.js',\n];\n\nGoogleTagManagerGtm.injections = [hit, noopFunc];\n","import {\n hit, noopFunc, noopThis, noopNull, noopArray, noopStr,\n} from '../helpers';\n\n/**\n * @redirect googletagservices-gpt\n *\n * @description\n * Mocks Google Publisher Tag API.\n *\n * Related UBO redirect resource:\n * https://github.com/gorhill/uBlock/blob/a94df7f3b27080ae2dcb3b914ace39c0c294d2f6/src/web_accessible_resources/googletagservices_gpt.js\n *\n * **Example**\n * ```\n * ||googletagservices.com/tag/js/gpt.js$script,redirect=googletagservices-gpt\n * ```\n */\nexport function GoogleTagServicesGpt(source) {\n const companionAdsService = {\n addEventListener: noopThis,\n enableSyncLoading: noopFunc,\n setRefreshUnfilledSlots: noopFunc,\n };\n const contentService = {\n addEventListener: noopThis,\n setContent: noopFunc,\n };\n function PassbackSlot() { } // constructor\n\n PassbackSlot.prototype.display = noopFunc;\n PassbackSlot.prototype.get = noopNull;\n PassbackSlot.prototype.set = noopThis;\n PassbackSlot.prototype.setClickUrl = noopThis;\n PassbackSlot.prototype.setTagForChildDirectedTreatment = noopThis;\n PassbackSlot.prototype.setTargeting = noopThis;\n PassbackSlot.prototype.updateTargetingFromMap = noopThis;\n\n function SizeMappingBuilder() { } // constructor\n SizeMappingBuilder.prototype.addSize = noopThis;\n SizeMappingBuilder.prototype.build = noopNull;\n\n function Slot() { } // constructor\n Slot.prototype.addService = noopThis;\n Slot.prototype.clearCategoryExclusions = noopThis;\n Slot.prototype.clearTargeting = noopThis;\n Slot.prototype.defineSizeMapping = noopThis;\n Slot.prototype.get = noopNull;\n Slot.prototype.getAdUnitPath = noopArray;\n Slot.prototype.getAttributeKeys = noopArray;\n Slot.prototype.getCategoryExclusions = noopArray;\n Slot.prototype.getDomId = noopStr;\n Slot.prototype.getSlotElementId = noopStr;\n Slot.prototype.getSlotId = noopThis;\n Slot.prototype.getTargeting = noopArray;\n Slot.prototype.getTargetingKeys = noopArray;\n Slot.prototype.set = noopThis;\n Slot.prototype.setCategoryExclusion = noopThis;\n Slot.prototype.setClickUrl = noopThis;\n Slot.prototype.setCollapseEmptyDiv = noopThis;\n Slot.prototype.setTargeting = noopThis;\n\n const pubAdsService = {\n addEventListener: noopThis,\n clear: noopFunc,\n clearCategoryExclusions: noopThis,\n clearTagForChildDirectedTreatment: noopThis,\n clearTargeting: noopThis,\n collapseEmptyDivs: noopFunc,\n defineOutOfPagePassback() { return new PassbackSlot(); },\n definePassback() { return new PassbackSlot(); },\n disableInitialLoad: noopFunc,\n display: noopFunc,\n enableAsyncRendering: noopFunc,\n enableSingleRequest: noopFunc,\n enableSyncRendering: noopFunc,\n enableVideoAds: noopFunc,\n get: noopNull,\n getAttributeKeys: noopArray,\n getTargeting: noopFunc,\n getTargetingKeys: noopArray,\n getSlots: noopArray,\n refresh: noopFunc,\n set: noopThis,\n setCategoryExclusion: noopThis,\n setCentering: noopFunc,\n setCookieOptions: noopThis,\n setForceSafeFrame: noopThis,\n setLocation: noopThis,\n setPublisherProvidedId: noopThis,\n setRequestNonPersonalizedAds: noopThis,\n setSafeFrameConfig: noopThis,\n setTagForChildDirectedTreatment: noopThis,\n setTargeting: noopThis,\n setVideoContent: noopThis,\n updateCorrelator: noopFunc,\n };\n\n\n const { googletag = {} } = window;\n const { cmd = [] } = googletag;\n\n googletag.apiReady = true;\n googletag.cmd = [];\n googletag.cmd.push = (a) => {\n try {\n a();\n // eslint-disable-next-line no-empty\n } catch (ex) { }\n return 1;\n };\n googletag.companionAds = () => companionAdsService;\n googletag.content = () => contentService;\n googletag.defineOutOfPageSlot = () => new Slot();\n googletag.defineSlot = () => new Slot();\n googletag.destroySlots = noopFunc;\n googletag.disablePublisherConsole = noopFunc;\n googletag.display = noopFunc;\n googletag.enableServices = noopFunc;\n googletag.getVersion = noopStr;\n googletag.pubads = () => pubAdsService;\n googletag.pubadsReady = true;\n googletag.setAdIframeTitle = noopFunc;\n googletag.sizeMapping = () => new SizeMappingBuilder();\n\n window.googletag = googletag;\n while (cmd.length !== 0) {\n googletag.cmd.push(cmd.shift());\n }\n\n hit(source);\n}\n\nGoogleTagServicesGpt.names = [\n 'googletagservices-gpt',\n 'ubo-googletagservices_gpt.js',\n 'googletagservices_gpt.js',\n];\n\nGoogleTagServicesGpt.injections = [\n hit,\n noopFunc,\n noopThis,\n noopNull,\n noopArray,\n noopStr,\n];\n","import { hit } from '../helpers';\n\n/**\n * @redirect scorecardresearch-beacon\n *\n * @description\n * Mocks Scorecard Research API.\n *\n * Related UBO redirect resource:\n * https://github.com/gorhill/uBlock/blob/a94df7f3b27080ae2dcb3b914ace39c0c294d2f6/src/web_accessible_resources/scorecardresearch_beacon.js\n *\n * **Example**\n * ```\n * ||sb.scorecardresearch.com/beacon.js$script,redirect=scorecardresearch-beacon\n * ```\n */\nexport function ScoreCardResearchBeacon(source) {\n window.COMSCORE = {\n purge() {\n // eslint-disable-next-line no-underscore-dangle\n window._comscore = [];\n },\n beacon() {},\n };\n hit(source);\n}\n\nScoreCardResearchBeacon.names = [\n 'scorecardresearch-beacon',\n 'ubo-scorecardresearch_beacon.js',\n 'scorecardresearch_beacon.js',\n];\n\nScoreCardResearchBeacon.injections = [\n hit,\n];\n","import { hit, noopFunc } from '../helpers';\n\n/**\n * @redirect metrika-yandex-tag\n *\n * @description\n * Mocks Yandex Metrika API.\n * https://yandex.ru/support/metrica/objects/method-reference.html\n *\n * **Example**\n * ```\n * ||mc.yandex.ru/metrika/tag.js$script,redirect=metrika-yandex-tag\n * ```\n */\nexport function metrikaYandexTag(source) {\n const asyncCallbackFromOptions = (param, options = {}) => {\n let { callback } = options;\n const { ctx } = options;\n if (typeof callback === 'function') {\n callback = ctx !== undefined ? callback.bind(ctx) : callback;\n setTimeout(() => callback());\n }\n };\n\n const init = noopFunc;\n\n /**\n * https://yandex.ru/support/metrica/objects/addfileextension.html\n */\n const addFileExtension = noopFunc;\n\n /**\n * https://yandex.ru/support/metrica/objects/extlink.html\n */\n const extLink = asyncCallbackFromOptions;\n\n /**\n * https://yandex.ru/support/metrica/objects/file.html\n */\n const file = asyncCallbackFromOptions;\n\n /**\n * https://yandex.ru/support/metrica/objects/get-client-id.html\n * @param {Function} cb\n */\n const getClientID = (cb) => {\n setTimeout(cb(null));\n };\n\n /**\n * https://yandex.ru/support/metrica/objects/hit.html\n */\n const hitFunc = asyncCallbackFromOptions;\n\n /**\n * https://yandex.ru/support/metrica/objects/notbounce.html\n */\n const notBounce = asyncCallbackFromOptions;\n\n /**\n * https://yandex.ru/support/metrica/objects/params-method.html\n */\n const params = noopFunc;\n\n /**\n * https://yandex.ru/support/metrica/objects/reachgoal.html\n * @param {string} target\n * @param {Object} params\n * @param {Function} callback\n * @param {any} ctx\n */\n const reachGoal = (target, params, callback, ctx) => {\n asyncCallbackFromOptions(null, { callback, ctx });\n };\n\n /**\n * https://yandex.ru/support/metrica/objects/set-user-id.html\n */\n const setUserID = noopFunc;\n\n /**\n * https://yandex.ru/support/metrica/objects/user-params.html\n */\n const userParams = noopFunc;\n\n const api = {\n init,\n addFileExtension,\n extLink,\n file,\n getClientID,\n hit: hitFunc,\n notBounce,\n params,\n reachGoal,\n setUserID,\n userParams,\n };\n\n function ym(id, funcName, ...args) {\n return api[funcName] && api[funcName](...args);\n }\n\n window.ym = ym;\n\n hit(source);\n}\n\nmetrikaYandexTag.names = [\n 'metrika-yandex-tag',\n];\n\nmetrikaYandexTag.injections = [hit, noopFunc];\n","import { hit, noopFunc } from '../helpers';\n\n/**\n * @redirect metrika-yandex-watch\n *\n * @description\n * Mocks the old Yandex Metrika API.\n * https://yandex.ru/support/metrica/objects/_method-reference.html\n *\n * **Example**\n * ```\n * ||mc.yandex.ru/metrika/watch.js$script,redirect=metrika-yandex-watch\n * ```\n */\nexport function metrikaYandexWatch(source) {\n const cbName = 'yandex_metrika_callbacks';\n\n /**\n * Gets callback and its context from options and call it in async way\n * @param {Object} options Yandex Metrika API options\n */\n const asyncCallbackFromOptions = (options = {}) => {\n let { callback } = options;\n const { ctx } = options;\n if (typeof callback === 'function') {\n callback = ctx !== undefined ? callback.bind(ctx) : callback;\n setTimeout(() => callback());\n }\n };\n\n function Metrika() { } // constructor\n\n // Methods without options\n Metrika.prototype.addFileExtension = noopFunc;\n Metrika.prototype.getClientID = noopFunc;\n Metrika.prototype.setUserID = noopFunc;\n Metrika.prototype.userParams = noopFunc;\n\n // Methods with options\n // The order of arguments should be kept in according to API\n Metrika.prototype.extLink = (url, options) => {\n asyncCallbackFromOptions(options);\n };\n Metrika.prototype.file = (url, options) => {\n asyncCallbackFromOptions(options);\n };\n Metrika.prototype.hit = (url, options) => {\n asyncCallbackFromOptions(options);\n };\n Metrika.prototype.reachGoal = (target, params, cb, ctx) => {\n asyncCallbackFromOptions({ callback: cb, ctx });\n };\n Metrika.prototype.notBounce = asyncCallbackFromOptions;\n\n if (window.Ya) {\n window.Ya.Metrika = Metrika;\n } else {\n window.Ya = { Metrika };\n }\n\n if (window[cbName] && Array.isArray(window[cbName])) {\n window[cbName].forEach((func) => {\n if (typeof func === 'function') {\n func();\n }\n });\n }\n\n hit(source);\n}\n\nmetrikaYandexWatch.names = [\n 'metrika-yandex-watch',\n];\n\nmetrikaYandexWatch.injections = [hit, noopFunc];\n","import {\n attachDependencies,\n addCall,\n wrapInNonameFunc,\n passSourceAndProps,\n} from '../helpers/injector';\n\nimport validator from '../helpers/validator';\n\nimport {\n convertUboRedirectToAdg,\n convertAbpRedirectToAdg,\n convertRedirectToAdg,\n convertAdgRedirectToUbo,\n} from '../helpers/converter';\n\nimport * as redirectsList from './redirectsList';\n\n/**\n * Finds redirect resource by it's name\n * @param {string} name - redirect name\n */\nconst getRedirectByName = (name) => {\n const redirects = Object.keys(redirectsList).map((key) => redirectsList[key]);\n return redirects.find((r) => r.names && r.names.indexOf(name) > -1);\n};\n\n/**\n * @typedef {Object} Source - redirect properties\n * @property {string} name redirect name\n * @property {Array} args Arguments for redirect function\n * @property {'extension'|'test'} [engine] -\n * Defines the final form of redirect string presentation\n * @property {boolean} [verbose] flag to enable printing to console debug information\n */\n\n/**\n * Returns redirect code by param\n * @param {Source} source\n * @returns {string} redirect code\n */\nconst getRedirectCode = (source) => {\n const redirect = getRedirectByName(source.name);\n let result = attachDependencies(redirect);\n result = addCall(redirect, result);\n\n // redirect code for different sources is checked in tests\n // so it should be just a code without any source and props passed\n result = source.engine === 'test'\n ? wrapInNonameFunc(result)\n : passSourceAndProps(source, result);\n\n return result;\n};\n\n\nexport const redirectsCjs = {\n getCode: getRedirectCode,\n isAdgRedirectRule: validator.isAdgRedirectRule,\n isValidAdgRedirectRule: validator.isValidAdgRedirectRule,\n isAdgRedirectCompatibleWithUbo: validator.isAdgRedirectCompatibleWithUbo,\n isUboRedirectCompatibleWithAdg: validator.isUboRedirectCompatibleWithAdg,\n isAbpRedirectCompatibleWithAdg: validator.isAbpRedirectCompatibleWithAdg,\n convertUboRedirectToAdg,\n convertAbpRedirectToAdg,\n convertRedirectToAdg,\n convertAdgRedirectToUbo,\n};\n","import { redirectsCjs } from '../redirects';\n\nimport {\n attachDependencies,\n addCall,\n passSourceAndProps,\n wrapInNonameFunc,\n} from '../helpers/injector';\n\nimport validator from '../helpers/validator';\n\nimport {\n isValidScriptletRule,\n convertUboScriptletToAdg,\n convertAbpSnippetToAdg,\n convertScriptletToAdg,\n convertAdgScriptletToUbo,\n} from '../helpers/converter';\n\n\n/**\n * @typedef {Object} Source - scriptlet properties\n * @property {string} name Scriptlet name\n * @property {Array} args Arguments for scriptlet function\n * @property {'extension'|'corelibs'|'test'} engine -\n * Defines the final form of scriptlet string presentation\n * @property {string} [version]\n * @property {boolean} [verbose] flag to enable printing to console debug information\n * @property {string} [ruleText] Source rule text is used for debugging purposes\n */\n\n/**\n * Returns scriptlet code by param\n * @param {Source} source\n * @returns {string} scriptlet code\n */\nfunction getScriptletCode(source) {\n if (!validator.isValidScriptletName(source.name)) {\n return null;\n }\n\n const scriptlet = validator.getScriptletByName(source.name);\n let result = attachDependencies(scriptlet);\n result = addCall(scriptlet, result);\n result = source.engine === 'corelibs' || source.engine === 'test'\n ? wrapInNonameFunc(result)\n : passSourceAndProps(source, result);\n return result;\n}\n\n/**\n * Scriptlets variable\n *\n * @returns {Object} object with methods:\n * `invoke` method receives one argument with `Source` type\n * `validate` method receives one argument with `String` type\n */\nconst scriptletsObject = (() => ({\n invoke: getScriptletCode,\n isValidScriptletName: validator.isValidScriptletName,\n isValidScriptletRule,\n isAdgScriptletRule: validator.isAdgScriptletRule,\n isUboScriptletRule: validator.isUboScriptletRule,\n isAbpSnippetRule: validator.isAbpSnippetRule,\n convertUboToAdg: convertUboScriptletToAdg,\n convertAbpToAdg: convertAbpSnippetToAdg,\n convertScriptletToAdg,\n convertAdgToUbo: convertAdgScriptletToUbo,\n redirects: redirectsCjs,\n}))();\n\nexport default scriptletsObject;\n","import scriptletsObject from './index';\n\n/**\n * Add module exports to be used as node package\n */\nmodule.exports = scriptletsObject;\n"],"names":["randomId","Math","random","toString","substr","setPropertyAccess","object","property","descriptor","currentDescriptor","Object","getOwnPropertyDescriptor","configurable","defineProperty","getPropertyInChain","base","chain","addProp","pos","indexOf","prop","slice","own","undefined","escapeRegExp","str","replace","toRegExp","length","RegExp","escaped","getBeforeRegExp","rx","index","search","substring","startsWith","prefix","endsWith","substringAfter","separator","substringBefore","wrapInSingleQuotes","getStringInBraces","firstIndex","lastIndex","lastIndexOf","createOnErrorHandler","rid","nativeOnError","window","onerror","onError","error","Function","args","apply","noopFunc","noopNull","trueFunc","falseFunc","noopThis","noopArray","noopStr","hit","source","message","verbose","log","console","bind","trace","ruleText","LOG_MARKER","e","__debug","observeDOMChanges","callback","observeAttrs","attrsToObserv","throttle","method","delay","wait","savedArgs","wrapper","setTimeout","THROTTLE_DELAY_MS","observer","MutationObserver","callbackWrapper","connect","observe","document","documentElement","childList","subtree","attributes","attributeFilter","disconnect","attachDependencies","scriptlet","injections","reduce","accum","dep","dependencies","name","addCall","code","passSourceAndProps","sourceString","JSON","stringify","argsString","map","params","wrapInNonameFunc","iterateWithTransitions","iterable","transitions","init","state","keys","i","ADG_SCRIPTLET_MASK","wordSaver","strs","saveSymb","s","saveStr","push","getAll","parseRule","TRANSITION","OPENED","PARAM","CLOSED","opened","rule","sep","char","transition","symb","Error","param","saver","preIndex","before","abortOnPropertyRead","abort","ReferenceError","setChainPropAccess","owner","chainInfo","setter","a","get","set","names","abortOnPropertyWrite","preventSetTimeout","match","nativeTimeout","nativeIsNaN","Number","isNaN","shouldLog","INVERT_MARKER","isNotMatch","isNotDelay","parseInt","timeoutWrapper","timeout","shouldPrevent","test","preventSetInterval","nativeInterval","setInterval","intervalWrapper","interval","preventWindowOpen","replacement","nativeOpen","open","openWrapper","result","isProp","propertyPart","propertyName","propertyValue","resObj","abortCurrentInlineScript","regex","getCurrentScript","currentScript","scripts","getElementsByTagName","ourScript","scriptEl","content","textContent","textContentGetter","Node","prototype","call","HTMLScriptElement","props","split","propIndex","baseName","currentValue","value","setConstant","constantValue","parseFloat","abs","canceled","mustCancel","removeCookie","removeCookieFromHost","cookieName","hostName","cookieSpec","domain1","domain2","path","expiration","cookie","rmCookie","forEach","cookieStr","trim","hostParts","location","hostname","join","addEventListener","preventAddEventListener","eventSearch","funcSearch","nativeAddEventListener","EventTarget","addEventListenerWrapper","eventName","funcToCheck","preventBab","nativeSetTimeout","babRegex","signatures","check","tokens","j","token","found","nativeEval","eval","bodyEl","body","style","removeProperty","el","getElementById","parentNode","removeChild","nowebrtc","RTCPeerConnection","webkitRTCPeerConnection","rtcReplacement","config","close","createDataChannel","createOffer","setRemoteDescription","rtc","b","send","logAddEventListener","callbackToLog","logEval","evalWrapper","nativeFunction","FunctionWrapper","create","constructor","noeval","preventEvalIf","payload","preventFab","Fab","clearEvent","emitEvent","on","onDetected","onNotDetected","setOption","FuckAdBlock","BlockAdBlock","fuckAdBlock","blockAdBlock","setPopadsDummy","PopAds","popns","defineProperties","preventPopadsNet","throwError","preventAdfly","isDigit","data","handler","encodedURL","evenChars","oddChars","charAt","ii","temp","decodedURL","atob","stop","onbeforeunload","href","val","applyHandler","err","debugOnPropertyRead","debugOnPropertyWrite","debugCurrentInlineScript","removeAttr","attrs","selector","rmattr","nodes","querySelectorAll","removed","node","attr","removeAttribute","removeClass","classNames","selectors","className","removeClassHandler","Set","foundedNodes","n","add","elements","element","classList","contains","remove","CLASS_ATTR_NAME","disableNewtabLinks","ev","target","localName","hasAttribute","stopPropagation","preventDefault","adjustSetInterval","boost","nativeIsFinite","isFinite","cb","d","adjustSetTimeout","dirString","times","dir","dirWrapper","jsonPrune","propsToRemove","requiredInitialProps","prunePaths","needlePaths","isPruningNeeded","root","needlePath","details","nestedPropName","pop","nativeParse","parse","parseWrapper","r","ownerObj","preventRequestAnimationFrame","nativeRequestAnimationFrame","requestAnimationFrame","doNotMatch","rafWrapper","logMessage","JS_RULE_MASK","COMMENT_MARKER","isComment","UBO_SCRIPTLET_MASK_REG","UBO_SCRIPTLET_MASK_1","UBO_SCRIPTLET_MASK_2","UBO_SCRIPTLET_EXCEPTION_MASK_1","UBO_SCRIPTLET_EXCEPTION_MASK_2","ABP_SCRIPTLET_MASK","ABP_SCRIPTLET_EXCEPTION_MASK","ADG_CSS_MASK_REG","isAdgScriptletRule","isUboScriptletRule","isAbpSnippetRule","getScriptletByName","scriptlets","scriptletsList","key","find","isValidScriptletName","ADG_UBO_REDIRECT_MARKER","ABP_REDIRECT_MARKER","VALID_SOURCE_TYPES","validAdgRedirects","redirects","filter","adg","objFromEntries","pairs","output","acc","uboToAdgCompatibility","ubo","abpToAdgCompatibility","abp","adgToUboCompatibility","validAdgCompatibility","REDIRECT_RULE_TYPES","VALID_ADG","marker","compatibility","ADG","UBO","ABP","parseModifiers","getRedirectName","ruleModifiers","redirectNamePart","isAdgRedirectRule","isRedirectRuleByType","type","redirectName","isValidAdgRedirectRule","isAdgRedirectCompatibleWithUbo","isUboRedirectCompatibleWithAdg","isAbpRedirectCompatibleWithAdg","hasValidContentType","sourceType","validator","ADGUARD_SCRIPTLET_MASK_REG","ADGUARD_SCRIPTLET_TEMPLATE","ADGUARD_SCRIPTLET_EXCEPTION_TEMPLATE","UBO_SCRIPTLET_TEMPLATE","UBO_SCRIPTLET_EXCEPTION_TEMPLATE","UBO_ALIAS_NAME_MARKER","UBO_XHR_TYPE","ADG_XHR_TYPE","getSentences","reg","replacePlaceholders","convertUboScriptletToAdg","domains","mask","template","arg","outputArg","adgRule","convertAbpSnippetToAdg","SEMICOLON_DIVIDER","convertScriptletToAdg","convertAdgScriptletToUbo","res","parsedName","parsedParams","adgScriptletObject","scriptletList","aliases","uboAlias","alias","includes","uboName","uboRule","isValidScriptletRule","input","rulesArray","isValid","parsedRule","convertUboRedirectToAdg","firstPartOfRule","uboModifiers","adgModifiers","adgName","convertAbpRedirectToAdg","abpModifiers","abpName","convertRedirectToAdg","convertAdgRedirectToUbo","GoogleAnalytics","Tracker","proto","googleAnalyticsName","GoogleAnalyticsObject","ga","len","arguments","lastArg","hitCallback","ex","getByName","loaded","dataLayer","hide","end","GoogleAnalyticsGa","Gaq","Na","O","Sa","Ta","Va","_createAsyncTracker","_getAsyncTracker","_getPlugin","Array","isArray","assign","gaq","asyncTrackers","_gaq","shift","qf","Gat","api","tracker","funcName","_getLinkerUrl","_anonymizeIP","_createTracker","_forceSSL","_getTracker","_getTrackerByName","_getTrackers","aa","ab","hb","la","oa","pa","u","gat","_gat","GoogleSyndicationAdsByGoogle","adsbygoogle","adElems","css","executed","setAttribute","aswiftIframe","createElement","id","appendChild","googleadsIframe","GoogleTagManagerGtm","eventCallback","GoogleTagServicesGpt","companionAdsService","enableSyncLoading","setRefreshUnfilledSlots","contentService","setContent","PassbackSlot","display","setClickUrl","setTagForChildDirectedTreatment","setTargeting","updateTargetingFromMap","SizeMappingBuilder","addSize","build","Slot","addService","clearCategoryExclusions","clearTargeting","defineSizeMapping","getAdUnitPath","getAttributeKeys","getCategoryExclusions","getDomId","getSlotElementId","getSlotId","getTargeting","getTargetingKeys","setCategoryExclusion","setCollapseEmptyDiv","pubAdsService","clear","clearTagForChildDirectedTreatment","collapseEmptyDivs","defineOutOfPagePassback","definePassback","disableInitialLoad","enableAsyncRendering","enableSingleRequest","enableSyncRendering","enableVideoAds","getSlots","refresh","setCentering","setCookieOptions","setForceSafeFrame","setLocation","setPublisherProvidedId","setRequestNonPersonalizedAds","setSafeFrameConfig","setVideoContent","updateCorrelator","googletag","cmd","apiReady","companionAds","defineOutOfPageSlot","defineSlot","destroySlots","disablePublisherConsole","enableServices","getVersion","pubads","pubadsReady","setAdIframeTitle","sizeMapping","ScoreCardResearchBeacon","COMSCORE","purge","_comscore","beacon","metrikaYandexTag","asyncCallbackFromOptions","options","ctx","addFileExtension","extLink","file","getClientID","hitFunc","notBounce","reachGoal","setUserID","userParams","ym","metrikaYandexWatch","cbName","Metrika","url","Ya","func","getRedirectByName","redirectsList","getRedirectCode","redirect","engine","redirectsCjs","getCode","getScriptletCode","scriptletsObject","invoke","convertUboToAdg","convertAbpToAdg","convertAdgToUbo","module","exports"],"mappings":";;;;;;AACA;;;AAGO,SAASA,QAAT,GAAoB;AACvB,SAAOC,IAAI,CAACC,MAAL,GAAcC,QAAd,CAAuB,EAAvB,EAA2BC,MAA3B,CAAkC,CAAlC,EAAqC,CAArC,CAAP;AACH;;ACND;;;;;;;AAOA,AAAO,SAASC,iBAAT,CAA2BC,MAA3B,EAAmCC,QAAnC,EAA6CC,UAA7C,EAAyD;AAC5D,MAAMC,iBAAiB,GAAGC,MAAM,CAACC,wBAAP,CAAgCL,MAAhC,EAAwCC,QAAxC,CAA1B;;AACA,MAAIE,iBAAiB,IAAI,CAACA,iBAAiB,CAACG,YAA5C,EAA0D;AACtD,WAAO,KAAP;AACH;;AACDF,EAAAA,MAAM,CAACG,cAAP,CAAsBP,MAAtB,EAA8BC,QAA9B,EAAwCC,UAAxC;AACA,SAAO,IAAP;AACH;;ACdD;;;;;;;AAOA;;;;;;;;;;;;;AAaA,AAAO,SAASM,kBAAT,CAA4BC,IAA5B,EAAkCC,KAAlC,EAAyD;AAAA,MAAhBC,OAAgB,uEAAN,IAAM;AAC5D,MAAMC,GAAG,GAAGF,KAAK,CAACG,OAAN,CAAc,GAAd,CAAZ;;AACA,MAAID,GAAG,KAAK,CAAC,CAAb,EAAgB;AACZ,WAAO;AAAEH,MAAAA,IAAI,EAA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GAAG9E,OAAO,CAACP,SAAD,EAAYqF,MAAZ,CAAhB;AACAA,EAAAA,MAAM,GAAGzH,MAAM,CAAColB,MAAP,KAAkB,UAAlB,IAAgCplB,MAAM,CAAColB,MAAP,KAAkB,MAAlD,GACHhiB,gBAAgB,CAACqE,MAAD,CADb,GAEH5E,kBAAkB,CAAC7C,MAAD,EAASyH,MAAT,CAFxB;AAGA,SAAOA,MAAP;AACH;AAED;;;;;;;;;AAOA,IAAM+d,gBAAgB,GAAI;AAAA,SAAO;AAC7BC,IAAAA,MAAM,EAAEF,gBADqB;AAE7B7P,IAAAA,oBAAoB,EAAEuC,SAAS,CAACvC,oBAFH;AAG7ByE,IAAAA,oBAAoB,EAApBA,oBAH6B;AAI7BjF,IAAAA,kBAAkB,EAAE+C,SAAS,CAAC/C,kBAJD;AAK7BC,IAAAA,kBAAkB,EAAE8C,SAAS,CAAC9C,kBALD;AAM7BC,IAAAA,gBAAgB,EAAE6C,SAAS,CAAC7C,gBANC;AAO7BsQ,IAAAA,eAAe,EAAE7M,wBAPY;AAQ7B8M,IAAAA,eAAe,EAAEvM,sBARY;AAS7BE,IAAAA,qBAAqB,EAArBA,qBAT6B;AAU7BsM,IAAAA,eAAe,EAAErM,wBAVY;AAW7BxD,IAAAA,SAAS,EAAEsP;AAXkB,GAAP;AAAA,CAAD,EAAzB;;ACvDA;;;;AAGAQ,MAAM,CAACC,OAAP,GAAiBN,gBAAjB;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/scriptlets.corelibs.json b/dist/scriptlets.corelibs.json index 1de0b5d0..6eb7fa4a 100644 --- a/dist/scriptlets.corelibs.json +++ b/dist/scriptlets.corelibs.json @@ -220,7 +220,11 @@ }, { "names": [ - "remove-class" + "remove-class", + "remove-class.js", + "ubo-remove-class.js", + "rc.js", + "ubo-rc.js" ], "scriptlet": "function(source, args){function removeClass(source, classNames, selector) {if (!classNames) {return;}classNames = classNames.split(/\\s*\\|\\s*/);var selectors = [];if (!selector) {selectors = classNames.map(function (className) {return \".\".concat(className);});}var removeClassHandler = function removeClassHandler() {var nodes = new Set();if (selector) {var foundedNodes = [].slice.call(document.querySelectorAll(selector));foundedNodes.forEach(function (n) {return nodes.add(n);});} else if (selectors.length > 0) {selectors.forEach(function (s) {var elements = document.querySelectorAll(s);for (var i = 0; i < elements.length; i += 1) {var element = elements[i];nodes.add(element);}});}var removed = false;nodes.forEach(function (node) {classNames.forEach(function (className) {if (node.classList.contains(className)) {node.classList.remove(className);removed = true;}});});if (removed) {hit(source);}};removeClassHandler();var CLASS_ATTR_NAME = ['class'];observeDOMChanges(removeClassHandler, true, CLASS_ATTR_NAME);}function hit(source, message) {if (source.verbose !== true) {return;}try {var log = console.log.bind(console);var trace = console.trace.bind(console);var prefix = source.ruleText || '';var LOG_MARKER = 'log: ';if (message) {if (message.indexOf(LOG_MARKER) === -1) {log(\"\".concat(prefix, \" message:\\n\").concat(message));} else {log(message.slice(LOG_MARKER.length));}}log(\"\".concat(prefix, \" trace start\"));if (trace) {trace();}log(\"\".concat(prefix, \" trace end\"));} catch (e) {}if (typeof window.__debug === 'function') {window.__debug(source);}}function observeDOMChanges(callback) {var observeAttrs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;var attrsToObserv = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];var throttle = function throttle(method, delay) {var wait = false;var savedArgs;var wrapper = function wrapper() {for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {args[_key] = arguments[_key];}if (wait) {savedArgs = args;return;}method.apply(void 0, args);wait = true;setTimeout(function () {wait = false;if (savedArgs) {wrapper(savedArgs);savedArgs = null;}}, delay);};return wrapper;};var THROTTLE_DELAY_MS = 20;var observer = new MutationObserver(throttle(callbackWrapper, THROTTLE_DELAY_MS));var connect = function connect() {if (attrsToObserv.length > 0) {observer.observe(document.documentElement, {childList: true,subtree: true,attributes: observeAttrs,attributeFilter: attrsToObserv});} else {observer.observe(document.documentElement, {childList: true,subtree: true,attributes: observeAttrs});}};var disconnect = function disconnect() {observer.disconnect();};function callbackWrapper() {disconnect();callback();connect();}connect();};const updatedArgs = args ? [].concat(source).concat(args) : [source];removeClass.apply(this, updatedArgs);}" }, diff --git a/dist/scriptlets.js b/dist/scriptlets.js index b421bad7..97b97eb4 100644 --- a/dist/scriptlets.js +++ b/dist/scriptlets.js @@ -727,7 +727,7 @@ * * **Syntax** * ``` - * example.org#%#//scriptlet("abort-on-property-read", ) + * example.org#%#//scriptlet('abort-on-property-read', ) * ``` * * **Parameters** @@ -736,10 +736,10 @@ * **Examples** * ``` * ! Aborts script when it tries to access `window.alert` - * example.org#%#//scriptlet("abort-on-property-read", "alert") + * example.org#%#//scriptlet('abort-on-property-read', 'alert') * * ! Aborts script when it tries to access `navigator.language` - * example.org#%#//scriptlet("abort-on-property-read", "navigator.language") + * example.org#%#//scriptlet('abort-on-property-read', 'navigator.language') * ``` */ @@ -809,7 +809,7 @@ * * **Syntax** * ``` - * example.org#%#//scriptlet("abort-on-property-write", ) + * example.org#%#//scriptlet('abort-on-property-write', ) * ``` * * **Parameters** @@ -817,9 +817,8 @@ * * **Examples** * ``` - * ! Aborts all inline scripts trying to access `window.alert` - * utils.escape('') - * // => '<script></script>' + * ! Aborts script when it tries to set `window.adblock` value + * example.org#%#//scriptlet('abort-on-property-write', 'adblock') * ``` */ @@ -2039,7 +2038,7 @@ * * **Syntax** * ``` - * example.org#%#//scriptlet("noeval") + * example.org#%#//scriptlet('noeval') * ``` */ @@ -2061,12 +2060,19 @@ * Related UBO scriptlet: * https://github.com/gorhill/uBlock/wiki/Resources-Library#noeval-ifjs- * + * **Syntax** + * ``` + * example.org#%#//scriptlet('prevent-eval-if'[, ]) + * ``` + * * **Parameters** - * - `search` string or regexp matching stringified eval payload + * - `search` - optional string or regexp for matching stringified eval payload. + * If 'search is not specified — all stringified eval payload will be matched. * * **Examples** * ``` - * ! + * ! Prevents eval if it matches 'test' + * example.org#%#//scriptlet('prevent-eval-if', 'test') * ``` * * @param {string|RegExp} [search] string or regexp matching stringified eval payload @@ -2663,7 +2669,7 @@ * * 2. Removes with specified selector * ``` - * example.org#%#//scriptlet('remove-class', 'branding', 'div[class="inner"]') + * example.org#%#//scriptlet('remove-class', 'branding', 'div[class^="inner"]') * ``` * * ```html @@ -2735,7 +2741,7 @@ observeDOMChanges(removeClassHandler, true, CLASS_ATTR_NAME); } - removeClass.names = ['remove-class']; + removeClass.names = ['remove-class', 'remove-class.js', 'ubo-remove-class.js', 'rc.js', 'ubo-rc.js']; removeClass.injections = [hit, observeDOMChanges]; /** @@ -4610,6 +4616,7 @@ /** * Returns redirect code by param * @param {Source} source + * @returns {string} redirect code */ @@ -4648,9 +4655,10 @@ */ /** - * Returns scriptlet code by param - * @param {Source} source - */ + * Returns scriptlet code by param + * @param {Source} source + * @returns {string} scriptlet code + */ function getScriptletCode(source) { if (!validator.isValidScriptletName(source.name)) { diff --git a/dist/scriptlets.js.map b/dist/scriptlets.js.map index 68e5a47c..7e1ef18f 100644 --- a/dist/scriptlets.js.map +++ b/dist/scriptlets.js.map @@ -1 +1 @@ -{"version":3,"file":"scriptlets.js","sources":["../src/helpers/random-id.js","../src/helpers/set-property-access.js","../src/helpers/get-property-in-chain.js","../src/helpers/string-utils.js","../src/helpers/create-on-error-handler.js","../src/helpers/noop.js","../src/helpers/hit.js","../src/helpers/observer.js","../src/helpers/index.js","../src/helpers/injector.js","../node_modules/@babel/runtime/helpers/arrayWithHoles.js","../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js","../node_modules/@babel/runtime/helpers/nonIterableRest.js","../node_modules/@babel/runtime/helpers/slicedToArray.js","../node_modules/@babel/runtime/helpers/defineProperty.js","../src/helpers/parse-rule.js","../src/scriptlets/abort-on-property-read.js","../src/scriptlets/abort-on-property-write.js","../src/scriptlets/prevent-setTimeout.js","../src/scriptlets/prevent-setInterval.js","../src/scriptlets/prevent-window-open.js","../src/scriptlets/abort-current-inline-script.js","../src/scriptlets/set-constant.js","../src/scriptlets/remove-cookie.js","../src/scriptlets/prevent-addEventListener.js","../src/scriptlets/prevent-bab.js","../src/scriptlets/nowebrtc.js","../src/scriptlets/log-addEventListener.js","../src/scriptlets/log-eval.js","../src/scriptlets/log.js","../src/scriptlets/noeval.js","../src/scriptlets/prevent-eval-if.js","../src/scriptlets/prevent-fab-3.2.0.js","../src/scriptlets/set-popads-dummy.js","../src/scriptlets/prevent-popads-net.js","../src/scriptlets/prevent-adfly.js","../src/scriptlets/debug-on-property-read.js","../src/scriptlets/debug-on-property-write.js","../src/scriptlets/debug-current-inline-script.js","../src/scriptlets/remove-attr.js","../src/scriptlets/remove-class.js","../src/scriptlets/disable-newtab-links.js","../src/scriptlets/adjust-setInterval.js","../src/scriptlets/adjust-setTimeout.js","../src/scriptlets/dir-string.js","../src/scriptlets/json-prune.js","../src/scriptlets/prevent-requestAnimationFrame.js","../src/scriptlets/scriptletsList.js","../src/helpers/validator.js","../node_modules/@babel/runtime/helpers/iterableToArray.js","../node_modules/@babel/runtime/helpers/toArray.js","../src/helpers/converter.js","../src/redirects/google-analytics.js","../src/redirects/google-analytics-ga.js","../src/redirects/googlesyndication-adsbygoogle.js","../src/redirects/googletagmanager-gtm.js","../src/redirects/googletagservices-gpt.js","../src/redirects/scorecardresearch-beacon.js","../src/redirects/metrika-yandex-tag.js","../src/redirects/metrika-yandex-watch.js","../src/redirects/index.js","../src/scriptlets/index.js","../src/scriptlets/scriptletsWrapper.js"],"sourcesContent":["\n/**\n * Generate random six symbols id\n */\nexport function randomId() {\n return Math.random().toString(36).substr(2, 9);\n}\n","/**\n * Set getter and setter to property if it's configurable\n * @param {Object} object target object with property\n * @param {string} property property name\n * @param {Object} descriptor contains getter and setter functions\n * @returns {boolean} is operation successful\n */\nexport function setPropertyAccess(object, property, descriptor) {\n const currentDescriptor = Object.getOwnPropertyDescriptor(object, property);\n if (currentDescriptor && !currentDescriptor.configurable) {\n return false;\n }\n Object.defineProperty(object, property, descriptor);\n return true;\n}\n","/**\n * @typedef Chain\n * @property {Object} base\n * @property {string} prop\n * @property {string} [chain]\n */\n\n/**\n * Check is property exist in base object recursively\n *\n * If property doesn't exist in base object,\n * defines this property (for addProp = true)\n * and returns base, property name and remaining part of property chain\n *\n * @param {Object} base\n * @param {string} chain\n * @param {boolean} [addProp=true]\n * defines is nonexistent base property should be assigned as 'undefined'\n * @returns {Chain}\n */\nexport function getPropertyInChain(base, chain, addProp = true) {\n const pos = chain.indexOf('.');\n if (pos === -1) {\n return { base, prop: chain };\n }\n const prop = chain.slice(0, pos);\n const own = base[prop];\n chain = chain.slice(pos + 1);\n if (own !== undefined) {\n return getPropertyInChain(own, chain, addProp);\n }\n\n if (!addProp) {\n return false;\n }\n\n Object.defineProperty(base, prop, { configurable: true });\n return { base: own, prop, chain };\n}\n","/**\n * Escapes special chars in string\n * @param {string} str\n * @returns {string}\n */\nexport const escapeRegExp = (str) => str.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n\n/**\n * Converts search string to the regexp\n * TODO think about nested dependencies, but be careful with dependency loops\n * @param {string} str search string\n * @returns {RegExp}\n */\nexport const toRegExp = (str) => {\n if (str[0] === '/' && str[str.length - 1] === '/') {\n return new RegExp(str.slice(1, -1));\n }\n const escaped = str.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n return new RegExp(escaped);\n};\n\n/**\n * Get string before regexp first match\n * @param {string} str\n * @param {RegExp} rx\n */\nexport const getBeforeRegExp = (str, rx) => {\n const index = str.search(rx);\n return str.substring(0, index);\n};\n\nexport const startsWith = (str, prefix) => {\n return str && str.indexOf(prefix) === 0;\n};\n\nexport const endsWith = (str, prefix) => {\n return str && str.indexOf(prefix) === str.length - 1;\n};\n\nexport const substringAfter = (str, separator) => {\n if (!str) {\n return str;\n }\n const index = str.indexOf(separator);\n return index < 0 ? '' : str.substring(index + separator.length);\n};\n\nexport const substringBefore = (str, separator) => {\n if (!str || !separator) {\n return str;\n }\n const index = str.indexOf(separator);\n return index < 0 ? str : str.substring(0, index);\n};\n\n/**\n * Wrap str in single qoutes and replaces single quotes to doudle one\n * @param {string} str\n */\nexport const wrapInSingleQuotes = (str) => {\n if ((str[0] === '\\'' && str[str.length - 1] === '\\'')\n || (str[0] === '\"' && str[str.length - 1] === '\"')) {\n str = str.substring(1, str.length - 1);\n }\n // eslint-disable-next-line no-useless-escape\n str = str.replace(/\\'/g, '\"');\n\n return `'${str}'`;\n};\n\n/**\n * Returns substring enclosed in the widest braces\n * @param {string} str\n */\nexport const getStringInBraces = (str) => {\n const firstIndex = str.indexOf('(');\n const lastIndex = str.lastIndexOf(')');\n return str.substring(firstIndex + 1, lastIndex);\n};\n","/**\n * Generates function which silents global errors on page generated by scriptlet\n * If error doesn't belong to our error we transfer it to the native onError handler\n * @param {string} rid - unique identifier of scriptlet\n * @return {onError}\n */\nexport function createOnErrorHandler(rid) {\n // eslint-disable-next-line consistent-return\n const nativeOnError = window.onerror;\n return function onError(error, ...args) {\n if (typeof error === 'string' && error.indexOf(rid) !== -1) {\n return true;\n }\n if (nativeOnError instanceof Function) {\n return nativeOnError.apply(this, [error, ...args]);\n }\n return false;\n };\n}\n","/**\n * Noop function\n */\nexport const noopFunc = () => { };\n\n/**\n * Function returns null\n */\nexport const noopNull = () => null;\n\n/**\n * Function returns true\n */\nexport const trueFunc = () => true;\n\n/**\n * Function returns false\n */\nexport const falseFunc = () => false;\n\n/**\n * Function returns this\n */\nexport function noopThis() {\n return this;\n}\n\n/**\n * Function returns empty array\n */\nexport const noopArray = () => [];\n\n/**\n * Function returns empty string\n */\nexport const noopStr = () => '';\n","/* eslint-disable no-console, no-underscore-dangle */\n/**\n * Hit used only for debug purposes now\n * @param {Source} source\n * @param {string} [message] - optional message;\n * use LOG_MARKER = 'log: ' at the start of a message\n * for logging scriptlets\n */\nexport const hit = (source, message) => {\n if (source.verbose !== true) {\n return;\n }\n\n try {\n const log = console.log.bind(console);\n const trace = console.trace.bind(console);\n\n const prefix = source.ruleText || '';\n\n // Used to check if scriptlet uses 'hit' function for logging\n const LOG_MARKER = 'log: ';\n\n if (message) {\n if (message.indexOf(LOG_MARKER) === -1) {\n log(`${prefix} message:\\n${message}`);\n } else {\n log(message.slice(LOG_MARKER.length));\n }\n }\n\n log(`${prefix} trace start`);\n if (trace) {\n trace();\n }\n log(`${prefix} trace end`);\n } catch (e) {\n // try catch for Edge 15\n // In according to this issue https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/14495220/\n // console.log throws an error\n }\n\n // This is necessary for unit-tests only!\n if (typeof window.__debug === 'function') {\n window.__debug(source);\n }\n};\n","/**\n * DOM tree changes observer. Used for 'remove-attr' and 'remove-class' scriptlets\n * @param {Function} callback\n * @param {Boolean} observeAttrs - optional parameter - should observer check attibutes changes\n */\nexport const observeDOMChanges = (callback, observeAttrs = false, attrsToObserv = []) => {\n /**\n * Returns a wrapper, passing the call to 'method' at maximum once per 'delay' milliseconds.\n * Those calls that fall into the \"cooldown\" period, are ignored\n * @param {Function} method\n * @param {Number} delay - milliseconds\n */\n const throttle = (method, delay) => {\n let wait = false;\n let savedArgs;\n const wrapper = (...args) => {\n if (wait) {\n savedArgs = args;\n return;\n }\n method(...args);\n wait = true;\n setTimeout(() => {\n wait = false;\n if (savedArgs) {\n wrapper(savedArgs);\n savedArgs = null;\n }\n }, delay);\n };\n return wrapper;\n };\n\n /**\n * 'delay' in milliseconds for 'throttle' method\n */\n const THROTTLE_DELAY_MS = 20;\n /**\n * Used for remove-class\n */\n // eslint-disable-next-line no-use-before-define\n const observer = new MutationObserver(throttle(callbackWrapper, THROTTLE_DELAY_MS));\n\n const connect = () => {\n if (attrsToObserv.length > 0) {\n observer.observe(document.documentElement, {\n childList: true,\n subtree: true,\n attributes: observeAttrs,\n attributeFilter: attrsToObserv,\n });\n } else {\n observer.observe(document.documentElement, {\n childList: true,\n subtree: true,\n attributes: observeAttrs,\n });\n }\n };\n const disconnect = () => {\n observer.disconnect();\n };\n function callbackWrapper() {\n disconnect();\n callback();\n connect();\n }\n\n connect();\n};\n","/**\n * This file must export all used dependencies\n */\nexport * from './random-id';\nexport * from './set-property-access';\nexport * from './get-property-in-chain';\nexport * from './string-utils';\nexport * from './create-on-error-handler';\nexport * from './noop';\nexport * from './hit';\nexport * from './observer';\n","import * as dependencies from '.';\n\n\n/**\n * Concat dependencies to scriptlet code\n * @param {string} scriptlet string view of scriptlet\n */\nexport function attachDependencies(scriptlet) {\n const { injections = [] } = scriptlet;\n return injections.reduce((accum, dep) => `${accum}\\n${dependencies[dep.name]}`, scriptlet.toString());\n}\n\n/**\n * Add scriptlet call to existing code\n * @param {Function} scriptlet\n * @param {string} code\n */\nexport function addCall(scriptlet, code) {\n return `${code};\n const updatedArgs = args ? [].concat(source).concat(args) : [source];\n ${scriptlet.name}.apply(this, updatedArgs);\n `;\n}\n\n/**\n * Wrap function into IIFE (Immediately invoked function expression)\n *\n * @param {Source} source - object with scriptlet properties\n * @param {string} code - scriptlet source code with dependencies\n *\n * @returns {string} full scriptlet code\n *\n * @example\n * const source = {\n * args: [\"aaa\", \"bbb\"],\n * name: 'noeval',\n * };\n * const code = \"function noeval(source, args) { alert(source); } noeval.apply(this, args);\"\n * const result = wrapInIIFE(source, code);\n *\n * // result\n * `(function(source, args) {\n * function noeval(source) { alert(source); }\n * noeval.apply(this, args);\n * )({\"args\": [\"aaa\", \"bbb\"], \"name\":\"noeval\"}, [\"aaa\", \"bbb\"])`\n */\nexport function passSourceAndProps(source, code) {\n if (source.hit) {\n source.hit = source.hit.toString();\n }\n const sourceString = JSON.stringify(source);\n const argsString = source.args ? `[${source.args.map(JSON.stringify)}]` : undefined;\n const params = argsString ? `${sourceString}, ${argsString}` : sourceString;\n return `(function(source, args){\\n${code}\\n})(${params});`;\n}\n\n/**\n * Wrap code in no name function\n * @param {string} code which must be wrapped\n */\nexport function wrapInNonameFunc(code) {\n return `function(source, args){\\n${code}\\n}`;\n}\n","function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\n\nmodule.exports = _arrayWithHoles;","function _iterableToArrayLimit(arr, i) {\n if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === \"[object Arguments]\")) {\n return;\n }\n\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}\n\nmodule.exports = _iterableToArrayLimit;","function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance\");\n}\n\nmodule.exports = _nonIterableRest;","var arrayWithHoles = require(\"./arrayWithHoles\");\n\nvar iterableToArrayLimit = require(\"./iterableToArrayLimit\");\n\nvar nonIterableRest = require(\"./nonIterableRest\");\n\nfunction _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || nonIterableRest();\n}\n\nmodule.exports = _slicedToArray;","function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nmodule.exports = _defineProperty;","/**\n * Iterate over iterable argument and evaluate current state with transitions\n * @param {string} init first transition name\n * @param {Array|Collection|string} iterable\n * @param {Object} transitions transtion functions\n * @param {any} args arguments which should be passed to transition functions\n */\nfunction iterateWithTransitions(iterable, transitions, init, args) {\n let state = init || Object.keys(transitions)[0];\n for (let i = 0; i < iterable.length; i += 1) {\n state = transitions[state](iterable, i, args);\n }\n return state;\n}\n\n/**\n * AdGuard scriptlet rule mask\n */\nexport const ADG_SCRIPTLET_MASK = '#//scriptlet';\n\n/**\n * Helper to accumulate an array of strings char by char\n */\nconst wordSaver = () => {\n let str = '';\n const strs = [];\n const saveSymb = (s) => {\n str += s;\n return str;\n };\n const saveStr = () => {\n strs.push(str);\n str = '';\n };\n const getAll = () => [...strs];\n\n return { saveSymb, saveStr, getAll };\n};\n\nconst substringAfter = (str, separator) => {\n if (!str) {\n return str;\n }\n const index = str.indexOf(separator);\n return index < 0 ? '' : str.substring(index + separator.length);\n};\n\n/**\n * Parse and validate scriptlet rule\n * @param {*} ruleText\n * @returns {{name: string, args: Array}}\n */\nexport const parseRule = (ruleText) => {\n ruleText = substringAfter(ruleText, ADG_SCRIPTLET_MASK);\n /**\n * Transition names\n */\n const TRANSITION = {\n OPENED: 'opened',\n PARAM: 'param',\n CLOSED: 'closed',\n };\n\n /**\n * Transition function: the current index position in start, end or between params\n * @param {string} rule\n * @param {number} index\n * @param {Object} Object\n * @property {Object} Object.sep contains prop symb with current separator char\n */\n const opened = (rule, index, { sep }) => {\n const char = rule[index];\n let transition;\n switch (char) {\n case ' ':\n case '(':\n case ',': {\n transition = TRANSITION.OPENED;\n break;\n }\n case '\\'':\n case '\"': {\n sep.symb = char;\n transition = TRANSITION.PARAM;\n break;\n }\n case ')': {\n transition = index === rule.length - 1\n ? TRANSITION.CLOSED\n : TRANSITION.OPENED;\n break;\n }\n default: {\n throw new Error('The rule is not a scriptlet');\n }\n }\n\n return transition;\n };\n /**\n * Transition function: the current index position inside param\n * @param {string} rule\n * @param {number} index\n * @param {Object} Object\n * @property {Object} Object.sep contains prop `symb` with current separator char\n * @property {Object} Object.saver helper which allow to save strings by car by char\n */\n const param = (rule, index, { saver, sep }) => {\n const char = rule[index];\n switch (char) {\n case '\\'':\n case '\"': {\n const preIndex = index - 1;\n const before = rule[preIndex];\n if (char === sep.symb && before !== '\\\\') {\n sep.symb = null;\n saver.saveStr();\n return TRANSITION.OPENED;\n }\n }\n // eslint-disable-next-line no-fallthrough\n default: {\n saver.saveSymb(char);\n return TRANSITION.PARAM;\n }\n }\n };\n const transitions = {\n [TRANSITION.OPENED]: opened,\n [TRANSITION.PARAM]: param,\n [TRANSITION.CLOSED]: () => { },\n };\n const sep = { symb: null };\n const saver = wordSaver();\n const state = iterateWithTransitions(ruleText, transitions, TRANSITION.OPENED, { sep, saver });\n\n if (state !== 'closed') {\n throw new Error(`Invalid scriptlet rule ${ruleText}`);\n }\n\n const args = saver.getAll();\n return {\n name: args[0],\n args: args.slice(1),\n };\n};\n","import {\n randomId, setPropertyAccess, getPropertyInChain, createOnErrorHandler, hit,\n} from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet abort-on-property-read\n *\n * @description\n * Aborts a script when it attempts to **read** the specified property.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#abort-on-property-readjs-\n *\n * Related ABP source:\n * https://github.com/adblockplus/adblockpluscore/blob/6b2a309054cc23432102b85d13f12559639ef495/lib/content/snippets.js#L864\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"abort-on-property-read\", )\n * ```\n *\n * **Parameters**\n * - `property` (required) path to a property (joined with `.` if needed). The property must be attached to `window`.\n *\n * **Examples**\n * ```\n * ! Aborts script when it tries to access `window.alert`\n * example.org#%#//scriptlet(\"abort-on-property-read\", \"alert\")\n *\n * ! Aborts script when it tries to access `navigator.language`\n * example.org#%#//scriptlet(\"abort-on-property-read\", \"navigator.language\")\n * ```\n */\n/* eslint-enable max-len */\nexport function abortOnPropertyRead(source, property) {\n if (!property) {\n return;\n }\n const rid = randomId();\n const abort = () => {\n hit(source);\n throw new ReferenceError(rid);\n };\n const setChainPropAccess = (owner, property) => {\n const chainInfo = getPropertyInChain(owner, property);\n let { base } = chainInfo;\n const { prop, chain } = chainInfo;\n if (chain) {\n const setter = (a) => {\n base = a;\n if (a instanceof Object) {\n setChainPropAccess(a, chain);\n }\n };\n Object.defineProperty(owner, prop, {\n get: () => base,\n set: setter,\n });\n return;\n }\n\n setPropertyAccess(base, prop, {\n get: abort,\n set: () => {\n },\n });\n };\n\n setChainPropAccess(window, property);\n\n window.onerror = createOnErrorHandler(rid)\n .bind();\n}\n\nabortOnPropertyRead.names = [\n 'abort-on-property-read',\n 'abort-on-property-read.js',\n 'ubo-abort-on-property-read.js',\n 'aopr.js',\n 'ubo-aopr.js',\n 'abp-abort-on-property-read',\n];\nabortOnPropertyRead.injections = [\n randomId,\n setPropertyAccess,\n getPropertyInChain,\n createOnErrorHandler,\n hit,\n];\n","import {\n randomId, setPropertyAccess, getPropertyInChain, createOnErrorHandler, hit,\n} from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet abort-on-property-write\n *\n * @description\n * Aborts a script when it attempts to **write** the specified property.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#abort-on-property-writejs-\n *\n * Related ABP source:\n * https://github.com/adblockplus/adblockpluscore/blob/6b2a309054cc23432102b85d13f12559639ef495/lib/content/snippets.js#L896\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"abort-on-property-write\", )\n * ```\n *\n * **Parameters**\n * - `property` (required) path to a property (joined with `.` if needed). The property must be attached to `window`.\n *\n * **Examples**\n * ```\n * ! Aborts all inline scripts trying to access `window.alert`\n * utils.escape('')\n * // => '<script></script>'\n * ```\n */\n/* eslint-enable max-len */\nexport function abortOnPropertyWrite(source, property) {\n if (!property) {\n return;\n }\n const rid = randomId();\n const abort = () => {\n hit(source);\n throw new ReferenceError(rid);\n };\n const setChainPropAccess = (owner, property) => {\n const chainInfo = getPropertyInChain(owner, property);\n let { base } = chainInfo;\n const { prop, chain } = chainInfo;\n if (chain) {\n const setter = (a) => {\n base = a;\n if (a instanceof Object) {\n setChainPropAccess(a, chain);\n }\n };\n Object.defineProperty(owner, prop, {\n get: () => base,\n set: setter,\n });\n return;\n }\n\n setPropertyAccess(base, prop, { set: abort });\n };\n\n setChainPropAccess(window, property);\n\n window.onerror = createOnErrorHandler(rid).bind();\n}\n\nabortOnPropertyWrite.names = [\n 'abort-on-property-write',\n 'abort-on-property-write.js',\n 'ubo-abort-on-property-write.js',\n 'aopw.js',\n 'ubo-aopw.js',\n 'abp-abort-on-property-write',\n];\n\nabortOnPropertyWrite.injections = [\n randomId,\n setPropertyAccess,\n getPropertyInChain,\n createOnErrorHandler,\n hit,\n];\n","import {\n hit, noopFunc, toRegExp, startsWith,\n} from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet prevent-setTimeout\n *\n * @description\n * Prevents a `setTimeout` call if:\n * 1) the text of the callback is matching the specified search string/regexp which does not start with `!`;\n * otherwise mismatched calls should be defused;\n * 2) the timeout is matching the specified delay; otherwise mismatched calls should be defused.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#no-settimeout-ifjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"prevent-setTimeout\"[, [, ]])\n * ```\n *\n * **Parameters**\n *\n * Call with no arguments will log calls to setTimeout while debugging (`log-setTimeout` superseding),\n * so production filter lists' rules definitely require at least one of the parameters:\n * - `search` (optional) string or regular expression.\n * If starts with `!`, scriptlet will not match the stringified callback but all other will be defused.\n * If do not start with `!`, the stringified callback will be matched.\n * If not set, prevents all `setTimeout` calls due to specified `delay`.\n * - `delay` (optional) must be an integer.\n * If starts with `!`, scriptlet will not match the delay but all other will be defused.\n * If do not start with `!`, the delay passed to the `setTimeout` call will be matched.\n *\n * **Examples**\n *\n * 1. Prevents `setTimeout` calls if the callback matches `/\\.test/` regardless of the delay.\n * ```bash\n * example.org#%#//scriptlet(\"prevent-setTimeout\", \"/\\.test/\")\n * ```\n *\n * For instance, the following call will be prevented:\n * ```javascript\n * setTimeout(function () {\n * window.test = \"value\";\n * }, 100);\n * ```\n *\n * 2. Prevents `setTimeout` calls if the callback does not contain `value`.\n * ```\n * example.org#%#//scriptlet(\"prevent-setTimeout\", \"!value\")\n * ```\n *\n * For instance, only the first of the following calls will be prevented:\n * ```javascript\n * setTimeout(function () {\n * window.test = \"test -- prevented\";\n * }, 300);\n * setTimeout(function () {\n * window.test = \"value -- executed\";\n * }, 400);\n * setTimeout(function () {\n * window.value = \"test -- executed\";\n * }, 500);\n * ```\n *\n * 3. Prevents `setTimeout` calls if the callback contains `value` and the delay is not set to `300`.\n * ```\n * example.org#%#//scriptlet(\"prevent-setTimeout\", \"value\", \"!300\")\n * ```\n *\n * For instance, only the first of the following calls will not be prevented:\n * ```javascript\n * setTimeout(function () {\n * window.test = \"value 1 -- executed\";\n * }, 300);\n * setTimeout(function () {\n * window.test = \"value 2 -- prevented\";\n * }, 400);\n * setTimeout(function () {\n * window.test = \"value 3 -- prevented\";\n * }, 500);\n * ```\n *\n * 4. Prevents `setTimeout` calls if the callback does not contain `value` and the delay is not set to `300`.\n * ```\n * example.org#%#//scriptlet(\"prevent-setTimeout\", \"!value\", \"!300\")\n * ```\n *\n * For instance, only the second of the following calls will be prevented:\n * ```javascript\n * setTimeout(function () {\n * window.test = \"test -- executed\";\n * }, 300);\n * setTimeout(function () {\n * window.test = \"test -- prevented\";\n * }, 400);\n * setTimeout(function () {\n * window.test = \"value -- executed\";\n * }, 400);\n * setTimeout(function () {\n * window.value = \"test -- executed\";\n * }, 500);\n * ```\n */\n/* eslint-enable max-len */\nexport function preventSetTimeout(source, match, delay) {\n const nativeTimeout = window.setTimeout;\n const nativeIsNaN = Number.isNaN || window.isNaN; // eslint-disable-line compat/compat\n const log = console.log.bind(console); // eslint-disable-line no-console\n\n // logs setTimeouts to console if no arguments have been specified\n const shouldLog = ((typeof match === 'undefined') && (typeof delay === 'undefined'));\n\n const INVERT_MARKER = '!';\n\n const isNotMatch = startsWith(match, INVERT_MARKER);\n if (isNotMatch) {\n match = match.slice(1);\n }\n const isNotDelay = startsWith(delay, INVERT_MARKER);\n if (isNotDelay) {\n delay = delay.slice(1);\n }\n\n delay = parseInt(delay, 10);\n delay = nativeIsNaN(delay) ? null : delay;\n\n match = match ? toRegExp(match) : toRegExp('/.?/');\n\n const timeoutWrapper = (callback, timeout, ...args) => {\n let shouldPrevent = false;\n if (shouldLog) {\n hit(source);\n log(`setTimeout(\"${callback.toString()}\", ${timeout})`);\n } else if (!delay) {\n shouldPrevent = match.test(callback.toString()) !== isNotMatch;\n } else if (match === '/.?/') {\n shouldPrevent = (timeout === delay) !== isNotDelay;\n } else {\n shouldPrevent = match.test(callback.toString()) !== isNotMatch\n && (timeout === delay) !== isNotDelay;\n }\n\n if (shouldPrevent) {\n hit(source);\n return nativeTimeout(noopFunc, timeout);\n }\n\n return nativeTimeout.apply(window, [callback, timeout, ...args]);\n };\n window.setTimeout = timeoutWrapper;\n}\n\npreventSetTimeout.names = [\n 'prevent-setTimeout',\n 'no-setTimeout-if.js', // new implementation of setTimeout-defuser.js\n 'ubo-no-setTimeout-if.js',\n 'setTimeout-defuser.js', // old name should be supported as well\n 'ubo-setTimeout-defuser.js',\n 'nostif.js', // new short name of no-setTimeout-if\n 'ubo-nostif.js',\n 'std.js', // old short scriptlet name\n 'ubo-std.js',\n];\n\npreventSetTimeout.injections = [toRegExp, startsWith, hit, noopFunc];\n","import {\n hit, noopFunc, toRegExp, startsWith,\n} from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet prevent-setInterval\n *\n * @description\n * Prevents a `setInterval` call if:\n * 1) the text of the callback is matching the specified `search` string/regexp which does not start with `!`;\n * otherwise mismatched calls should be defused;\n * 2) the interval is matching the specified `delay`; otherwise mismatched calls should be defused.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#no-setinterval-ifjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"prevent-setInterval\"[, [, ]])\n * ```\n *\n * **Parameters**\n *\n * Call with no arguments will log calls to setInterval while debugging (`log-setInterval` superseding),\n * so production filter lists' rules definitely require at least one of the parameters:\n * - `search` (optional) string or regular expression.\n * If starts with `!`, scriptlet will not match the stringified callback but all other will be defused.\n * If do not start with `!`, the stringified callback will be matched.\n * If not set, prevents all `setInterval` calls due to specified `delay`.\n * - `delay` (optional) must be an integer.\n * If starts with `!`, scriptlet will not match the delay but all other will be defused.\n * If do not start with `!`, the delay passed to the `setInterval` call will be matched.\n *\n * **Examples**\n *\n * 1. Prevents `setInterval` calls if the callback matches `/\\.test/` regardless of the delay.\n * ```bash\n * example.org#%#//scriptlet(\"prevent-setInterval\", \"/\\.test/\")\n * ```\n *\n * For instance, the following call will be prevented:\n * ```javascript\n * setInterval(function () {\n * window.test = \"value\";\n * }, 100);\n * ```\n *\n * 2. Prevents `setInterval` calls if the callback does not contain `value`.\n * ```\n * example.org#%#//scriptlet(\"prevent-setInterval\", \"!value\")\n * ```\n *\n * For instance, only the first of the following calls will be prevented:\n * ```javascript\n * setInterval(function () {\n * window.test = \"test -- prevented\";\n * }, 300);\n * setInterval(function () {\n * window.test = \"value -- executed\";\n * }, 400);\n * setInterval(function () {\n * window.value = \"test -- executed\";\n * }, 500);\n * ```\n *\n * 3. Prevents `setInterval` calls if the callback contains `value` and the delay is not set to `300`.\n * ```\n * example.org#%#//scriptlet(\"prevent-setInterval\", \"value\", \"!300\")\n * ```\n *\n * For instance, only the first of the following calls will not be prevented:\n * ```javascript\n * setInterval(function () {\n * window.test = \"value 1 -- executed\";\n * }, 300);\n * setInterval(function () {\n * window.test = \"value 2 -- prevented\";\n * }, 400);\n * setInterval(function () {\n * window.test = \"value 3 -- prevented\";\n * }, 500);\n * ```\n *\n * 4. Prevents `setInterval` calls if the callback does not contain `value` and the delay is not set to `300`.\n * ```\n * example.org#%#//scriptlet(\"prevent-setInterval\", \"!value\", \"!300\")\n * ```\n *\n * For instance, only the second of the following calls will be prevented:\n * ```javascript\n * setInterval(function () {\n * window.test = \"test -- executed\";\n * }, 300);\n * setInterval(function () {\n * window.test = \"test -- prevented\";\n * }, 400);\n * setInterval(function () {\n * window.test = \"value -- executed\";\n * }, 400);\n * setInterval(function () {\n * window.value = \"test -- executed\";\n * }, 500);\n * ```\n */\n/* eslint-enable max-len */\nexport function preventSetInterval(source, match, delay) {\n const nativeInterval = window.setInterval;\n const nativeIsNaN = Number.isNaN || window.isNaN; // eslint-disable-line compat/compat\n const log = console.log.bind(console); // eslint-disable-line no-console\n\n // logs setIntervals to console if no arguments have been specified\n const shouldLog = ((typeof match === 'undefined') && (typeof delay === 'undefined'));\n\n const INVERT_MARKER = '!';\n\n const isNotMatch = startsWith(match, INVERT_MARKER);\n if (isNotMatch) {\n match = match.slice(1);\n }\n const isNotDelay = startsWith(delay, INVERT_MARKER);\n if (isNotDelay) {\n delay = delay.slice(1);\n }\n\n delay = parseInt(delay, 10);\n delay = nativeIsNaN(delay) ? null : delay;\n\n match = match ? toRegExp(match) : toRegExp('/.?/');\n\n const intervalWrapper = (callback, interval, ...args) => {\n let shouldPrevent = false;\n if (shouldLog) {\n hit(source);\n log(`setInterval(\"${callback.toString()}\", ${interval})`);\n } else if (!delay) {\n shouldPrevent = match.test(callback.toString()) !== isNotMatch;\n } else if (match === '/.?/') {\n shouldPrevent = (interval === delay) !== isNotDelay;\n } else {\n shouldPrevent = match.test(callback.toString()) !== isNotMatch\n && (interval === delay) !== isNotDelay;\n }\n\n if (shouldPrevent) {\n hit(source);\n return nativeInterval(noopFunc, interval);\n }\n\n return nativeInterval.apply(window, [callback, interval, ...args]);\n };\n window.setInterval = intervalWrapper;\n}\n\npreventSetInterval.names = [\n 'prevent-setInterval',\n 'no-setInterval-if.js', // new implementation of setInterval-defuser.js\n 'ubo-no-setInterval-if.js',\n 'setInterval-defuser.js', // old name should be supported as well\n 'ubo-setInterval-defuser.js',\n 'nosiif.js', // new short name of no-setInterval-if\n 'ubo-nosiif.js',\n 'sid.js', // old short scriptlet name\n 'ubo-sid.js',\n];\n\npreventSetInterval.injections = [toRegExp, startsWith, hit, noopFunc];\n","import {\n toRegExp,\n substringBefore,\n substringAfter,\n startsWith,\n endsWith,\n hit,\n noopFunc,\n trueFunc,\n} from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet prevent-window-open\n *\n * @description\n * Prevents `window.open` calls when URL either matches or not matches the specified string/regexp. Using it without parameters prevents all `window.open` calls.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#windowopen-defuserjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet('prevent-window-open'[, [, [, ]]])\n * ```\n *\n * **Parameters**\n * - `match` (optional) defaults to \"matching\", any positive number or nothing for \"matching\", 0 or empty string for \"not matching\",\n * - `search` (optional) string or regexp for matching the URL passed to `window.open` call; defaults to search all `window.open` call.\n * - `replacement` (optional) string to return prop value or property instead of window.open; defaults to return noopFunc\n * **Example**\n *\n * 1. Prevent all `window.open` calls:\n * ```\n * example.org#%#//scriptlet('prevent-window-open')\n * ```\n *\n * 2. Prevent `window.open` for all URLs containing `example`:\n * ```\n * example.org#%#//scriptlet('prevent-window-open', '1', 'example')\n * ```\n *\n * 3. Prevent `window.open` for all URLs matching RegExp `/example\\./`:\n * ```\n * example.org#%#//scriptlet('prevent-window-open', '1', '/example\\./')\n * ```\n *\n * 4. Prevent `window.open` for all URLs **NOT** containing `example`:\n * ```\n * example.org#%#//scriptlet('prevent-window-open', '0', 'example')\n * ```\n * 5. Prevent all `window.open` calls and return 'trueFunc' instead of it if website checks it:\n * ```\n * example.org#%#//scriptlet('prevent-window-open', , , 'trueFunc')\n * ```\n * 6. Prevent all `window.open` and returns callback\n * which returns object with property 'propName'=noopFunc\n * as a property of window.open if website checks it:\n * ```\n * example.org#%#//scriptlet('prevent-window-open', '1', , '{propName=noopFunc}')\n * ```\n */\n/* eslint-enable max-len */\nexport function preventWindowOpen(source, match = 1, search, replacement) {\n // Default value of 'match' is needed to prevent all `window.open` calls\n // if the scriptlet is used without parameters\n const nativeOpen = window.open;\n\n // unary plus converts 'match' to a number\n // e.g.: +'1' -> 1; +false -> 0\n match = +match > 0;\n\n search = search\n ? toRegExp(search)\n : toRegExp('/.?/');\n\n // eslint-disable-next-line consistent-return\n const openWrapper = (str, ...args) => {\n if (match !== search.test(str)) {\n return nativeOpen.apply(window, [str, ...args]);\n }\n\n hit(source);\n\n let result;\n\n // defaults to return noopFunc instead of window.open\n if (!replacement) {\n result = noopFunc;\n } else if (replacement === 'trueFunc') {\n result = trueFunc;\n } else if (replacement.indexOf('=') > -1) {\n // We should return noopFunc instead of window.open\n // but with some property if website checks it (examples 5, 6)\n // https://github.com/AdguardTeam/Scriptlets/issues/71\n const isProp = startsWith(replacement, '{') && endsWith(replacement, '}');\n if (isProp) {\n const propertyPart = replacement.slice(1, -1);\n const propertyName = substringBefore(propertyPart, '=');\n const propertyValue = substringAfter(propertyPart, '=');\n if (propertyValue === 'noopFunc') {\n result = () => {\n const resObj = { };\n resObj[propertyName] = noopFunc;\n return resObj;\n };\n }\n }\n }\n\n return result;\n };\n\n window.open = openWrapper;\n}\n\npreventWindowOpen.names = [\n 'prevent-window-open',\n 'window.open-defuser.js',\n 'ubo-window.open-defuser.js',\n];\n\npreventWindowOpen.injections = [\n toRegExp,\n startsWith,\n endsWith,\n substringBefore,\n substringAfter,\n hit,\n noopFunc,\n trueFunc,\n];\n","import {\n randomId,\n setPropertyAccess,\n getPropertyInChain,\n toRegExp,\n createOnErrorHandler,\n hit,\n} from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet abort-current-inline-script\n *\n * @description\n * Aborts an inline script when it attempts to **read** the specified property\n * AND when the contents of the `\n * ```\n *\n * 3. Aborts inline scripts which are trying to access `window.alert` and match this regexp: `/Hello.+world/`.\n * ```\n * example.org#%#//scriptlet('abort-current-inline-script', 'alert', '/Hello.+world/')\n * ```\n *\n * For instance, the following scripts will be aborted:\n * ```html\n * \n * ```\n * ```html\n * \n * ```\n *\n * This script will not be aborted:\n * ```html\n * \n * ```\n */\n/* eslint-enable max-len */\nexport function abortCurrentInlineScript(source, property, search = null) {\n const regex = search ? toRegExp(search) : null;\n const rid = randomId();\n\n const getCurrentScript = () => {\n if (!document.currentScript) { // eslint-disable-line compat/compat\n const scripts = document.getElementsByTagName('script');\n return scripts[scripts.length - 1];\n }\n return document.currentScript; // eslint-disable-line compat/compat\n };\n\n const ourScript = getCurrentScript();\n\n const abort = () => {\n const scriptEl = getCurrentScript();\n let content = scriptEl.textContent;\n\n // We are using Node.prototype.textContent property descriptor\n // to get the real script content\n // even when document.currentScript.textContent is replaced.\n // https://github.com/AdguardTeam/Scriptlets/issues/57#issuecomment-593638991\n try {\n const textContentGetter = Object.getOwnPropertyDescriptor(Node.prototype, 'textContent').get;\n content = textContentGetter.call(scriptEl);\n } catch (e) { } // eslint-disable-line no-empty\n\n if (scriptEl instanceof HTMLScriptElement\n && content.length > 0\n && scriptEl !== ourScript\n && (!regex || regex.test(content))) {\n hit(source);\n throw new ReferenceError(rid);\n }\n };\n\n const setChainPropAccess = (owner, property) => {\n const chainInfo = getPropertyInChain(owner, property);\n let { base } = chainInfo;\n const { prop, chain } = chainInfo;\n\n // The scriptlet might be executed before the chain property has been created\n // (for instance, document.body before the HTML body was loaded).\n // In this case we're checking whether the base element exists or not\n // and if not, we simply exit without overriding anything.\n // e.g. https://github.com/AdguardTeam/Scriptlets/issues/57#issuecomment-575841092\n if (base instanceof Object === false && base === null) {\n const props = property.split('.');\n const propIndex = props.indexOf(prop);\n const baseName = props[propIndex - 1];\n console.log(`The scriptlet had been executed before the ${baseName} was loaded.`); // eslint-disable-line no-console\n return;\n }\n\n if (chain) {\n const setter = (a) => {\n base = a;\n if (a instanceof Object) {\n setChainPropAccess(a, chain);\n }\n };\n Object.defineProperty(owner, prop, {\n get: () => base,\n set: setter,\n });\n return;\n }\n\n let currentValue = base[prop];\n setPropertyAccess(base, prop, {\n set: (value) => {\n abort();\n currentValue = value;\n },\n get: () => {\n abort();\n return currentValue;\n },\n });\n };\n\n setChainPropAccess(window, property);\n\n window.onerror = createOnErrorHandler(rid)\n .bind();\n}\n\nabortCurrentInlineScript.names = [\n 'abort-current-inline-script',\n 'abort-current-inline-script.js',\n 'ubo-abort-current-inline-script.js',\n 'acis.js',\n 'ubo-acis.js',\n 'abp-abort-current-inline-script',\n];\n\nabortCurrentInlineScript.injections = [\n randomId,\n setPropertyAccess,\n getPropertyInChain,\n toRegExp,\n createOnErrorHandler,\n hit,\n];\n","import {\n hit,\n noopFunc,\n trueFunc,\n falseFunc,\n getPropertyInChain,\n setPropertyAccess,\n} from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet set-constant\n *\n * @description\n * Creates a constant property and assigns it one of the values from the predefined list.\n *\n * > Actually, it's not a constant. Please note, that it can be rewritten with a value of a different type.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#set-constantjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"set-constant\", , )\n * ```\n *\n * **Parameters**\n * - `property` (required) path to a property (joined with `.` if needed). The property must be attached to `window`.\n * - `value` (required). Possible values:\n * - positive decimal integer `<= 32767`\n * - one of the predefined constants:\n * - `undefined`\n * - `false`\n * - `true`\n * - `null`\n * - `noopFunc` - function with empty body\n * - `trueFunc` - function returning true\n * - `falseFunc` - function returning false\n * - `''` - empty string\n * - `-1` - number value `-1`\n *\n * **Examples**\n * ```\n * ! window.firstConst === false // this comparision will return true\n * example.org#%#//scriptlet(\"set-constant\", \"firstConst\", \"false\")\n *\n * ! window.secondConst() === true // call to the secondConst will return true\n * example.org#%#//scriptlet(\"set-constant\", \"secondConst\", \"trueFunc\")\n * ```\n */\n/* eslint-enable max-len */\nexport function setConstant(source, property, value) {\n if (!property) {\n return;\n }\n\n const nativeIsNaN = Number.isNaN || window.isNaN; // eslint-disable-line compat/compat\n\n let constantValue;\n if (value === 'undefined') {\n constantValue = undefined;\n } else if (value === 'false') {\n constantValue = false;\n } else if (value === 'true') {\n constantValue = true;\n } else if (value === 'null') {\n constantValue = null;\n } else if (value === 'noopFunc') {\n constantValue = noopFunc;\n } else if (value === 'trueFunc') {\n constantValue = trueFunc;\n } else if (value === 'falseFunc') {\n constantValue = falseFunc;\n } else if (/^\\d+$/.test(value)) {\n constantValue = parseFloat(value);\n if (nativeIsNaN(constantValue)) {\n return;\n }\n if (Math.abs(constantValue) > 0x7FFF) {\n return;\n }\n } else if (value === '-1') {\n constantValue = -1;\n } else if (value === '') {\n constantValue = '';\n } else {\n return;\n }\n\n let canceled = false;\n const mustCancel = (value) => {\n if (canceled) {\n return canceled;\n }\n canceled = value !== undefined\n && constantValue !== undefined\n && typeof value !== typeof constantValue;\n return canceled;\n };\n\n const setChainPropAccess = (owner, property) => {\n const chainInfo = getPropertyInChain(owner, property);\n let { base } = chainInfo;\n const { prop, chain } = chainInfo;\n if (chain) {\n const setter = (a) => {\n base = a;\n if (a instanceof Object) {\n setChainPropAccess(a, chain);\n }\n };\n Object.defineProperty(owner, prop, {\n get: () => base,\n set: setter,\n });\n return;\n }\n\n if (mustCancel(base[prop])) { return; }\n\n hit(source);\n setPropertyAccess(base, prop, {\n get: () => constantValue,\n set: (a) => {\n if (mustCancel(a)) {\n constantValue = a;\n }\n },\n });\n };\n\n setChainPropAccess(window, property);\n}\n\nsetConstant.names = [\n 'set-constant',\n 'set-constant.js',\n 'ubo-set-constant.js',\n 'set.js',\n 'ubo-set.js',\n];\nsetConstant.injections = [\n getPropertyInChain,\n setPropertyAccess,\n hit,\n noopFunc,\n trueFunc,\n falseFunc,\n];\n","import { hit, toRegExp } from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet remove-cookie\n *\n * @description\n * Removes current page cookies by passed string matching with name. For current domain and subdomains. Runs on load and before unload.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#cookie-removerjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"remove-cookie\"[, match])\n * ```\n *\n * **Parameters**\n * - `match` (optional) String or regex matching the cookie name. If not specified all accessible cookies will be removed.\n *\n * **Examples**\n * 1. Removes all cookies:\n * ```\n * example.org#%#//scriptlet(\"remove-cookie\")\n * ```\n *\n * 2. Removes cookies which name contains `example` string.\n * ```\n * example.org#%#//scriptlet(\"remove-cookie\", \"example\")\n * ```\n *\n * For instance this cookie will be removed\n * ```javascript\n * document.cookie = '__example=randomValue';\n * ```\n */\n/* eslint-enable max-len */\nexport function removeCookie(source, match) {\n const regex = match ? toRegExp(match) : toRegExp('/.?/');\n\n const removeCookieFromHost = (cookieName, hostName) => {\n const cookieSpec = `${cookieName}=`;\n const domain1 = `; domain=${hostName}`;\n const domain2 = `; domain=.${hostName}`;\n const path = '; path=/';\n const expiration = '; expires=Thu, 01 Jan 1970 00:00:00 GMT';\n document.cookie = cookieSpec + expiration;\n document.cookie = cookieSpec + domain1 + expiration;\n document.cookie = cookieSpec + domain2 + expiration;\n document.cookie = cookieSpec + path + expiration;\n document.cookie = cookieSpec + domain1 + path + expiration;\n document.cookie = cookieSpec + domain2 + path + expiration;\n hit(source);\n };\n\n const rmCookie = () => {\n document.cookie.split(';').forEach((cookieStr) => {\n const pos = cookieStr.indexOf('=');\n if (pos === -1) {\n return;\n }\n\n const cookieName = cookieStr.slice(0, pos).trim();\n if (!regex.test(cookieName)) {\n return;\n }\n\n const hostParts = document.location.hostname.split('.');\n for (let i = 0; i <= hostParts.length - 1; i += 1) {\n const hostName = hostParts.slice(i).join('.');\n if (hostName) {\n removeCookieFromHost(cookieName, hostName);\n }\n }\n });\n };\n rmCookie();\n window.addEventListener('beforeunload', rmCookie);\n}\n\nremoveCookie.names = [\n 'remove-cookie',\n 'cookie-remover.js',\n 'ubo-cookie-remover.js',\n];\n\nremoveCookie.injections = [toRegExp, hit];\n","import { hit, toRegExp } from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet prevent-addEventListener\n *\n * @description\n * Prevents adding event listeners for the specified events and callbacks.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#addeventlistener-defuserjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"prevent-addEventListener\"[, eventSearch[, functionSearch]])\n * ```\n *\n * **Parameters**\n * - `eventSearch` (optional) String or regex matching the event name. If not specified, the scriptlets prevents all event listeners.\n * - `functionSearch` (optional) String or regex matching the event listener function body. If not set, the scriptlet prevents all event listeners with event name matching `eventSearch`.\n *\n * **Examples**\n * 1. Prevent all `click` listeners:\n * ```\n * example.org#%#//scriptlet(\"prevent-addEventListener\", \"click\")\n * ```\n\n2. Prevent 'click' listeners with the callback body containing `searchString`.\n * ```\n * example.org#%#//scriptlet(\"prevent-addEventListener\", \"click\", \"searchString\")\n * ```\n *\n * For instance, this listener will not be called:\n * ```javascript\n * el.addEventListener('click', () => {\n * window.test = 'searchString';\n * });\n * ```\n */\n/* eslint-enable max-len */\nexport function preventAddEventListener(source, eventSearch, funcSearch) {\n eventSearch = eventSearch ? toRegExp(eventSearch) : toRegExp('/.?/');\n funcSearch = funcSearch ? toRegExp(funcSearch) : toRegExp('/.?/');\n\n const nativeAddEventListener = window.EventTarget.prototype.addEventListener;\n function addEventListenerWrapper(eventName, callback, ...args) {\n // The scriptlet might cause a website broke\n // if the website uses test addEventListener with callback = null\n // https://github.com/AdguardTeam/Scriptlets/issues/76\n let funcToCheck = callback;\n if (callback && typeof callback === 'function') {\n funcToCheck = callback.toString();\n }\n\n if (eventSearch.test(eventName.toString()) && funcSearch.test(funcToCheck)) {\n hit(source);\n return undefined;\n }\n return nativeAddEventListener.apply(this, [eventName, callback, ...args]);\n }\n\n window.EventTarget.prototype.addEventListener = addEventListenerWrapper;\n}\n\npreventAddEventListener.names = [\n 'prevent-addEventListener',\n 'addEventListener-defuser.js',\n 'ubo-addEventListener-defuser.js',\n 'aeld.js',\n 'ubo-aeld.js',\n];\n\npreventAddEventListener.injections = [toRegExp, hit];\n","/* eslint-disable consistent-return, no-eval */\nimport { hit } from '../helpers';\n\n/**\n * @scriptlet prevent-bab\n *\n * @description\n * Prevents BlockAdblock script from detecting an ad blocker.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#bab-defuserjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"prevent-bab\")\n * ```\n */\nexport function preventBab(source) {\n const nativeSetTimeout = window.setTimeout;\n const babRegex = /\\.bab_elementid.$/;\n\n window.setTimeout = (callback, ...args) => {\n if (typeof callback !== 'string' || !babRegex.test(callback)) {\n return nativeSetTimeout.call(this, callback, ...args);\n }\n hit(source);\n };\n\n const signatures = [\n ['blockadblock'],\n ['babasbm'],\n [/getItem\\('babn'\\)/],\n ['getElementById', 'String.fromCharCode', 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789', 'charAt', 'DOMContentLoaded', 'AdBlock', 'addEventListener', 'doScroll', 'fromCharCode', '<<2|r>>4', 'sessionStorage', 'clientWidth', 'localStorage', 'Math', 'random'],\n ];\n const check = (str) => {\n for (let i = 0; i < signatures.length; i += 1) {\n const tokens = signatures[i];\n let match = 0;\n for (let j = 0; j < tokens.length; j += 1) {\n const token = tokens[j];\n const found = token instanceof RegExp ? token.test(str) : str.indexOf(token) > -1;\n if (found) {\n match += 1;\n }\n }\n if (match / tokens.length >= 0.8) {\n return true;\n }\n }\n return false;\n };\n\n const nativeEval = window.eval;\n window.eval = (str) => {\n if (!check(str)) {\n return nativeEval(str);\n }\n hit(source);\n const bodyEl = document.body;\n if (bodyEl) {\n bodyEl.style.removeProperty('visibility');\n }\n const el = document.getElementById('babasbmsgx');\n if (el) {\n el.parentNode.removeChild(el);\n }\n };\n}\n\npreventBab.names = [\n 'prevent-bab',\n 'nobab.js',\n 'ubo-nobab.js',\n 'bab-defuser.js',\n 'ubo-bab-defuser.js',\n];\n\npreventBab.injections = [hit];\n","/* eslint-disable no-unused-vars, no-extra-bind, func-names */\nimport { hit, noopFunc } from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet nowebrtc\n *\n * @description\n * Disables WebRTC by overriding `RTCPeerConnection`. The overriden function will log every attempt to create a new connection.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#nowebrtcjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"nowebrtc\")\n * ```\n */\n/* eslint-enable max-len */\nexport function nowebrtc(source) {\n let propertyName = '';\n if (window.RTCPeerConnection) {\n propertyName = 'RTCPeerConnection';\n } else if (window.webkitRTCPeerConnection) {\n propertyName = 'webkitRTCPeerConnection';\n }\n\n if (propertyName === '') {\n return;\n }\n\n const rtcReplacement = (config) => {\n hit(source, `Document tried to create an RTCPeerConnection: ${config}`);\n };\n rtcReplacement.prototype = {\n close: noopFunc,\n createDataChannel: noopFunc,\n createOffer: noopFunc,\n setRemoteDescription: noopFunc,\n };\n const rtc = window[propertyName];\n window[propertyName] = rtcReplacement;\n if (rtc.prototype) {\n rtc.prototype.createDataChannel = function (a, b) {\n return {\n close: noopFunc,\n send: noopFunc,\n };\n }.bind(null);\n }\n}\n\nnowebrtc.names = [\n 'nowebrtc',\n 'nowebrtc.js',\n 'ubo-nowebrtc.js',\n];\n\nnowebrtc.injections = [hit, noopFunc];\n","/* eslint-disable no-console */\nimport { hit } from '../helpers';\n\n/**\n * @scriptlet log-addEventListener\n *\n * @description\n * Logs all addEventListener calls to the console.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#addeventlistener-loggerjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"log-addEventListener\")\n * ```\n */\nexport function logAddEventListener(source) {\n const log = console.log.bind(console);\n const nativeAddEventListener = window.EventTarget.prototype.addEventListener;\n function addEventListenerWrapper(eventName, callback, ...args) {\n hit(source);\n // The scriptlet might cause a website broke\n // if the website uses test addEventListener with callback = null\n // https://github.com/AdguardTeam/Scriptlets/issues/76\n let callbackToLog = callback;\n if (callback && typeof callback === 'function') {\n callbackToLog = callback.toString();\n }\n log(`addEventListener(\"${eventName}\", ${callbackToLog})`);\n return nativeAddEventListener.apply(this, [eventName, callback, ...args]);\n }\n window.EventTarget.prototype.addEventListener = addEventListenerWrapper;\n}\n\nlogAddEventListener.names = [\n 'log-addEventListener',\n 'addEventListener-logger.js',\n 'ubo-addEventListener-logger.js',\n 'aell.js',\n 'ubo-aell.js',\n];\n\nlogAddEventListener.injections = [hit];\n","/* eslint-disable no-console, no-eval */\nimport { hit } from '../helpers';\n\n/**\n * @scriptlet log-eval\n *\n * @description\n * Logs all `eval()` or `new Function()` calls to the console.\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"log-eval\")\n * ```\n */\nexport function logEval(source) {\n const log = console.log.bind(console);\n // wrap eval function\n const nativeEval = window.eval;\n function evalWrapper(str) {\n hit(source);\n log(`eval(\"${str}\")`);\n return nativeEval(str);\n }\n window.eval = evalWrapper;\n\n // wrap new Function\n const nativeFunction = window.Function;\n\n function FunctionWrapper(...args) {\n hit(source);\n log(`new Function(${args.join(', ')})`);\n return nativeFunction.apply(this, [...args]);\n }\n\n FunctionWrapper.prototype = Object.create(nativeFunction.prototype);\n FunctionWrapper.prototype.constructor = FunctionWrapper;\n\n window.Function = FunctionWrapper;\n}\n\nlogEval.names = [\n 'log-eval',\n];\n\nlogEval.injections = [hit];\n","/**\n * @scriptlet log\n *\n * @description\n * A simple scriptlet which only purpose is to print arguments to console.\n * This scriptlet can be helpful for debugging and troubleshooting other scriptlets.\n * **Example**\n * ```\n * example.org#%#//scriptlet(\"log\", \"arg1\", \"arg2\")\n * ```\n */\nexport function log(...args) {\n console.log(args); // eslint-disable-line no-console\n}\nlog.names = ['log'];\n","/* eslint-disable no-eval, no-extra-bind */\nimport { hit } from '../helpers';\n\n/**\n * @scriptlet noeval\n *\n * @description\n * Prevents page to use eval.\n * Notifies about attempts in the console\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#noevaljs-\n *\n * It also can be used as `$redirect` rules sometimes.\n * See [redirect description](../wiki/about-redirects.md#noeval).\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"noeval\")\n * ```\n */\nexport function noeval(source) {\n window.eval = function evalWrapper(s) {\n hit(source, `AdGuard has prevented eval:\\n${s}`);\n }.bind();\n}\n\nnoeval.names = [\n 'noeval',\n 'noeval.js',\n 'silent-noeval.js',\n 'ubo-noeval.js',\n 'ubo-silent-noeval.js',\n];\n\nnoeval.injections = [hit];\n","/* eslint-disable no-eval, no-extra-bind, func-names */\n\nimport { toRegExp, hit } from '../helpers';\n\n/**\n * @scriptlet prevent-eval-if\n *\n * @description\n * Prevents page to use eval matching payload.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#noeval-ifjs-\n *\n * **Parameters**\n * - `search` string or regexp matching stringified eval payload\n *\n * **Examples**\n * ```\n * !\n * ```\n *\n * @param {string|RegExp} [search] string or regexp matching stringified eval payload\n */\nexport function preventEvalIf(source, search) {\n search = search ? toRegExp(search) : toRegExp('/.?/');\n\n const nativeEval = window.eval;\n window.eval = function (payload) {\n if (!search.test(payload.toString())) {\n return nativeEval.call(window, payload);\n }\n hit(source, payload);\n return undefined;\n }.bind(window);\n}\n\npreventEvalIf.names = [\n 'prevent-eval-if',\n 'noeval-if.js',\n 'ubo-noeval-if.js',\n];\n\npreventEvalIf.injections = [toRegExp, hit];\n","/* eslint-disable no-console, func-names, no-multi-assign */\nimport { hit, noopFunc, noopThis } from '../helpers';\n\n/**\n * @scriptlet prevent-fab-3.2.0\n *\n * @description\n * Prevents execution of the FAB script v3.2.0.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#fuckadblockjs-320-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"prevent-fab-3.2.0\")\n * ```\n */\nexport function preventFab(source) {\n hit(source);\n const Fab = function () {};\n Fab.prototype.check = noopFunc;\n Fab.prototype.clearEvent = noopFunc;\n Fab.prototype.emitEvent = noopFunc;\n Fab.prototype.on = function (a, b) {\n if (!a) {\n b();\n }\n return this;\n };\n Fab.prototype.onDetected = noopThis;\n Fab.prototype.onNotDetected = function (a) {\n a();\n return this;\n };\n Fab.prototype.setOption = noopFunc;\n window.FuckAdBlock = window.BlockAdBlock = Fab;\n //\n window.fuckAdBlock = window.blockAdBlock = new Fab();\n}\n\npreventFab.names = [\n 'prevent-fab-3.2.0',\n 'nofab.js',\n 'ubo-nofab.js',\n 'fuckadblock.js-3.2.0',\n 'ubo-fuckadblock.js-3.2.0',\n];\n\npreventFab.injections = [hit, noopFunc, noopThis];\n","/* eslint-disable no-console, func-names, no-multi-assign */\nimport { hit } from '../helpers';\n\n/**\n * @scriptlet set-popads-dummy\n *\n * @description\n * Sets static properties PopAds and popns.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#popads-dummyjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"set-popads-dummy\")\n * ```\n */\nexport function setPopadsDummy(source) {\n delete window.PopAds;\n delete window.popns;\n Object.defineProperties(window, {\n PopAds: {\n get: () => {\n hit(source);\n return {};\n },\n },\n popns: {\n get: () => {\n hit(source);\n return {};\n },\n },\n });\n}\n\nsetPopadsDummy.names = [\n 'set-popads-dummy',\n 'popads-dummy.js',\n 'ubo-popads-dummy.js',\n];\n\nsetPopadsDummy.injections = [hit];\n","import {\n hit, createOnErrorHandler, randomId,\n} from '../helpers';\n\n/**\n * @scriptlet prevent-popads-net\n *\n * @description\n * Aborts on property write (PopAds, popns), throws reference error with random id.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#popadsnetjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"prevent-popads-net\")\n * ```\n */\nexport function preventPopadsNet(source) {\n const rid = randomId();\n\n const throwError = () => {\n throw new ReferenceError(rid);\n };\n\n delete window.PopAds;\n delete window.popns;\n Object.defineProperties(window, {\n PopAds: { set: throwError },\n popns: { set: throwError },\n });\n\n window.onerror = createOnErrorHandler(rid).bind();\n hit(source);\n}\n\npreventPopadsNet.names = [\n 'prevent-popads-net',\n 'popads.net.js',\n 'ubo-popads.net.js',\n];\n\npreventPopadsNet.injections = [createOnErrorHandler, randomId, hit];\n","/* eslint-disable func-names */\nimport { hit, setPropertyAccess } from '../helpers';\n\n/**\n * @scriptlet prevent-adfly\n *\n * @description\n * Prevents anti-adblock scripts on adfly short links.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#adfly-defuserjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"prevent-adfly\")\n * ```\n */\nexport function preventAdfly(source) {\n const isDigit = (data) => /^\\d$/.test(data);\n const handler = function (encodedURL) {\n let evenChars = '';\n let oddChars = '';\n for (let i = 0; i < encodedURL.length; i += 1) {\n if (i % 2 === 0) {\n evenChars += encodedURL.charAt(i);\n } else {\n oddChars = encodedURL.charAt(i) + oddChars;\n }\n }\n\n let data = (evenChars + oddChars).split('');\n\n for (let i = 0; i < data.length; i += 1) {\n if (isDigit(data[i])) {\n for (let ii = i + 1; ii < data.length; ii += 1) {\n if (isDigit(data[ii])) {\n // eslint-disable-next-line no-bitwise\n const temp = parseInt(data[i], 10) ^ parseInt(data[ii], 10);\n if (temp < 10) {\n data[i] = temp.toString();\n }\n i = ii;\n break;\n }\n }\n }\n }\n data = data.join('');\n const decodedURL = window.atob(data).slice(16, -16);\n /* eslint-disable compat/compat */\n if (window.stop) {\n window.stop();\n }\n /* eslint-enable compat/compat */\n window.onbeforeunload = null;\n window.location.href = decodedURL;\n };\n\n let val;\n // Do not apply handler more than one time\n let applyHandler = true;\n\n const result = setPropertyAccess(window, 'ysmm', {\n configurable: false,\n set: (value) => {\n if (applyHandler) {\n applyHandler = false;\n try {\n if (typeof value === 'string') {\n handler(value);\n }\n } catch (err) { } // eslint-disable-line no-empty\n }\n val = value;\n },\n get: () => val,\n });\n\n if (result) {\n hit(source);\n } else {\n window.console.error('Failed to set up prevent-adfly scriptlet');\n }\n}\n\npreventAdfly.names = [\n 'prevent-adfly',\n 'adfly-defuser.js',\n 'ubo-adfly-defuser.js',\n];\n\npreventAdfly.injections = [setPropertyAccess, hit];\n","import {\n randomId,\n setPropertyAccess,\n getPropertyInChain,\n createOnErrorHandler,\n hit,\n noopFunc,\n} from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet debug-on-property-read\n *\n * @description\n * This scriptlet is basically the same as [abort-on-property-read](#abort-on-property-read), but instead of aborting it starts the debugger.\n *\n * **It is not supposed to be used in production filter lists!**\n *\n * **Syntax**\n * ```\n * ! Aborts script when it tries to access `window.alert`\n * example.org#%#//scriptlet(\"debug-on-property-read\", \"alert\")\n * ```\n */\n/* eslint-enable max-len */\nexport function debugOnPropertyRead(source, property) {\n if (!property) {\n return;\n }\n const rid = randomId();\n const abort = () => {\n hit(source);\n // eslint-disable-next-line no-debugger\n debugger;\n };\n const setChainPropAccess = (owner, property) => {\n const chainInfo = getPropertyInChain(owner, property);\n let { base } = chainInfo;\n const { prop, chain } = chainInfo;\n if (chain) {\n const setter = (a) => {\n base = a;\n if (a instanceof Object) {\n setChainPropAccess(a, chain);\n }\n };\n Object.defineProperty(owner, prop, {\n get: () => base,\n set: setter,\n });\n return;\n }\n\n setPropertyAccess(base, prop, {\n get: abort,\n set: noopFunc,\n });\n };\n\n setChainPropAccess(window, property);\n\n window.onerror = createOnErrorHandler(rid)\n .bind();\n}\n\ndebugOnPropertyRead.names = [\n 'debug-on-property-read',\n];\ndebugOnPropertyRead.injections = [\n randomId,\n setPropertyAccess,\n getPropertyInChain,\n createOnErrorHandler,\n hit,\n noopFunc,\n];\n","import {\n randomId,\n setPropertyAccess,\n getPropertyInChain,\n createOnErrorHandler,\n hit,\n} from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet debug-on-property-write\n *\n * @description\n * This scriptlet is basically the same as [abort-on-property-write](#abort-on-property-write), but instead of aborting it starts the debugger.\n *\n * **It is not supposed to be used in production filter lists!**\n *\n * **Syntax**\n * ```\n * ! Aborts script when it tries to write in property `window.test`\n * example.org#%#//scriptlet(\"debug-on-property-write\", \"test\")\n * ```\n */\n/* eslint-enable max-len */\nexport function debugOnPropertyWrite(source, property) {\n if (!property) {\n return;\n }\n const rid = randomId();\n const abort = () => {\n hit(source);\n // eslint-disable-next-line no-debugger\n debugger;\n };\n const setChainPropAccess = (owner, property) => {\n const chainInfo = getPropertyInChain(owner, property);\n let { base } = chainInfo;\n const { prop, chain } = chainInfo;\n if (chain) {\n const setter = (a) => {\n base = a;\n if (a instanceof Object) {\n setChainPropAccess(a, chain);\n }\n };\n Object.defineProperty(owner, prop, {\n get: () => base,\n set: setter,\n });\n return;\n }\n\n setPropertyAccess(base, prop, { set: abort });\n };\n\n setChainPropAccess(window, property);\n\n window.onerror = createOnErrorHandler(rid).bind();\n}\n\ndebugOnPropertyWrite.names = [\n 'debug-on-property-write',\n];\n\ndebugOnPropertyWrite.injections = [\n randomId,\n setPropertyAccess,\n getPropertyInChain,\n createOnErrorHandler,\n hit,\n];\n","import {\n randomId,\n setPropertyAccess,\n getPropertyInChain,\n toRegExp,\n createOnErrorHandler,\n hit,\n} from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet debug-current-inline-script\n *\n * @description\n * This scriptlet is basically the same as [abort-current-inline-script](#abort-current-inline-script), but instead of aborting it starts the debugger.\n *\n * **It is not supposed to be used in production filter lists!**\n *\n * **Syntax**\n *```\n * ! Aborts script when it tries to access `window.alert`\n * example.org#%#//scriptlet(\"debug-current-inline-script\", \"alert\")\n * ```\n */\n/* eslint-enable max-len */\nexport function debugCurrentInlineScript(source, property, search = null) {\n const regex = search ? toRegExp(search) : null;\n const rid = randomId();\n\n const getCurrentScript = () => {\n if (!document.currentScript) { // eslint-disable-line compat/compat\n const scripts = document.getElementsByTagName('script');\n return scripts[scripts.length - 1];\n }\n return document.currentScript; // eslint-disable-line compat/compat\n };\n\n const ourScript = getCurrentScript();\n\n const abort = () => {\n const scriptEl = getCurrentScript();\n if (scriptEl instanceof HTMLScriptElement\n && scriptEl.textContent.length > 0\n && scriptEl !== ourScript\n && (!regex || regex.test(scriptEl.textContent))) {\n hit(source);\n // eslint-disable-next-line no-debugger\n debugger;\n }\n };\n\n const setChainPropAccess = (owner, property) => {\n const chainInfo = getPropertyInChain(owner, property);\n let { base } = chainInfo;\n const { prop, chain } = chainInfo;\n if (chain) {\n const setter = (a) => {\n base = a;\n if (a instanceof Object) {\n setChainPropAccess(a, chain);\n }\n };\n Object.defineProperty(owner, prop, {\n get: () => base,\n set: setter,\n });\n return;\n }\n\n let currentValue = base[prop];\n setPropertyAccess(base, prop, {\n set: (value) => {\n abort();\n currentValue = value;\n },\n get: () => {\n abort();\n return currentValue;\n },\n });\n };\n\n setChainPropAccess(window, property);\n\n window.onerror = createOnErrorHandler(rid)\n .bind();\n}\n\ndebugCurrentInlineScript.names = [\n 'debug-current-inline-script',\n];\n\ndebugCurrentInlineScript.injections = [\n randomId,\n setPropertyAccess,\n getPropertyInChain,\n toRegExp,\n createOnErrorHandler,\n hit,\n];\n","import { hit, observeDOMChanges } from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet remove-attr\n *\n * @description\n * Removes the specified attributes from DOM nodes. This scriptlet runs once when the page loads\n * and after that periodically in order to DOM tree changes.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#remove-attrjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet('remove-attr', attrs[, selector])\n * ```\n *\n * - `attrs` — required, attribute or list of attributes joined by '|';\n * - `selector` — optional, CSS selector, specifies DOM nodes from which the attributes will be removed\n *\n * **Examples**\n * 1. Removes by attribute\n * ```\n * example.org#%#//scriptlet('remove-attr', 'example|test')\n * ```\n *\n * ```html\n * \n *
Some text
\n *\n * \n *
Some text
\n * ```\n *\n * 2. Removes with specified selector\n * ```\n * example.org#%#//scriptlet('remove-attr', 'example', 'div[class=\"inner\"]')\n * ```\n *\n * ```html\n * \n *
\n *
Some text
\n *
\n *\n * \n *
\n *
Some text
\n *
\n * ```\n */\n/* eslint-enable max-len */\nexport function removeAttr(source, attrs, selector) {\n if (!attrs) { return; }\n attrs = attrs.split(/\\s*\\|\\s*/);\n if (!selector) {\n selector = `[${attrs.join('],[')}]`;\n }\n\n const rmattr = () => {\n const nodes = [].slice.call(document.querySelectorAll(selector));\n let removed = false;\n nodes.forEach((node) => {\n attrs.forEach((attr) => {\n node.removeAttribute(attr);\n removed = true;\n });\n });\n if (removed) {\n hit(source);\n }\n };\n\n rmattr();\n\n // 'true' for observing attributes\n observeDOMChanges(rmattr, true);\n}\n\nremoveAttr.names = [\n 'remove-attr',\n 'remove-attr.js',\n 'ubo-remove-attr.js',\n 'ra.js',\n 'ubo-ra.js',\n];\n\nremoveAttr.injections = [hit, observeDOMChanges];\n","import { hit, observeDOMChanges } from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet remove-class\n *\n * @description\n * Removes the specified classes from DOM nodes. This scriptlet runs once after the page loads\n * and after that periodically in order to DOM tree changes.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#remove-classjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet('remove-class', classes[, selector])\n * ```\n *\n * - `classes` — required, class or list of classes separated by '|';\n * - `selector` — optional, CSS selector, specifies DOM nodes from which the classes will be removed;\n * if there is no selector, every class independently will be removed from all nodes which has one\n *\n * **Examples**\n * 1. Removes by classes\n * ```\n * example.org#%#//scriptlet('remove-class', 'example|test')\n * ```\n *\n * ```html\n * \n *
Some text
\n *
Some text
\n *
Some text
\n *\n * \n *
Some text
\n *
Some text
\n *
Some text
\n * ```\n *\n * 2. Removes with specified selector\n * ```\n * example.org#%#//scriptlet('remove-class', 'branding', 'div[class=\"inner\"]')\n * ```\n *\n * ```html\n * \n *
\n *
Some text
\n *
\n *\n * \n *
\n *
Some text
\n *
\n * ```\n */\n/* eslint-enable max-len */\n\n\nexport function removeClass(source, classNames, selector) {\n if (!classNames) { return; }\n classNames = classNames.split(/\\s*\\|\\s*/);\n let selectors = [];\n if (!selector) {\n selectors = classNames.map((className) => {\n return `.${className}`;\n });\n }\n\n const removeClassHandler = () => {\n const nodes = new Set();\n if (selector) {\n const foundedNodes = [].slice.call(document.querySelectorAll(selector));\n foundedNodes.forEach((n) => nodes.add(n));\n } else if (selectors.length > 0) {\n selectors.forEach((s) => {\n const elements = document.querySelectorAll(s);\n for (let i = 0; i < elements.length; i += 1) {\n const element = elements[i];\n nodes.add(element);\n }\n });\n }\n\n let removed = false;\n\n nodes.forEach((node) => {\n classNames.forEach((className) => {\n if (node.classList.contains(className)) {\n node.classList.remove(className);\n removed = true;\n }\n });\n });\n\n if (removed) {\n hit(source);\n }\n };\n\n removeClassHandler();\n\n const CLASS_ATTR_NAME = ['class'];\n // 'true' for observing attributes\n // 'class' for observing only classes\n observeDOMChanges(removeClassHandler, true, CLASS_ATTR_NAME);\n}\n\nremoveClass.names = [\n 'remove-class',\n];\n\nremoveClass.injections = [hit, observeDOMChanges];\n","import { hit } from '../helpers';\n\n/**\n * @scriptlet disable-newtab-links\n *\n * @description\n * Prevents opening new tabs and windows if there is `target` attribute in element.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#disable-newtab-linksjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"disable-newtab-links\")\n * ```\n */\nexport function disableNewtabLinks(source) {\n document.addEventListener('click', (ev) => {\n let { target } = ev;\n while (target !== null) {\n if (target.localName === 'a' && target.hasAttribute('target')) {\n ev.stopPropagation();\n ev.preventDefault();\n hit(source);\n break;\n }\n target = target.parentNode;\n }\n });\n}\n\ndisableNewtabLinks.names = [\n 'disable-newtab-links',\n 'disable-newtab-links.js',\n 'ubo-disable-newtab-links.js',\n];\n\ndisableNewtabLinks.injections = [\n hit,\n];\n","import { hit, toRegExp } from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet adjust-setInterval\n *\n * @description\n * Adjusts interval for specified setInterval() callbacks.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#nano-setinterval-boosterjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"adjust-setInterval\"[, match [, interval[, boost]]])\n * ```\n *\n * - `match` - optional, string/regular expression, matching in stringified callback function\n * - `interval` - optional, defaults to 1000, decimal integer, matching interval\n * - `boost` - optional, default to 0.05, float, capped at 50 times for up and down, interval multiplier\n *\n * **Examples**\n * 1. Adjust all setInterval() x20 times where interval equal 1000ms:\n * ```\n * example.org#%#//scriptlet(\"adjust-setInterval\")\n * ```\n *\n * 2. Adjust all setInterval() x20 times where callback mathed with `example` and interval equal 1000ms\n * ```\n * example.org#%#//scriptlet(\"adjust-setInterval\", \"example\")\n * ```\n *\n * 3. Adjust all setInterval() x20 times where callback mathed with `example` and interval equal 400ms\n * ```\n * example.org#%#//scriptlet(\"adjust-setInterval\", \"example\", \"400\")\n * ```\n *\n * 4. Slow down setInterval() x2 times where callback matched with `example` and interval equal 400ms\n * ```\n * example.org#%#//scriptlet(\"adjust-setInterval\", \"example\", \"400\", \"2\")\n * ```\n */\n/* eslint-enable max-len */\nexport function adjustSetInterval(source, match, interval, boost) {\n const nativeInterval = window.setInterval;\n const nativeIsNaN = Number.isNaN || window.isNaN; // eslint-disable-line compat/compat\n const nativeIsFinite = Number.isFinite || window.isFinite; // eslint-disable-line compat/compat\n\n interval = parseInt(interval, 10);\n interval = nativeIsNaN(interval) ? 1000 : interval;\n\n boost = parseInt(boost, 10);\n boost = nativeIsNaN(interval) || !nativeIsFinite(boost) ? 0.05 : boost;\n\n match = match ? toRegExp(match) : toRegExp('/.?/');\n\n if (boost < 0.02) {\n boost = 0.02;\n }\n if (boost > 50) {\n boost = 50;\n }\n\n const intervalWrapper = (cb, d, ...args) => {\n if (d === interval && match.test(cb.toString())) {\n d *= boost;\n hit(source);\n }\n return nativeInterval.apply(window, [cb, d, ...args]);\n };\n window.setInterval = intervalWrapper;\n}\n\nadjustSetInterval.names = [\n 'adjust-setInterval',\n 'nano-setInterval-booster.js',\n 'ubo-nano-setInterval-booster.js',\n 'nano-sib.js',\n 'ubo-nano-sib.js',\n];\n\nadjustSetInterval.injections = [toRegExp, hit];\n","import { hit, toRegExp } from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet adjust-setTimeout\n *\n * @description\n * Adjusts timeout for specified setTimout() callbacks.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#nano-settimeout-boosterjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"adjust-setTimeout\"[, match [, timeout[, boost]]])\n * ```\n *\n * - `match` - optional, string/regular expression, matching in stringified callback function\n * - `timeout` - optional, defaults to 1000, decimal integer, matching interval\n * - `boost` - optional, default to 0.05, float, capped at 50 times for up and down, interval multiplier\n *\n * **Examples**\n * 1. Adjust all setTimeout() x20 times where interval equal 1000ms:\n * ```\n * example.org#%#//scriptlet(\"adjust-setTimeout\")\n * ```\n *\n * 2. Adjust all setTimeout() x20 times where callback mathed with `example` and interval equal 1000ms\n * ```\n * example.org#%#//scriptlet(\"adjust-setTimeout\", \"example\")\n * ```\n *\n * 3. Adjust all setTimeout() x20 times where callback mathed with `example` and interval equal 400ms\n * ```\n * example.org#%#//scriptlet(\"adjust-setTimeout\", \"example\", \"400\")\n * ```\n *\n * 4. Slow down setTimeout() x2 times where callback matched with `example` and interval equal 400ms\n * ```\n * example.org#%#//scriptlet(\"adjust-setTimeout\", \"example\", \"400\", \"2\")\n * ```\n */\n/* eslint-enable max-len */\nexport function adjustSetTimeout(source, match, timeout, boost) {\n const nativeTimeout = window.setTimeout;\n const nativeIsNaN = Number.isNaN || window.isNaN; // eslint-disable-line compat/compat\n const nativeIsFinite = Number.isFinite || window.isFinite; // eslint-disable-line compat/compat\n\n timeout = parseInt(timeout, 10);\n timeout = nativeIsNaN(timeout) ? 1000 : timeout;\n\n boost = parseInt(boost, 10);\n boost = nativeIsNaN(timeout) || !nativeIsFinite(boost) ? 0.05 : boost;\n\n match = match ? toRegExp(match) : toRegExp('/.?/');\n\n if (boost < 0.02) {\n boost = 0.02;\n }\n if (boost > 50) {\n boost = 50;\n }\n\n const timeoutWrapper = (cb, d, ...args) => {\n if (d === timeout && match.test(cb.toString())) {\n d *= boost;\n hit(source);\n }\n return nativeTimeout.apply(window, [cb, d, ...args]);\n };\n window.setTimeout = timeoutWrapper;\n}\n\nadjustSetTimeout.names = [\n 'adjust-setTimeout',\n 'nano-setTimeout-booster.js',\n 'ubo-nano-setTimeout-booster.js',\n 'nano-stb.js',\n 'ubo-nano-stb.js',\n];\n\nadjustSetTimeout.injections = [toRegExp, hit];\n","import { hit } from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet dir-string\n *\n * @description\n * Wraps the `console.dir` API to call the `toString` method of the argument.\n * There are several adblock circumvention systems that detect browser devtools\n * and hide themselves. Therefore, if we force them to think\n * that devtools are open (using this scrciptlet),\n * it will automatically disable the adblock circumvention script.\n *\n * Related ABP source:\n * https://github.com/adblockplus/adblockpluscore/blob/6b2a309054cc23432102b85d13f12559639ef495/lib/content/snippets.js#L766\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"dir-string\"[, times])\n * ```\n * - `times` - optional, the number of times to call the `toString` method of the argument to `console.dir`\n *\n * **Example**\n * ```\n * ! Run 2 times\n * example.org#%#//scriptlet(\"dir-string\", \"2\")\n * ```\n */\n/* eslint-enable max-len */\nexport function dirString(source, times) {\n const { dir } = console;\n times = parseInt(times, 10);\n\n function dirWrapper(object) {\n // eslint-disable-next-line no-unused-vars\n let temp;\n for (let i = 0; i < times; i += 1) {\n // eslint-disable-next-line no-unused-expressions\n temp = `${object}`;\n }\n if (typeof dir === 'function') {\n dir.call(this, object);\n }\n hit(source, temp);\n }\n // eslint-disable-next-line no-console\n console.dir = dirWrapper;\n}\n\ndirString.names = [\n 'dir-string',\n 'abp-dir-string',\n];\n\ndirString.injections = [hit];\n","import { hit, getPropertyInChain } from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet json-prune\n *\n * @description\n * Removes specified properties from the result of calling JSON.parse and returns the caller\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"json-prune\"[, propsToRemove [, obligatoryProps]])\n * ```\n *\n * - `propsToRemove` - string of space-separated properties to remove\n * - `obligatoryProps` - optional, string of space-separated properties which must be all present for the pruning to occur\n *\n * **Examples**\n * 1. Removes property `example` from the results of JSON.parse call\n * ```\n * example.org#%#//scriptlet(\"json-prune\", \"example\")\n * ```\n *\n * For instance, the following call will return `{ one: 1}`\n *\n * ```html\n * JSON.parse('{\"one\":1,\"example\":true}')\n * ```\n *\n * 2. If there are no specified properties in the result of JSON.parse call, pruning will NOT occur\n * ```\n * example.org#%#//scriptlet(\"json-prune\", \"one\", \"obligatoryProp\")\n * ```\n *\n * For instance, the following call will return `{ one: 1, two: 2}`\n *\n * ```html\n * JSON.parse('{\"one\":1,\"two\":2}')\n * ```\n *\n * 3. A property in a list of properties can be a chain of properties\n *\n * ```\n * example.org#%#//scriptlet(\"json-prune\", \"a.b\", \"adpath.url.first\")\n * ```\n *\n * 4. Call with no arguments will log the current hostname and json payload at the console\n * ```\n * example.org#%#//scriptlet(\"json-prune\")\n * ```\n */\n/* eslint-enable max-len */\nexport function jsonPrune(source, propsToRemove, requiredInitialProps) {\n // eslint-disable-next-line no-console\n const log = console.log.bind(console);\n const prunePaths = propsToRemove !== undefined && propsToRemove !== ''\n ? propsToRemove.split(/ +/)\n : [];\n const needlePaths = requiredInitialProps !== undefined && requiredInitialProps !== ''\n ? requiredInitialProps.split(/ +/)\n : [];\n\n function isPruningNeeded(root) {\n if (!root) {\n return false;\n }\n\n for (let i = 0; i < needlePaths.length; i += 1) {\n const needlePath = needlePaths[i];\n const details = getPropertyInChain(root, needlePath, false);\n const nestedPropName = needlePath.split('.').pop();\n if (details && details.base[nestedPropName] === undefined) {\n return false;\n }\n }\n return true;\n }\n\n const nativeParse = JSON.parse;\n\n const parseWrapper = (...args) => {\n const r = nativeParse.apply(window, args);\n if (prunePaths.length === 0) {\n log(window.location.hostname, r);\n return r;\n }\n if (isPruningNeeded(r) === false) {\n return r;\n }\n prunePaths.forEach((path) => {\n const ownerObj = getPropertyInChain(r, path, false);\n if (ownerObj !== undefined && ownerObj.base) {\n delete ownerObj.base[ownerObj.prop];\n }\n });\n hit(source);\n return r;\n };\n\n JSON.parse = parseWrapper;\n}\n\n\njsonPrune.names = [\n 'json-prune',\n 'json-prune.js',\n 'ubo-json-prune.js',\n];\n\njsonPrune.injections = [hit, getPropertyInChain];\n","import {\n hit, startsWith, toRegExp, noopFunc,\n} from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet prevent-requestAnimationFrame\n *\n * @description\n * Prevents a `requestAnimationFrame` call\n * if the text of the callback is matching the specified search string which does not start with `!`;\n * otherwise mismatched calls should be defused.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#requestanimationframe-ifjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet('prevent-requestAnimationFrame'[, ])\n * ```\n *\n * **Parameters**\n *\n * - `search` (optional) string or regular expression.\n * If starts with `!`, scriptlet will not match the stringified callback but all other will be defused.\n * If do not start with `!`, the stringified callback will be matched.\n *\n * Call with no argument will log all requestAnimationFrame calls while debugging.\n * So do not use the scriptlet without any parameter in production filter lists.\n *\n * **Examples**\n *\n * 1. Prevents `requestAnimationFrame` calls if the callback matches `/\\.test/`.\n * ```bash\n * example.org#%#//scriptlet('prevent-requestAnimationFrame', '/\\.test/')\n * ```\n *\n * For instance, the following call will be prevented:\n * ```javascript\n * var times = 0;\n * requestAnimationFrame(function change() {\n * window.test = 'new value';\n * if (times < 2) {\n * times += 1;\n * requestAnimationFrame(change);\n * }\n * });\n * ```\n * 2. Prevents `requestAnimationFrame` calls if **does not match** 'check'.\n * ```bash\n * example.org#%#//scriptlet('prevent-requestAnimationFrame', '!check')\n * ```\n *\n * For instance, only the first call will be prevented:\n *\n * ```javascript\n * var timesFirst = 0;\n * requestAnimationFrame(function changeFirst() {\n * window.check = 'should not be prevented';\n * if (timesFirst < 2) {\n * timesFirst += 1;\n * requestAnimationFrame(changeFirst);\n * }\n * });\n *\n * var timesSecond = 0;\n * requestAnimationFrame(function changeSecond() {\n * window.second = 'should be prevented';\n * if (timesSecond < 2) {\n * timesSecond += 1;\n * requestAnimationFrame(changeSecond);\n * }\n * });\n * ```\n */\n/* eslint-enable max-len */\n\nexport function preventRequestAnimationFrame(source, match) {\n const nativeRequestAnimationFrame = window.requestAnimationFrame;\n\n // logs requestAnimationFrame to console if no arguments have been specified\n const shouldLog = typeof match === 'undefined';\n\n const INVERT_MARKER = '!';\n\n const doNotMatch = startsWith(match, INVERT_MARKER);\n if (doNotMatch) {\n match = match.slice(1);\n }\n\n match = match ? toRegExp(match) : toRegExp('/.?/');\n\n const rafWrapper = (callback, ...args) => {\n let shouldPrevent = false;\n if (shouldLog) {\n const logMessage = `log: requestAnimationFrame(\"${callback.toString()}\")`;\n hit(source, logMessage);\n } else {\n shouldPrevent = match.test(callback.toString()) !== doNotMatch;\n }\n\n if (shouldPrevent) {\n hit(source);\n return nativeRequestAnimationFrame(noopFunc);\n }\n\n return nativeRequestAnimationFrame.apply(window, [callback, ...args]);\n };\n\n window.requestAnimationFrame = rafWrapper;\n}\n\npreventRequestAnimationFrame.names = [\n 'prevent-requestAnimationFrame',\n 'requestAnimationFrame-if.js',\n 'ubo-requestAnimationFrame-if.js',\n 'raf-if.js',\n 'ubo-raf-if.js',\n];\n\npreventRequestAnimationFrame.injections = [hit, startsWith, toRegExp, noopFunc];\n","/**\n * This file must export all scriptlets which should be accessible\n */\nexport * from './abort-on-property-read';\nexport * from './abort-on-property-write';\nexport * from './prevent-setTimeout';\nexport * from './prevent-setInterval';\nexport * from './prevent-window-open';\nexport * from './abort-current-inline-script';\nexport * from './set-constant';\nexport * from './remove-cookie';\nexport * from './prevent-addEventListener';\nexport * from './prevent-bab';\nexport * from './nowebrtc';\nexport * from './log-addEventListener';\nexport * from './log-eval';\nexport * from './log';\nexport * from './noeval';\nexport * from './prevent-eval-if';\nexport * from './prevent-fab-3.2.0';\nexport * from './set-popads-dummy';\nexport * from './prevent-popads-net';\nexport * from './prevent-adfly';\nexport * from './debug-on-property-read';\nexport * from './debug-on-property-write';\nexport * from './debug-current-inline-script';\nexport * from './remove-attr';\nexport * from './remove-class';\nexport * from './disable-newtab-links';\nexport * from './adjust-setInterval';\nexport * from './adjust-setTimeout';\nexport * from './dir-string';\nexport * from './json-prune';\nexport * from './prevent-requestAnimationFrame';\n","import {\n startsWith,\n substringAfter,\n} from './string-utils';\n\nimport { ADG_SCRIPTLET_MASK } from './parse-rule';\n\nimport * as scriptletsList from '../scriptlets/scriptletsList';\n\nimport { redirects } from '../../scripts/compatibility-table.json';\n\nconst JS_RULE_MASK = '#%#';\nconst COMMENT_MARKER = '!';\n\n/**\n * Checks if rule text is comment e.g. !!example.org##+js(set-constant.js, test, false)\n * @param {string} rule\n * @return {boolean}\n */\nconst isComment = (rule) => startsWith(rule, COMMENT_MARKER);\n\n\n/* ************************************************************************\n *\n * Scriptlets\n *\n ************************************************************************** */\n\n\n/**\n * uBlock scriptlet rule mask\n */\nconst UBO_SCRIPTLET_MASK_REG = /#@?#script:inject|#@?#\\s*\\+js/;\nconst UBO_SCRIPTLET_MASK_1 = '##+js';\nconst UBO_SCRIPTLET_MASK_2 = '##script:inject';\nconst UBO_SCRIPTLET_EXCEPTION_MASK_1 = '#@#+js';\nconst UBO_SCRIPTLET_EXCEPTION_MASK_2 = '#@#script:inject';\n\n/**\n * AdBlock Plus snippet rule mask\n */\nconst ABP_SCRIPTLET_MASK = '#$#';\nconst ABP_SCRIPTLET_EXCEPTION_MASK = '#@$#';\n\n/**\n * AdGuard CSS rule mask\n */\nconst ADG_CSS_MASK_REG = /#@?\\$#.+?\\s*\\{.*\\}\\s*$/g;\n\n\n/**\n * Checks if the `rule` is AdGuard scriptlet rule\n * @param {string} rule - rule text\n */\nconst isAdgScriptletRule = (rule) => {\n return (\n !isComment(rule)\n && rule.indexOf(ADG_SCRIPTLET_MASK) > -1\n );\n};\n\n/**\n * Checks if the `rule` is uBO scriptlet rule\n * @param {string} rule rule text\n */\nconst isUboScriptletRule = (rule) => {\n return (\n rule.indexOf(UBO_SCRIPTLET_MASK_1) > -1\n || rule.indexOf(UBO_SCRIPTLET_MASK_2) > -1\n || rule.indexOf(UBO_SCRIPTLET_EXCEPTION_MASK_1) > -1\n || rule.indexOf(UBO_SCRIPTLET_EXCEPTION_MASK_2) > -1\n )\n && UBO_SCRIPTLET_MASK_REG.test(rule)\n && !isComment(rule);\n};\n\n/**\n * Checks if the `rule` is AdBlock Plus snippet\n * @param {string} rule rule text\n */\nconst isAbpSnippetRule = (rule) => {\n return (\n rule.indexOf(ABP_SCRIPTLET_MASK) > -1\n || rule.indexOf(ABP_SCRIPTLET_EXCEPTION_MASK) > -1\n )\n && rule.search(ADG_CSS_MASK_REG) === -1\n && !isComment(rule);\n};\n\n/**\n * Finds scriptlet by it's name\n * @param {string} name - scriptlet name\n */\nconst getScriptletByName = (name) => {\n const scriptlets = Object.keys(scriptletsList).map((key) => scriptletsList[key]);\n return scriptlets\n .find((s) => s.names && s.names.indexOf(name) > -1);\n};\n\n/**\n * Checks if the scriptlet name is valid\n * @param {string} name - Scriptlet name\n */\nconst isValidScriptletName = (name) => {\n if (!name) {\n return false;\n }\n const scriptlet = getScriptletByName(name);\n if (!scriptlet) {\n return false;\n }\n return true;\n};\n\n/* ************************************************************************\n *\n * Redirects\n *\n ************************************************************************** */\n\n/**\n * Redirect resources markers\n */\nconst ADG_UBO_REDIRECT_MARKER = 'redirect=';\nconst ABP_REDIRECT_MARKER = 'rewrite=abp-resource:';\n\nconst VALID_SOURCE_TYPES = [\n 'image',\n 'subdocument',\n 'stylesheet',\n 'script',\n 'xmlhttprequest',\n 'media',\n];\n\nconst validAdgRedirects = redirects.filter((el) => el.adg);\n\n/**\n * Converts array of pairs to object.\n * Sort of Object.fromEntries() polyfill.\n * @param {Array} pairs - array of pairs\n * @returns {Object}\n */\nconst objFromEntries = (pairs) => {\n const output = pairs\n .reduce((acc, el) => {\n const [key, value] = el;\n acc[key] = value;\n return acc;\n }, {});\n return output;\n};\n\n/**\n * Compatibility object where KEYS = UBO redirect names and VALUES = ADG redirect names\n * It's used for UBO -> ADG converting\n */\nconst uboToAdgCompatibility = objFromEntries(\n validAdgRedirects\n .filter((el) => el.ubo)\n .map((el) => {\n return [el.ubo, el.adg];\n }),\n);\n\n/**\n * Compatibility object where KEYS = ABP redirect names and VALUES = ADG redirect names\n * It's used for ABP -> ADG converting\n */\nconst abpToAdgCompatibility = objFromEntries(\n validAdgRedirects\n .filter((el) => el.abp)\n .map((el) => {\n return [el.abp, el.adg];\n }),\n);\n\n/**\n * Compatibility object where KEYS = UBO redirect names and VALUES = ADG redirect names\n * It's used for ADG -> UBO converting\n */\nconst adgToUboCompatibility = objFromEntries(\n validAdgRedirects\n .filter((el) => el.ubo)\n .map((el) => {\n return [el.adg, el.ubo];\n }),\n);\n\n/**\n * Needed for AdGuard redirect names validation where KEYS = **valid** AdGuard redirect names\n * 'adgToUboCompatibility' is still needed for ADG -> UBO converting\n */\nconst validAdgCompatibility = objFromEntries(\n validAdgRedirects\n .map((el) => {\n return [el.adg, 'valid adg redirect'];\n }),\n);\n\nconst REDIRECT_RULE_TYPES = {\n VALID_ADG: {\n marker: ADG_UBO_REDIRECT_MARKER,\n compatibility: validAdgCompatibility,\n },\n ADG: {\n marker: ADG_UBO_REDIRECT_MARKER,\n compatibility: adgToUboCompatibility,\n },\n UBO: {\n marker: ADG_UBO_REDIRECT_MARKER,\n compatibility: uboToAdgCompatibility,\n },\n ABP: {\n marker: ABP_REDIRECT_MARKER,\n compatibility: abpToAdgCompatibility,\n },\n};\n\n/**\n * Parses redirect rule modifiers\n * @param {string} rule\n * @returns {Array}\n */\nconst parseModifiers = (rule) => substringAfter(rule, '$').split(',');\n\n/**\n * Gets redirect resource name\n * @param {string} rule\n * @param {string} marker - specific Adg/Ubo or Abp redirect resources marker\n * @returns {string} - redirect resource name\n */\nconst getRedirectName = (rule, marker) => {\n const ruleModifiers = parseModifiers(rule);\n const redirectNamePart = ruleModifiers\n .find((el) => el.indexOf(marker) > -1);\n return substringAfter(redirectNamePart, marker);\n};\n\n\n/**\n * Checks if the `rule` is AdGuard redirect rule.\n * Discards comments and JS rules and checks if the `rule` has 'redirect' modifier.\n * @param {string} rule - rule text\n */\nconst isAdgRedirectRule = (rule) => {\n return (\n !isComment(rule)\n // some js rules may have 'redirect=' in it, so we should get rid of them\n && !rule.indexOf(JS_RULE_MASK) > -1\n && rule.indexOf(REDIRECT_RULE_TYPES.ADG.marker) > -1\n );\n};\n\n/**\n * Checks if the `rule` satisfies the `type`\n * @param {string} rule - rule text\n * @param {'VALID_ADG'|'ADG'|'UBO'|'ABP'} type - type of a redirect rule\n */\nconst isRedirectRuleByType = (rule, type) => {\n const { marker, compatibility } = REDIRECT_RULE_TYPES[type];\n\n if (rule\n && (!isComment(rule))\n && (rule.indexOf(marker) > -1)) {\n const redirectName = getRedirectName(rule, marker);\n\n return redirectName === Object\n .keys(compatibility)\n .find((el) => el === redirectName);\n }\n return false;\n};\n\n/**\n* Checks if the `rule` is **valid** AdGuard redirect resource rule\n* @param {string} rule - rule text\n* @returns {boolean}\n*/\nconst isValidAdgRedirectRule = (rule) => {\n return isRedirectRuleByType(rule, 'VALID_ADG');\n};\n\n\n/**\n* Checks if the AdGuard redirect `rule` has Ubo analog. Needed for Adg->Ubo conversion\n* @param {string} rule - AdGuard rule text\n* @returns {boolean} - true if the rule can be converted to Ubo\n*/\nconst isAdgRedirectCompatibleWithUbo = (rule) => {\n return isRedirectRuleByType(rule, 'ADG');\n};\n\n/**\n* Checks if the Ubo redirect `rule` has AdGuard analog. Needed for Ubo->Adg conversion\n* @param {string} rule - Ubo rule text\n* @returns {boolean} - true if the rule can be converted to AdGuard\n*/\nconst isUboRedirectCompatibleWithAdg = (rule) => {\n return isRedirectRuleByType(rule, 'UBO');\n};\n\n/**\n* Checks if the Abp redirect `rule` has AdGuard analog. Needed for Abp->Adg conversion\n* @param {string} rule - Abp rule text\n* @returns {boolean} - true if the rule can be converted to AdGuard\n*/\nconst isAbpRedirectCompatibleWithAdg = (rule) => {\n return isRedirectRuleByType(rule, 'ABP');\n};\n\n\n/**\n * Checks if the rule has specified content type before Adg -> Ubo conversion.\n *\n * Used ONLY for Adg -> Ubo conversion\n * because Ubo redirect rules must contain content type, but Adg and Abp must not.\n *\n * Also source type can not be added automatically because of such valid rules:\n * ! Abp:\n * $rewrite=abp-resource:blank-js,xmlhttprequest\n * ! Adg:\n * $script,redirect=noopvast-2.0\n * $xmlhttprequest,redirect=noopvast-2.0\n *\n * @param {string} rule\n * @returns {boolean}\n */\nconst hasValidContentType = (rule) => {\n if (isRedirectRuleByType(rule, 'ADG')) {\n const ruleModifiers = parseModifiers(rule);\n const sourceType = ruleModifiers\n .find((el) => VALID_SOURCE_TYPES.indexOf(el) > -1);\n\n return sourceType !== undefined;\n }\n return false;\n};\n\nconst validator = {\n UBO_SCRIPTLET_MASK_REG,\n ABP_SCRIPTLET_MASK,\n ABP_SCRIPTLET_EXCEPTION_MASK,\n isComment,\n isAdgScriptletRule,\n isUboScriptletRule,\n isAbpSnippetRule,\n getScriptletByName,\n isValidScriptletName,\n REDIRECT_RULE_TYPES,\n isAdgRedirectRule,\n isValidAdgRedirectRule,\n isAdgRedirectCompatibleWithUbo,\n isUboRedirectCompatibleWithAdg,\n isAbpRedirectCompatibleWithAdg,\n parseModifiers,\n getRedirectName,\n hasValidContentType,\n};\n\nexport default validator;\n","function _iterableToArray(iter) {\n if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter);\n}\n\nmodule.exports = _iterableToArray;","var arrayWithHoles = require(\"./arrayWithHoles\");\n\nvar iterableToArray = require(\"./iterableToArray\");\n\nvar nonIterableRest = require(\"./nonIterableRest\");\n\nfunction _toArray(arr) {\n return arrayWithHoles(arr) || iterableToArray(arr) || nonIterableRest();\n}\n\nmodule.exports = _toArray;","import {\n getBeforeRegExp,\n substringAfter,\n substringBefore,\n wrapInSingleQuotes,\n getStringInBraces,\n} from './string-utils';\n\nimport validator from './validator';\n\nimport { parseRule } from './parse-rule';\n\nimport * as scriptletList from '../scriptlets/scriptletsList';\n\n/**\n * AdGuard scriptlet rule\n */\nconst ADGUARD_SCRIPTLET_MASK_REG = /#@?%#\\/\\/scriptlet\\(.+\\)/;\n// eslint-disable-next-line no-template-curly-in-string\nconst ADGUARD_SCRIPTLET_TEMPLATE = '${domains}#%#//scriptlet(${args})';\n// eslint-disable-next-line no-template-curly-in-string\nconst ADGUARD_SCRIPTLET_EXCEPTION_TEMPLATE = '${domains}#@%#//scriptlet(${args})';\n\n/**\n * uBlock scriptlet rule mask\n */\n// eslint-disable-next-line no-template-curly-in-string\nconst UBO_SCRIPTLET_TEMPLATE = '${domains}##+js(${args})';\n// eslint-disable-next-line no-template-curly-in-string\nconst UBO_SCRIPTLET_EXCEPTION_TEMPLATE = '${domains}#@#+js(${args})';\n\nconst UBO_ALIAS_NAME_MARKER = 'ubo-';\n\n// https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#xhr\nconst UBO_XHR_TYPE = 'xhr';\n\nconst ADG_XHR_TYPE = 'xmlhttprequest';\n\n\n/**\n * Returns array of strings separated by space which not in quotes\n * @param {string} str\n */\nconst getSentences = (str) => {\n const reg = /'.*?'|\".*?\"|\\S+/g;\n return str.match(reg);\n};\n\n/**\n * Replaces string with data by placeholders\n * @param {string} str\n * @param {Object} data - where keys are placeholders names\n */\nconst replacePlaceholders = (str, data) => {\n return Object.keys(data).reduce((acc, key) => {\n const reg = new RegExp(`\\\\$\\\\{${key}\\\\}`, 'g');\n acc = acc.replace(reg, data[key]);\n return acc;\n }, str);\n};\n\n/**\n * Converts string of UBO scriptlet rule to AdGuard scritlet rule\n * @param {string} rule - UBO scriptlet rule\n * @returns {Array} - array with one AdGuard scriptlet rule\n */\nexport const convertUboScriptletToAdg = (rule) => {\n const domains = getBeforeRegExp(rule, validator.UBO_SCRIPTLET_MASK_REG);\n const mask = rule.match(validator.UBO_SCRIPTLET_MASK_REG)[0];\n let template;\n if (mask.indexOf('@') > -1) {\n template = ADGUARD_SCRIPTLET_EXCEPTION_TEMPLATE;\n } else {\n template = ADGUARD_SCRIPTLET_TEMPLATE;\n }\n const args = getStringInBraces(rule)\n .split(/, /g)\n .map((arg, index) => {\n let outputArg;\n if (index === 0) {\n outputArg = (arg.indexOf('.js') > -1) ? `ubo-${arg}` : `ubo-${arg}.js`;\n } else {\n outputArg = arg;\n }\n // for example: dramaserial.xyz##+js(abort-current-inline-script, $, popup)\n if (arg === '$') {\n outputArg = '$$';\n }\n return outputArg;\n })\n .map((arg) => wrapInSingleQuotes(arg))\n .join(', ');\n const adgRule = replacePlaceholders(\n template,\n { domains, args },\n );\n return [adgRule];\n};\n\n/**\n * Convert string of ABP snippet rule to AdGuard scritlet rule\n * @param {string} rule - ABP snippet rule\n * @returns {Array} - array of AdGuard scriptlet rules -\n * one or few items depends on Abp-rule\n */\nexport const convertAbpSnippetToAdg = (rule) => {\n const SEMICOLON_DIVIDER = /;(?=(?:(?:[^\"]*\"){2})*[^\"]*$)/g;\n const mask = rule.indexOf(validator.ABP_SCRIPTLET_MASK) > -1\n ? validator.ABP_SCRIPTLET_MASK\n : validator.ABP_SCRIPTLET_EXCEPTION_MASK;\n const template = mask === validator.ABP_SCRIPTLET_MASK\n ? ADGUARD_SCRIPTLET_TEMPLATE\n : ADGUARD_SCRIPTLET_EXCEPTION_TEMPLATE;\n const domains = substringBefore(rule, mask);\n const args = substringAfter(rule, mask);\n\n return args.split(SEMICOLON_DIVIDER)\n .map((args) => getSentences(args)\n .filter((arg) => arg)\n .map((arg, index) => (index === 0 ? `abp-${arg}` : arg))\n .map((arg) => wrapInSingleQuotes(arg))\n .join(', '))\n .map((args) => replacePlaceholders(template, { domains, args }));\n};\n\n/**\n * Converts scriptlet rule to AdGuard one\n * @param {string} rule\n * @returns {Array} - array of AdGuard scriptlet rules -\n * one item for Adg and Ubo or few items for Abp\n */\nexport const convertScriptletToAdg = (rule) => {\n let result;\n if (validator.isUboScriptletRule(rule)) {\n result = convertUboScriptletToAdg(rule);\n } else if (validator.isAbpSnippetRule(rule)) {\n result = convertAbpSnippetToAdg(rule);\n } else if (validator.isAdgScriptletRule(rule) || (validator.isComment(rule))) {\n result = [rule];\n }\n\n return result;\n};\n\n/**\n * Converts UBO scriptlet rule to AdGuard one\n * @param {string} rule - AdGuard scriptlet rule\n * @returns {string} - UBO scriptlet rule\n */\nexport const convertAdgScriptletToUbo = (rule) => {\n let res;\n\n if (validator.isAdgScriptletRule(rule)) {\n const { name: parsedName, args: parsedParams } = parseRule(rule);\n\n // object of name and aliases for the Adg-scriptlet\n const adgScriptletObject = Object\n .keys(scriptletList)\n .map((el) => scriptletList[el])\n .map((s) => {\n const [name, ...aliases] = s.names;\n return { name, aliases };\n })\n .find((el) => (el.name === parsedName\n || el.aliases.indexOf(parsedName) >= 0));\n\n const { aliases } = adgScriptletObject;\n\n if (aliases.length > 0) {\n const uboAlias = adgScriptletObject.aliases\n // eslint-disable-next-line no-restricted-properties\n .find((alias) => alias.includes(UBO_ALIAS_NAME_MARKER));\n\n if (uboAlias) {\n const mask = rule.match(ADGUARD_SCRIPTLET_MASK_REG)[0];\n let template;\n if (mask.indexOf('@') > -1) {\n template = UBO_SCRIPTLET_EXCEPTION_TEMPLATE;\n } else {\n template = UBO_SCRIPTLET_TEMPLATE;\n }\n const domains = getBeforeRegExp(rule, ADGUARD_SCRIPTLET_MASK_REG);\n const uboName = uboAlias\n .replace(UBO_ALIAS_NAME_MARKER, '')\n // '.js' in the Ubo scriptlet name can be omitted\n // https://github.com/gorhill/uBlock/wiki/Resources-Library#general-purpose-scriptlets\n .replace('.js', '');\n\n const args = (parsedParams.length > 0) ? `${uboName}, ${parsedParams.join(', ')}` : uboName;\n\n const uboRule = replacePlaceholders(\n template,\n { domains, args },\n );\n\n res = uboRule;\n }\n }\n }\n\n return res;\n};\n\n/**\n * Validates any scriptlet rule\n * @param {string} input - can be Adguard or Ubo or Abp scriptlet rule\n */\nexport const isValidScriptletRule = (input) => {\n if (!input) {\n return false;\n }\n // ABP 'input' rule may contain more than one snippet\n const rulesArray = convertScriptletToAdg(input);\n\n // checking if each of parsed scriptlets is valid\n // if at least one of them is not valid - whole 'input' rule is not valid too\n const isValid = rulesArray.reduce((acc, rule) => {\n const parsedRule = parseRule(rule);\n return validator.isValidScriptletName(parsedRule.name) && acc;\n }, true);\n\n return isValid;\n};\n\n\n/**\n * Converts Ubo redirect rule to Adg one\n * @param {string} rule\n * @returns {string}\n */\nexport const convertUboRedirectToAdg = (rule) => {\n const firstPartOfRule = substringBefore(rule, '$');\n const uboModifiers = validator.parseModifiers(rule);\n const adgModifiers = uboModifiers\n .map((el) => {\n if (el.indexOf(validator.REDIRECT_RULE_TYPES.UBO.marker) > -1) {\n const uboName = substringAfter(el, validator.REDIRECT_RULE_TYPES.UBO.marker);\n const adgName = validator.REDIRECT_RULE_TYPES.UBO.compatibility[uboName];\n return `${validator.REDIRECT_RULE_TYPES.ADG.marker}${adgName}`;\n }\n if (el === UBO_XHR_TYPE) {\n return ADG_XHR_TYPE;\n }\n return el;\n })\n .join(',');\n\n return `${firstPartOfRule}$${adgModifiers}`;\n};\n\n/**\n * Converts Abp redirect rule to Adg one\n * @param {string} rule\n * @returns {string}\n */\nexport const convertAbpRedirectToAdg = (rule) => {\n const firstPartOfRule = substringBefore(rule, '$');\n const abpModifiers = validator.parseModifiers(rule);\n const adgModifiers = abpModifiers\n .map((el) => {\n if (el.indexOf(validator.REDIRECT_RULE_TYPES.ABP.marker) > -1) {\n const abpName = substringAfter(el, validator.REDIRECT_RULE_TYPES.ABP.marker);\n const adgName = validator.REDIRECT_RULE_TYPES.ABP.compatibility[abpName];\n return `${validator.REDIRECT_RULE_TYPES.ADG.marker}${adgName}`;\n }\n return el;\n })\n .join(',');\n\n return `${firstPartOfRule}$${adgModifiers}`;\n};\n\n/**\n * Converts redirect rule to AdGuard one\n * @param {string} rule\n * @returns {string}\n */\nexport const convertRedirectToAdg = (rule) => {\n let result;\n if (validator.isUboRedirectCompatibleWithAdg(rule)) {\n result = convertUboRedirectToAdg(rule);\n } else if (validator.isAbpRedirectCompatibleWithAdg(rule)) {\n result = convertAbpRedirectToAdg(rule);\n } else if (validator.isValidAdgRedirectRule(rule)) {\n result = rule;\n }\n\n return result;\n};\n\n/**\n * Converts Adg redirect rule to Ubo one\n * @param {string} rule\n * @returns {string}\n */\nexport const convertAdgRedirectToUbo = (rule) => {\n if (!validator.hasValidContentType(rule)) {\n throw new Error(`Rule is not valid for converting to Ubo. Source type is not specified in the rule: ${rule}`);\n } else {\n const firstPartOfRule = substringBefore(rule, '$');\n const uboModifiers = validator.parseModifiers(rule);\n const adgModifiers = uboModifiers\n .map((el) => {\n if (el.indexOf(validator.REDIRECT_RULE_TYPES.ADG.marker) > -1) {\n const adgName = substringAfter(el, validator.REDIRECT_RULE_TYPES.ADG.marker);\n const uboName = validator.REDIRECT_RULE_TYPES.ADG.compatibility[adgName];\n return `${validator.REDIRECT_RULE_TYPES.UBO.marker}${uboName}`;\n }\n return el;\n })\n .join(',');\n\n return `${firstPartOfRule}$${adgModifiers}`;\n }\n};\n","import {\n hit, noopFunc, noopNull, noopArray,\n} from '../helpers';\n\n/**\n * @redirect google-analytics\n *\n * @description\n * Mocks Google Analytics API.\n *\n * Related UBO redirect resource:\n * https://github.com/gorhill/uBlock/blob/a94df7f3b27080ae2dcb3b914ace39c0c294d2f6/src/web_accessible_resources/google-analytics_analytics.js\n *\n * **Example**\n * ```\n * ||google-analytics.com/analytics.js$script,redirect=google-analytics\n * ```\n */\nexport function GoogleAnalytics(source) {\n // eslint-disable-next-line func-names\n const Tracker = function () { }; // constructor\n const proto = Tracker.prototype;\n proto.get = noopFunc;\n proto.set = noopFunc;\n proto.send = noopFunc;\n\n const googleAnalyticsName = window.GoogleAnalyticsObject || 'ga';\n function ga() {\n const len = arguments.length;\n if (len === 0) {\n return;\n }\n // eslint-disable-next-line prefer-rest-params\n const lastArg = arguments[len - 1];\n if (typeof lastArg !== 'object'\n || lastArg === null\n || typeof lastArg.hitCallback !== 'function'\n ) {\n return;\n }\n\n try {\n lastArg.hitCallback();\n // eslint-disable-next-line no-empty\n } catch (ex) { }\n }\n\n ga.create = () => new Tracker();\n ga.getByName = noopNull;\n ga.getAll = noopArray;\n ga.remove = noopFunc;\n ga.loaded = true;\n window[googleAnalyticsName] = ga;\n\n const { dataLayer } = window;\n if (dataLayer instanceof Object\n && dataLayer.hide instanceof Object\n && typeof dataLayer.hide.end === 'function'\n ) {\n dataLayer.hide.end();\n }\n\n hit(source);\n}\n\nGoogleAnalytics.names = [\n 'google-analytics',\n 'ubo-google-analytics_analytics.js',\n 'google-analytics_analytics.js',\n];\n\nGoogleAnalytics.injections = [\n hit,\n noopFunc,\n noopNull,\n noopArray,\n];\n","/* eslint-disable no-underscore-dangle */\nimport { hit, noopFunc } from '../helpers';\n\n/**\n * @redirect google-analytics-ga\n *\n * @description\n * Mocks old Google Analytics API.\n *\n * Related UBO redirect resource:\n * https://github.com/gorhill/uBlock/blob/a94df7f3b27080ae2dcb3b914ace39c0c294d2f6/src/web_accessible_resources/google-analytics_ga.js\n *\n * **Example**\n * ```\n * ||google-analytics.com/ga.js$script,redirect=google-analytics-ga\n * ```\n */\nexport function GoogleAnalyticsGa(source) {\n // Gaq constructor\n function Gaq() { }\n\n Gaq.prototype.Na = noopFunc;\n Gaq.prototype.O = noopFunc;\n Gaq.prototype.Sa = noopFunc;\n Gaq.prototype.Ta = noopFunc;\n Gaq.prototype.Va = noopFunc;\n Gaq.prototype._createAsyncTracker = noopFunc;\n Gaq.prototype._getAsyncTracker = noopFunc;\n Gaq.prototype._getPlugin = noopFunc;\n Gaq.prototype.push = (data) => {\n if (typeof data === 'function') {\n data();\n return;\n }\n if (Array.isArray(data) === false) {\n return;\n }\n // https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiDomainDirectory#_gat.GA_Tracker_._link\n if (data[0] === '_link' && typeof data[1] === 'string') {\n window.location.assign(data[1]);\n }\n // https://github.com/gorhill/uBlock/issues/2162\n if (data[0] === '_set' && data[1] === 'hitCallback' && typeof data[2] === 'function') {\n data[2]();\n }\n };\n\n const gaq = new Gaq();\n const asyncTrackers = window._gaq || [];\n if (Array.isArray(asyncTrackers)) {\n while (asyncTrackers[0]) {\n gaq.push(asyncTrackers.shift());\n }\n }\n // eslint-disable-next-line no-multi-assign\n window._gaq = gaq.qf = gaq;\n\n\n // Gat constructor\n function Gat() { }\n\n // Mock tracker api\n const api = [\n '_addIgnoredOrganic', '_addIgnoredRef', '_addItem', '_addOrganic',\n '_addTrans', '_clearIgnoredOrganic', '_clearIgnoredRef', '_clearOrganic',\n '_cookiePathCopy', '_deleteCustomVar', '_getName', '_setAccount',\n '_getAccount', '_getClientInfo', '_getDetectFlash', '_getDetectTitle',\n '_getLinkerUrl', '_getLocalGifPath', '_getServiceMode', '_getVersion',\n '_getVisitorCustomVar', '_initData', '_link', '_linkByPost',\n '_setAllowAnchor', '_setAllowHash', '_setAllowLinker', '_setCampContentKey',\n '_setCampMediumKey', '_setCampNameKey', '_setCampNOKey', '_setCampSourceKey',\n '_setCampTermKey', '_setCampaignCookieTimeout', '_setCampaignTrack', '_setClientInfo',\n '_setCookiePath', '_setCookiePersistence', '_setCookieTimeout', '_setCustomVar',\n '_setDetectFlash', '_setDetectTitle', '_setDomainName', '_setLocalGifPath',\n '_setLocalRemoteServerMode', '_setLocalServerMode', '_setReferrerOverride', '_setRemoteServerMode',\n '_setSampleRate', '_setSessionTimeout', '_setSiteSpeedSampleRate', '_setSessionCookieTimeout',\n '_setVar', '_setVisitorCookieTimeout', '_trackEvent', '_trackPageLoadTime',\n '_trackPageview', '_trackSocial', '_trackTiming', '_trackTrans',\n '_visitCode',\n ];\n const tracker = api.reduce((res, funcName) => {\n res[funcName] = noopFunc;\n return res;\n }, {});\n tracker._getLinkerUrl = (a) => a;\n\n Gat.prototype._anonymizeIP = noopFunc;\n Gat.prototype._createTracker = noopFunc;\n Gat.prototype._forceSSL = noopFunc;\n Gat.prototype._getPlugin = noopFunc;\n Gat.prototype._getTracker = () => tracker;\n Gat.prototype._getTrackerByName = () => tracker;\n Gat.prototype._getTrackers = noopFunc;\n Gat.prototype.aa = noopFunc;\n Gat.prototype.ab = noopFunc;\n Gat.prototype.hb = noopFunc;\n Gat.prototype.la = noopFunc;\n Gat.prototype.oa = noopFunc;\n Gat.prototype.pa = noopFunc;\n Gat.prototype.u = noopFunc;\n\n const gat = new Gat();\n window._gat = gat;\n\n hit(source);\n}\n\nGoogleAnalyticsGa.names = [\n 'google-analytics-ga',\n 'ubo-google-analytics_ga.js',\n 'google-analytics_ga.js',\n];\n\nGoogleAnalyticsGa.injections = [hit, noopFunc];\n","import { hit } from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @redirect googlesyndication-adsbygoogle\n *\n * @description\n * Mocks Google AdSense API.\n *\n * Related UBO redirect resource:\n * https://github.com/gorhill/uBlock/blob/a94df7f3b27080ae2dcb3b914ace39c0c294d2f6/src/web_accessible_resources/googlesyndication_adsbygoogle.js\n *\n * **Example**\n * ```\n * ||pagead2.googlesyndication.com/pagead/js/adsbygoogle.js$script,redirect=googlesyndication-adsbygoogle\n * ```\n */\n/* eslint-enable max-len */\nexport function GoogleSyndicationAdsByGoogle(source) {\n window.adsbygoogle = window.adsbygoogle || {\n length: 0,\n loaded: true,\n push() {\n this.length += 1;\n },\n };\n const adElems = document.querySelectorAll('.adsbygoogle');\n const css = 'height:1px!important;max-height:1px!important;max-width:1px!important;width:1px!important;';\n let executed = false;\n for (let i = 0; i < adElems.length; i += 1) {\n adElems[i].setAttribute('data-adsbygoogle-status', 'done');\n\n const aswiftIframe = document.createElement('iframe');\n aswiftIframe.id = `aswift_${i + 1}`;\n aswiftIframe.style = css;\n adElems[i].appendChild(aswiftIframe);\n\n const googleadsIframe = document.createElement('iframe');\n googleadsIframe.id = `google_ads_iframe_${i}`;\n googleadsIframe.style = css;\n adElems[i].appendChild(googleadsIframe);\n\n executed = true;\n }\n\n if (executed) {\n hit(source);\n }\n}\n\nGoogleSyndicationAdsByGoogle.names = [\n 'googlesyndication-adsbygoogle',\n 'ubo-googlesyndication_adsbygoogle.js',\n 'googlesyndication_adsbygoogle.js',\n];\n\nGoogleSyndicationAdsByGoogle.injections = [\n hit,\n];\n","import { hit, noopFunc } from '../helpers';\n\n/**\n * @redirect googletagmanager-gtm\n *\n * @description\n * Mocks Google Tag Manager API.\n *\n * Related UBO redirect resource:\n * https://github.com/gorhill/uBlock/blob/a94df7f3b27080ae2dcb3b914ace39c0c294d2f6/src/web_accessible_resources/googletagmanager_gtm.js\n *\n * **Example**\n * ```\n * ||googletagmanager.com/gtm.js$script,redirect=googletagmanager-gtm\n * ```\n */\nexport function GoogleTagManagerGtm(source) {\n window.ga = window.ga || noopFunc;\n const { dataLayer } = window;\n if (dataLayer instanceof Object === false) {\n return;\n }\n\n if (dataLayer.hide instanceof Object && typeof dataLayer.hide.end === 'function') {\n dataLayer.hide.end();\n }\n\n if (typeof dataLayer.push === 'function') {\n dataLayer.push = (data) => {\n if (data instanceof Object && typeof data.eventCallback === 'function') {\n setTimeout(data.eventCallback, 1);\n }\n };\n }\n\n hit(source);\n}\n\nGoogleTagManagerGtm.names = [\n 'googletagmanager-gtm',\n 'ubo-googletagmanager_gtm.js',\n 'googletagmanager_gtm.js',\n];\n\nGoogleTagManagerGtm.injections = [hit, noopFunc];\n","import {\n hit, noopFunc, noopThis, noopNull, noopArray, noopStr,\n} from '../helpers';\n\n/**\n * @redirect googletagservices-gpt\n *\n * @description\n * Mocks Google Publisher Tag API.\n *\n * Related UBO redirect resource:\n * https://github.com/gorhill/uBlock/blob/a94df7f3b27080ae2dcb3b914ace39c0c294d2f6/src/web_accessible_resources/googletagservices_gpt.js\n *\n * **Example**\n * ```\n * ||googletagservices.com/tag/js/gpt.js$script,redirect=googletagservices-gpt\n * ```\n */\nexport function GoogleTagServicesGpt(source) {\n const companionAdsService = {\n addEventListener: noopThis,\n enableSyncLoading: noopFunc,\n setRefreshUnfilledSlots: noopFunc,\n };\n const contentService = {\n addEventListener: noopThis,\n setContent: noopFunc,\n };\n function PassbackSlot() { } // constructor\n\n PassbackSlot.prototype.display = noopFunc;\n PassbackSlot.prototype.get = noopNull;\n PassbackSlot.prototype.set = noopThis;\n PassbackSlot.prototype.setClickUrl = noopThis;\n PassbackSlot.prototype.setTagForChildDirectedTreatment = noopThis;\n PassbackSlot.prototype.setTargeting = noopThis;\n PassbackSlot.prototype.updateTargetingFromMap = noopThis;\n\n function SizeMappingBuilder() { } // constructor\n SizeMappingBuilder.prototype.addSize = noopThis;\n SizeMappingBuilder.prototype.build = noopNull;\n\n function Slot() { } // constructor\n Slot.prototype.addService = noopThis;\n Slot.prototype.clearCategoryExclusions = noopThis;\n Slot.prototype.clearTargeting = noopThis;\n Slot.prototype.defineSizeMapping = noopThis;\n Slot.prototype.get = noopNull;\n Slot.prototype.getAdUnitPath = noopArray;\n Slot.prototype.getAttributeKeys = noopArray;\n Slot.prototype.getCategoryExclusions = noopArray;\n Slot.prototype.getDomId = noopStr;\n Slot.prototype.getSlotElementId = noopStr;\n Slot.prototype.getSlotId = noopThis;\n Slot.prototype.getTargeting = noopArray;\n Slot.prototype.getTargetingKeys = noopArray;\n Slot.prototype.set = noopThis;\n Slot.prototype.setCategoryExclusion = noopThis;\n Slot.prototype.setClickUrl = noopThis;\n Slot.prototype.setCollapseEmptyDiv = noopThis;\n Slot.prototype.setTargeting = noopThis;\n\n const pubAdsService = {\n addEventListener: noopThis,\n clear: noopFunc,\n clearCategoryExclusions: noopThis,\n clearTagForChildDirectedTreatment: noopThis,\n clearTargeting: noopThis,\n collapseEmptyDivs: noopFunc,\n defineOutOfPagePassback() { return new PassbackSlot(); },\n definePassback() { return new PassbackSlot(); },\n disableInitialLoad: noopFunc,\n display: noopFunc,\n enableAsyncRendering: noopFunc,\n enableSingleRequest: noopFunc,\n enableSyncRendering: noopFunc,\n enableVideoAds: noopFunc,\n get: noopNull,\n getAttributeKeys: noopArray,\n getTargeting: noopFunc,\n getTargetingKeys: noopArray,\n getSlots: noopArray,\n refresh: noopFunc,\n set: noopThis,\n setCategoryExclusion: noopThis,\n setCentering: noopFunc,\n setCookieOptions: noopThis,\n setForceSafeFrame: noopThis,\n setLocation: noopThis,\n setPublisherProvidedId: noopThis,\n setRequestNonPersonalizedAds: noopThis,\n setSafeFrameConfig: noopThis,\n setTagForChildDirectedTreatment: noopThis,\n setTargeting: noopThis,\n setVideoContent: noopThis,\n updateCorrelator: noopFunc,\n };\n\n\n const { googletag = {} } = window;\n const { cmd = [] } = googletag;\n\n googletag.apiReady = true;\n googletag.cmd = [];\n googletag.cmd.push = (a) => {\n try {\n a();\n // eslint-disable-next-line no-empty\n } catch (ex) { }\n return 1;\n };\n googletag.companionAds = () => companionAdsService;\n googletag.content = () => contentService;\n googletag.defineOutOfPageSlot = () => new Slot();\n googletag.defineSlot = () => new Slot();\n googletag.destroySlots = noopFunc;\n googletag.disablePublisherConsole = noopFunc;\n googletag.display = noopFunc;\n googletag.enableServices = noopFunc;\n googletag.getVersion = noopStr;\n googletag.pubads = () => pubAdsService;\n googletag.pubadsReady = true;\n googletag.setAdIframeTitle = noopFunc;\n googletag.sizeMapping = () => new SizeMappingBuilder();\n\n window.googletag = googletag;\n while (cmd.length !== 0) {\n googletag.cmd.push(cmd.shift());\n }\n\n hit(source);\n}\n\nGoogleTagServicesGpt.names = [\n 'googletagservices-gpt',\n 'ubo-googletagservices_gpt.js',\n 'googletagservices_gpt.js',\n];\n\nGoogleTagServicesGpt.injections = [\n hit,\n noopFunc,\n noopThis,\n noopNull,\n noopArray,\n noopStr,\n];\n","import { hit } from '../helpers';\n\n/**\n * @redirect scorecardresearch-beacon\n *\n * @description\n * Mocks Scorecard Research API.\n *\n * Related UBO redirect resource:\n * https://github.com/gorhill/uBlock/blob/a94df7f3b27080ae2dcb3b914ace39c0c294d2f6/src/web_accessible_resources/scorecardresearch_beacon.js\n *\n * **Example**\n * ```\n * ||sb.scorecardresearch.com/beacon.js$script,redirect=scorecardresearch-beacon\n * ```\n */\nexport function ScoreCardResearchBeacon(source) {\n window.COMSCORE = {\n purge() {\n // eslint-disable-next-line no-underscore-dangle\n window._comscore = [];\n },\n beacon() {},\n };\n hit(source);\n}\n\nScoreCardResearchBeacon.names = [\n 'scorecardresearch-beacon',\n 'ubo-scorecardresearch_beacon.js',\n 'scorecardresearch_beacon.js',\n];\n\nScoreCardResearchBeacon.injections = [\n hit,\n];\n","import { hit, noopFunc } from '../helpers';\n\n/**\n * @redirect metrika-yandex-tag\n *\n * @description\n * Mocks Yandex Metrika API.\n * https://yandex.ru/support/metrica/objects/method-reference.html\n *\n * **Example**\n * ```\n * ||mc.yandex.ru/metrika/tag.js$script,redirect=metrika-yandex-tag\n * ```\n */\nexport function metrikaYandexTag(source) {\n const asyncCallbackFromOptions = (param, options = {}) => {\n let { callback } = options;\n const { ctx } = options;\n if (typeof callback === 'function') {\n callback = ctx !== undefined ? callback.bind(ctx) : callback;\n setTimeout(() => callback());\n }\n };\n\n const init = noopFunc;\n\n /**\n * https://yandex.ru/support/metrica/objects/addfileextension.html\n */\n const addFileExtension = noopFunc;\n\n /**\n * https://yandex.ru/support/metrica/objects/extlink.html\n */\n const extLink = asyncCallbackFromOptions;\n\n /**\n * https://yandex.ru/support/metrica/objects/file.html\n */\n const file = asyncCallbackFromOptions;\n\n /**\n * https://yandex.ru/support/metrica/objects/get-client-id.html\n * @param {Function} cb\n */\n const getClientID = (cb) => {\n setTimeout(cb(null));\n };\n\n /**\n * https://yandex.ru/support/metrica/objects/hit.html\n */\n const hitFunc = asyncCallbackFromOptions;\n\n /**\n * https://yandex.ru/support/metrica/objects/notbounce.html\n */\n const notBounce = asyncCallbackFromOptions;\n\n /**\n * https://yandex.ru/support/metrica/objects/params-method.html\n */\n const params = noopFunc;\n\n /**\n * https://yandex.ru/support/metrica/objects/reachgoal.html\n * @param {string} target\n * @param {Object} params\n * @param {Function} callback\n * @param {any} ctx\n */\n const reachGoal = (target, params, callback, ctx) => {\n asyncCallbackFromOptions(null, { callback, ctx });\n };\n\n /**\n * https://yandex.ru/support/metrica/objects/set-user-id.html\n */\n const setUserID = noopFunc;\n\n /**\n * https://yandex.ru/support/metrica/objects/user-params.html\n */\n const userParams = noopFunc;\n\n const api = {\n init,\n addFileExtension,\n extLink,\n file,\n getClientID,\n hit: hitFunc,\n notBounce,\n params,\n reachGoal,\n setUserID,\n userParams,\n };\n\n function ym(id, funcName, ...args) {\n return api[funcName] && api[funcName](...args);\n }\n\n window.ym = ym;\n\n hit(source);\n}\n\nmetrikaYandexTag.names = [\n 'metrika-yandex-tag',\n];\n\nmetrikaYandexTag.injections = [hit, noopFunc];\n","import { hit, noopFunc } from '../helpers';\n\n/**\n * @redirect metrika-yandex-watch\n *\n * @description\n * Mocks the old Yandex Metrika API.\n * https://yandex.ru/support/metrica/objects/_method-reference.html\n *\n * **Example**\n * ```\n * ||mc.yandex.ru/metrika/watch.js$script,redirect=metrika-yandex-watch\n * ```\n */\nexport function metrikaYandexWatch(source) {\n const cbName = 'yandex_metrika_callbacks';\n\n /**\n * Gets callback and its context from options and call it in async way\n * @param {Object} options Yandex Metrika API options\n */\n const asyncCallbackFromOptions = (options = {}) => {\n let { callback } = options;\n const { ctx } = options;\n if (typeof callback === 'function') {\n callback = ctx !== undefined ? callback.bind(ctx) : callback;\n setTimeout(() => callback());\n }\n };\n\n function Metrika() { } // constructor\n\n // Methods without options\n Metrika.prototype.addFileExtension = noopFunc;\n Metrika.prototype.getClientID = noopFunc;\n Metrika.prototype.setUserID = noopFunc;\n Metrika.prototype.userParams = noopFunc;\n\n // Methods with options\n // The order of arguments should be kept in according to API\n Metrika.prototype.extLink = (url, options) => {\n asyncCallbackFromOptions(options);\n };\n Metrika.prototype.file = (url, options) => {\n asyncCallbackFromOptions(options);\n };\n Metrika.prototype.hit = (url, options) => {\n asyncCallbackFromOptions(options);\n };\n Metrika.prototype.reachGoal = (target, params, cb, ctx) => {\n asyncCallbackFromOptions({ callback: cb, ctx });\n };\n Metrika.prototype.notBounce = asyncCallbackFromOptions;\n\n if (window.Ya) {\n window.Ya.Metrika = Metrika;\n } else {\n window.Ya = { Metrika };\n }\n\n if (window[cbName] && Array.isArray(window[cbName])) {\n window[cbName].forEach((func) => {\n if (typeof func === 'function') {\n func();\n }\n });\n }\n\n hit(source);\n}\n\nmetrikaYandexWatch.names = [\n 'metrika-yandex-watch',\n];\n\nmetrikaYandexWatch.injections = [hit, noopFunc];\n","import {\n attachDependencies,\n addCall,\n wrapInNonameFunc,\n passSourceAndProps,\n} from '../helpers/injector';\n\nimport validator from '../helpers/validator';\n\nimport {\n convertUboRedirectToAdg,\n convertAbpRedirectToAdg,\n convertRedirectToAdg,\n convertAdgRedirectToUbo,\n} from '../helpers/converter';\n\nimport * as redirectsList from './redirectsList';\n\n/**\n * Finds redirect resource by it's name\n * @param {string} name - redirect name\n */\nconst getRedirectByName = (name) => {\n const redirects = Object.keys(redirectsList).map((key) => redirectsList[key]);\n return redirects.find((r) => r.names && r.names.indexOf(name) > -1);\n};\n\n/**\n * @typedef {Object} Source - redirect properties\n * @property {string} name redirect name\n * @property {Array} args Arguments for redirect function\n * @property {'extension'|'test'} [engine] -\n * Defines the final form of redirect string presentation\n * @property {boolean} [verbose] flag to enable printing to console debug information\n */\n\n/**\n * Returns redirect code by param\n * @param {Source} source\n */\nconst getRedirectCode = (source) => {\n const redirect = getRedirectByName(source.name);\n let result = attachDependencies(redirect);\n result = addCall(redirect, result);\n\n // redirect code for different sources is checked in tests\n // so it should be just a code without any source and props passed\n result = source.engine === 'test'\n ? wrapInNonameFunc(result)\n : passSourceAndProps(source, result);\n\n return result;\n};\n\n\nexport const redirectsCjs = {\n getCode: getRedirectCode,\n isAdgRedirectRule: validator.isAdgRedirectRule,\n isValidAdgRedirectRule: validator.isValidAdgRedirectRule,\n isAdgRedirectCompatibleWithUbo: validator.isAdgRedirectCompatibleWithUbo,\n isUboRedirectCompatibleWithAdg: validator.isUboRedirectCompatibleWithAdg,\n isAbpRedirectCompatibleWithAdg: validator.isAbpRedirectCompatibleWithAdg,\n convertUboRedirectToAdg,\n convertAbpRedirectToAdg,\n convertRedirectToAdg,\n convertAdgRedirectToUbo,\n};\n","import { redirectsCjs } from '../redirects';\n\nimport {\n attachDependencies,\n addCall,\n passSourceAndProps,\n wrapInNonameFunc,\n} from '../helpers/injector';\n\nimport validator from '../helpers/validator';\n\nimport {\n isValidScriptletRule,\n convertUboScriptletToAdg,\n convertAbpSnippetToAdg,\n convertScriptletToAdg,\n convertAdgScriptletToUbo,\n} from '../helpers/converter';\n\n\n/**\n * @typedef {Object} Source - scriptlet properties\n * @property {string} name Scriptlet name\n * @property {Array} args Arguments for scriptlet function\n * @property {'extension'|'corelibs'|'test'} engine -\n * Defines the final form of scriptlet string presentation\n * @property {string} [version]\n * @property {boolean} [verbose] flag to enable printing to console debug information\n * @property {string} [ruleText] Source rule text is used for debugging purposes\n */\n\n/**\n* Returns scriptlet code by param\n* @param {Source} source\n*/\nfunction getScriptletCode(source) {\n if (!validator.isValidScriptletName(source.name)) {\n return null;\n }\n\n const scriptlet = validator.getScriptletByName(source.name);\n let result = attachDependencies(scriptlet);\n result = addCall(scriptlet, result);\n result = source.engine === 'corelibs' || source.engine === 'test'\n ? wrapInNonameFunc(result)\n : passSourceAndProps(source, result);\n return result;\n}\n\n/**\n * Scriptlets variable\n *\n * @returns {Object} object with methods:\n * `invoke` method receives one argument with `Source` type\n * `validate` method receives one argument with `String` type\n */\nconst scriptletsObject = (() => ({\n invoke: getScriptletCode,\n isValidScriptletName: validator.isValidScriptletName,\n isValidScriptletRule,\n isAdgScriptletRule: validator.isAdgScriptletRule,\n isUboScriptletRule: validator.isUboScriptletRule,\n isAbpSnippetRule: validator.isAbpSnippetRule,\n convertUboToAdg: convertUboScriptletToAdg,\n convertAbpToAdg: convertAbpSnippetToAdg,\n convertScriptletToAdg,\n convertAdgToUbo: convertAdgScriptletToUbo,\n redirects: redirectsCjs,\n}))();\n\nexport default scriptletsObject;\n","import scriptletsObject from './index';\n\n/**\n * Expose scriptlets to global\n */\n// eslint-disable-next-line no-undef\nscriptlets = scriptletsObject;\n"],"names":["randomId","Math","random","toString","substr","setPropertyAccess","object","property","descriptor","currentDescriptor","Object","getOwnPropertyDescriptor","configurable","defineProperty","getPropertyInChain","base","chain","addProp","pos","indexOf","prop","slice","own","undefined","escapeRegExp","str","replace","toRegExp","length","RegExp","escaped","getBeforeRegExp","rx","index","search","substring","startsWith","prefix","endsWith","substringAfter","separator","substringBefore","wrapInSingleQuotes","getStringInBraces","firstIndex","lastIndex","lastIndexOf","createOnErrorHandler","rid","nativeOnError","window","onerror","onError","error","Function","args","apply","noopFunc","noopNull","trueFunc","falseFunc","noopThis","noopArray","noopStr","hit","source","message","verbose","log","console","bind","trace","ruleText","LOG_MARKER","e","__debug","observeDOMChanges","callback","observeAttrs","attrsToObserv","throttle","method","delay","wait","savedArgs","wrapper","setTimeout","THROTTLE_DELAY_MS","observer","MutationObserver","callbackWrapper","connect","observe","document","documentElement","childList","subtree","attributes","attributeFilter","disconnect","attachDependencies","scriptlet","injections","reduce","accum","dep","dependencies","name","addCall","code","passSourceAndProps","sourceString","JSON","stringify","argsString","map","params","wrapInNonameFunc","iterateWithTransitions","iterable","transitions","init","state","keys","i","ADG_SCRIPTLET_MASK","wordSaver","strs","saveSymb","s","saveStr","push","getAll","parseRule","TRANSITION","OPENED","PARAM","CLOSED","opened","rule","sep","char","transition","symb","Error","param","saver","preIndex","before","abortOnPropertyRead","abort","ReferenceError","setChainPropAccess","owner","chainInfo","setter","a","get","set","names","abortOnPropertyWrite","preventSetTimeout","match","nativeTimeout","nativeIsNaN","Number","isNaN","shouldLog","INVERT_MARKER","isNotMatch","isNotDelay","parseInt","timeoutWrapper","timeout","shouldPrevent","test","preventSetInterval","nativeInterval","setInterval","intervalWrapper","interval","preventWindowOpen","replacement","nativeOpen","open","openWrapper","result","isProp","propertyPart","propertyName","propertyValue","resObj","abortCurrentInlineScript","regex","getCurrentScript","currentScript","scripts","getElementsByTagName","ourScript","scriptEl","content","textContent","textContentGetter","Node","prototype","call","HTMLScriptElement","props","split","propIndex","baseName","currentValue","value","setConstant","constantValue","parseFloat","abs","canceled","mustCancel","removeCookie","removeCookieFromHost","cookieName","hostName","cookieSpec","domain1","domain2","path","expiration","cookie","rmCookie","forEach","cookieStr","trim","hostParts","location","hostname","join","addEventListener","preventAddEventListener","eventSearch","funcSearch","nativeAddEventListener","EventTarget","addEventListenerWrapper","eventName","funcToCheck","preventBab","nativeSetTimeout","babRegex","signatures","check","tokens","j","token","found","nativeEval","eval","bodyEl","body","style","removeProperty","el","getElementById","parentNode","removeChild","nowebrtc","RTCPeerConnection","webkitRTCPeerConnection","rtcReplacement","config","close","createDataChannel","createOffer","setRemoteDescription","rtc","b","send","logAddEventListener","callbackToLog","logEval","evalWrapper","nativeFunction","FunctionWrapper","create","constructor","noeval","preventEvalIf","payload","preventFab","Fab","clearEvent","emitEvent","on","onDetected","onNotDetected","setOption","FuckAdBlock","BlockAdBlock","fuckAdBlock","blockAdBlock","setPopadsDummy","PopAds","popns","defineProperties","preventPopadsNet","throwError","preventAdfly","isDigit","data","handler","encodedURL","evenChars","oddChars","charAt","ii","temp","decodedURL","atob","stop","onbeforeunload","href","val","applyHandler","err","debugOnPropertyRead","debugOnPropertyWrite","debugCurrentInlineScript","removeAttr","attrs","selector","rmattr","nodes","querySelectorAll","removed","node","attr","removeAttribute","removeClass","classNames","selectors","className","removeClassHandler","Set","foundedNodes","n","add","elements","element","classList","contains","remove","CLASS_ATTR_NAME","disableNewtabLinks","ev","target","localName","hasAttribute","stopPropagation","preventDefault","adjustSetInterval","boost","nativeIsFinite","isFinite","cb","d","adjustSetTimeout","dirString","times","dir","dirWrapper","jsonPrune","propsToRemove","requiredInitialProps","prunePaths","needlePaths","isPruningNeeded","root","needlePath","details","nestedPropName","pop","nativeParse","parse","parseWrapper","r","ownerObj","preventRequestAnimationFrame","nativeRequestAnimationFrame","requestAnimationFrame","doNotMatch","rafWrapper","logMessage","JS_RULE_MASK","COMMENT_MARKER","isComment","UBO_SCRIPTLET_MASK_REG","UBO_SCRIPTLET_MASK_1","UBO_SCRIPTLET_MASK_2","UBO_SCRIPTLET_EXCEPTION_MASK_1","UBO_SCRIPTLET_EXCEPTION_MASK_2","ABP_SCRIPTLET_MASK","ABP_SCRIPTLET_EXCEPTION_MASK","ADG_CSS_MASK_REG","isAdgScriptletRule","isUboScriptletRule","isAbpSnippetRule","getScriptletByName","scriptlets","scriptletsList","key","find","isValidScriptletName","ADG_UBO_REDIRECT_MARKER","ABP_REDIRECT_MARKER","VALID_SOURCE_TYPES","validAdgRedirects","redirects","filter","adg","objFromEntries","pairs","output","acc","uboToAdgCompatibility","ubo","abpToAdgCompatibility","abp","adgToUboCompatibility","validAdgCompatibility","REDIRECT_RULE_TYPES","VALID_ADG","marker","compatibility","ADG","UBO","ABP","parseModifiers","getRedirectName","ruleModifiers","redirectNamePart","isAdgRedirectRule","isRedirectRuleByType","type","redirectName","isValidAdgRedirectRule","isAdgRedirectCompatibleWithUbo","isUboRedirectCompatibleWithAdg","isAbpRedirectCompatibleWithAdg","hasValidContentType","sourceType","validator","ADGUARD_SCRIPTLET_MASK_REG","ADGUARD_SCRIPTLET_TEMPLATE","ADGUARD_SCRIPTLET_EXCEPTION_TEMPLATE","UBO_SCRIPTLET_TEMPLATE","UBO_SCRIPTLET_EXCEPTION_TEMPLATE","UBO_ALIAS_NAME_MARKER","UBO_XHR_TYPE","ADG_XHR_TYPE","getSentences","reg","replacePlaceholders","convertUboScriptletToAdg","domains","mask","template","arg","outputArg","adgRule","convertAbpSnippetToAdg","SEMICOLON_DIVIDER","convertScriptletToAdg","convertAdgScriptletToUbo","res","parsedName","parsedParams","adgScriptletObject","scriptletList","aliases","uboAlias","alias","includes","uboName","uboRule","isValidScriptletRule","input","rulesArray","isValid","parsedRule","convertUboRedirectToAdg","firstPartOfRule","uboModifiers","adgModifiers","adgName","convertAbpRedirectToAdg","abpModifiers","abpName","convertRedirectToAdg","convertAdgRedirectToUbo","GoogleAnalytics","Tracker","proto","googleAnalyticsName","GoogleAnalyticsObject","ga","len","arguments","lastArg","hitCallback","ex","getByName","loaded","dataLayer","hide","end","GoogleAnalyticsGa","Gaq","Na","O","Sa","Ta","Va","_createAsyncTracker","_getAsyncTracker","_getPlugin","Array","isArray","assign","gaq","asyncTrackers","_gaq","shift","qf","Gat","api","tracker","funcName","_getLinkerUrl","_anonymizeIP","_createTracker","_forceSSL","_getTracker","_getTrackerByName","_getTrackers","aa","ab","hb","la","oa","pa","u","gat","_gat","GoogleSyndicationAdsByGoogle","adsbygoogle","adElems","css","executed","setAttribute","aswiftIframe","createElement","id","appendChild","googleadsIframe","GoogleTagManagerGtm","eventCallback","GoogleTagServicesGpt","companionAdsService","enableSyncLoading","setRefreshUnfilledSlots","contentService","setContent","PassbackSlot","display","setClickUrl","setTagForChildDirectedTreatment","setTargeting","updateTargetingFromMap","SizeMappingBuilder","addSize","build","Slot","addService","clearCategoryExclusions","clearTargeting","defineSizeMapping","getAdUnitPath","getAttributeKeys","getCategoryExclusions","getDomId","getSlotElementId","getSlotId","getTargeting","getTargetingKeys","setCategoryExclusion","setCollapseEmptyDiv","pubAdsService","clear","clearTagForChildDirectedTreatment","collapseEmptyDivs","defineOutOfPagePassback","definePassback","disableInitialLoad","enableAsyncRendering","enableSingleRequest","enableSyncRendering","enableVideoAds","getSlots","refresh","setCentering","setCookieOptions","setForceSafeFrame","setLocation","setPublisherProvidedId","setRequestNonPersonalizedAds","setSafeFrameConfig","setVideoContent","updateCorrelator","googletag","cmd","apiReady","companionAds","defineOutOfPageSlot","defineSlot","destroySlots","disablePublisherConsole","enableServices","getVersion","pubads","pubadsReady","setAdIframeTitle","sizeMapping","ScoreCardResearchBeacon","COMSCORE","purge","_comscore","beacon","metrikaYandexTag","asyncCallbackFromOptions","options","ctx","addFileExtension","extLink","file","getClientID","hitFunc","notBounce","reachGoal","setUserID","userParams","ym","metrikaYandexWatch","cbName","Metrika","url","Ya","func","getRedirectByName","redirectsList","getRedirectCode","redirect","engine","redirectsCjs","getCode","getScri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BA,oBAH6B;IAI7BjF,IAAAA,kBAAkB,EAAE+C,SAAS,CAAC/C,kBAJD;IAK7BC,IAAAA,kBAAkB,EAAE8C,SAAS,CAAC9C,kBALD;IAM7BC,IAAAA,gBAAgB,EAAE6C,SAAS,CAAC7C,gBANC;IAO7BsQ,IAAAA,eAAe,EAAE7M,wBAPY;IAQ7B8M,IAAAA,eAAe,EAAEvM,sBARY;IAS7BE,IAAAA,qBAAqB,EAArBA,qBAT6B;IAU7BsM,IAAAA,eAAe,EAAErM,wBAVY;IAW7BxD,IAAAA,SAAS,EAAEsP;IAXkB,GAAP;IAAA,CAAD,EAAzB;;ICtDA;;;IAGA;;IACA/P,UAAU,GAAGkQ,gBAAb;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"scriptlets.js","sources":["../src/helpers/random-id.js","../src/helpers/set-property-access.js","../src/helpers/get-property-in-chain.js","../src/helpers/string-utils.js","../src/helpers/create-on-error-handler.js","../src/helpers/noop.js","../src/helpers/hit.js","../src/helpers/observer.js","../src/helpers/index.js","../src/helpers/injector.js","../node_modules/@babel/runtime/helpers/arrayWithHoles.js","../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js","../node_modules/@babel/runtime/helpers/nonIterableRest.js","../node_modules/@babel/runtime/helpers/slicedToArray.js","../node_modules/@babel/runtime/helpers/defineProperty.js","../src/helpers/parse-rule.js","../src/scriptlets/abort-on-property-read.js","../src/scriptlets/abort-on-property-write.js","../src/scriptlets/prevent-setTimeout.js","../src/scriptlets/prevent-setInterval.js","../src/scriptlets/prevent-window-open.js","../src/scriptlets/abort-current-inline-script.js","../src/scriptlets/set-constant.js","../src/scriptlets/remove-cookie.js","../src/scriptlets/prevent-addEventListener.js","../src/scriptlets/prevent-bab.js","../src/scriptlets/nowebrtc.js","../src/scriptlets/log-addEventListener.js","../src/scriptlets/log-eval.js","../src/scriptlets/log.js","../src/scriptlets/noeval.js","../src/scriptlets/prevent-eval-if.js","../src/scriptlets/prevent-fab-3.2.0.js","../src/scriptlets/set-popads-dummy.js","../src/scriptlets/prevent-popads-net.js","../src/scriptlets/prevent-adfly.js","../src/scriptlets/debug-on-property-read.js","../src/scriptlets/debug-on-property-write.js","../src/scriptlets/debug-current-inline-script.js","../src/scriptlets/remove-attr.js","../src/scriptlets/remove-class.js","../src/scriptlets/disable-newtab-links.js","../src/scriptlets/adjust-setInterval.js","../src/scriptlets/adjust-setTimeout.js","../src/scriptlets/dir-string.js","../src/scriptlets/json-prune.js","../src/scriptlets/prevent-requestAnimationFrame.js","../src/scriptlets/scriptletsList.js","../src/helpers/validator.js","../node_modules/@babel/runtime/helpers/iterableToArray.js","../node_modules/@babel/runtime/helpers/toArray.js","../src/helpers/converter.js","../src/redirects/google-analytics.js","../src/redirects/google-analytics-ga.js","../src/redirects/googlesyndication-adsbygoogle.js","../src/redirects/googletagmanager-gtm.js","../src/redirects/googletagservices-gpt.js","../src/redirects/scorecardresearch-beacon.js","../src/redirects/metrika-yandex-tag.js","../src/redirects/metrika-yandex-watch.js","../src/redirects/index.js","../src/scriptlets/index.js","../src/scriptlets/scriptletsWrapper.js"],"sourcesContent":["\n/**\n * Generate random six symbols id\n */\nexport function randomId() {\n return Math.random().toString(36).substr(2, 9);\n}\n","/**\n * Set getter and setter to property if it's configurable\n * @param {Object} object target object with property\n * @param {string} property property name\n * @param {Object} descriptor contains getter and setter functions\n * @returns {boolean} is operation successful\n */\nexport function setPropertyAccess(object, property, descriptor) {\n const currentDescriptor = Object.getOwnPropertyDescriptor(object, property);\n if (currentDescriptor && !currentDescriptor.configurable) {\n return false;\n }\n Object.defineProperty(object, property, descriptor);\n return true;\n}\n","/**\n * @typedef Chain\n * @property {Object} base\n * @property {string} prop\n * @property {string} [chain]\n */\n\n/**\n * Check is property exist in base object recursively\n *\n * If property doesn't exist in base object,\n * defines this property (for addProp = true)\n * and returns base, property name and remaining part of property chain\n *\n * @param {Object} base\n * @param {string} chain\n * @param {boolean} [addProp=true]\n * defines is nonexistent base property should be assigned as 'undefined'\n * @returns {Chain}\n */\nexport function getPropertyInChain(base, chain, addProp = true) {\n const pos = chain.indexOf('.');\n if (pos === -1) {\n return { base, prop: chain };\n }\n const prop = chain.slice(0, pos);\n const own = base[prop];\n chain = chain.slice(pos + 1);\n if (own !== undefined) {\n return getPropertyInChain(own, chain, addProp);\n }\n\n if (!addProp) {\n return false;\n }\n\n Object.defineProperty(base, prop, { configurable: true });\n return { base: own, prop, chain };\n}\n","/**\n * Escapes special chars in string\n * @param {string} str\n * @returns {string}\n */\nexport const escapeRegExp = (str) => str.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n\n/**\n * Converts search string to the regexp\n * TODO think about nested dependencies, but be careful with dependency loops\n * @param {string} str search string\n * @returns {RegExp}\n */\nexport const toRegExp = (str) => {\n if (str[0] === '/' && str[str.length - 1] === '/') {\n return new RegExp(str.slice(1, -1));\n }\n const escaped = str.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n return new RegExp(escaped);\n};\n\n/**\n * Get string before regexp first match\n * @param {string} str\n * @param {RegExp} rx\n */\nexport const getBeforeRegExp = (str, rx) => {\n const index = str.search(rx);\n return str.substring(0, index);\n};\n\nexport const startsWith = (str, prefix) => {\n return str && str.indexOf(prefix) === 0;\n};\n\nexport const endsWith = (str, prefix) => {\n return str && str.indexOf(prefix) === str.length - 1;\n};\n\nexport const substringAfter = (str, separator) => {\n if (!str) {\n return str;\n }\n const index = str.indexOf(separator);\n return index < 0 ? '' : str.substring(index + separator.length);\n};\n\nexport const substringBefore = (str, separator) => {\n if (!str || !separator) {\n return str;\n }\n const index = str.indexOf(separator);\n return index < 0 ? str : str.substring(0, index);\n};\n\n/**\n * Wrap str in single qoutes and replaces single quotes to doudle one\n * @param {string} str\n */\nexport const wrapInSingleQuotes = (str) => {\n if ((str[0] === '\\'' && str[str.length - 1] === '\\'')\n || (str[0] === '\"' && str[str.length - 1] === '\"')) {\n str = str.substring(1, str.length - 1);\n }\n // eslint-disable-next-line no-useless-escape\n str = str.replace(/\\'/g, '\"');\n\n return `'${str}'`;\n};\n\n/**\n * Returns substring enclosed in the widest braces\n * @param {string} str\n */\nexport const getStringInBraces = (str) => {\n const firstIndex = str.indexOf('(');\n const lastIndex = str.lastIndexOf(')');\n return str.substring(firstIndex + 1, lastIndex);\n};\n","/**\n * Generates function which silents global errors on page generated by scriptlet\n * If error doesn't belong to our error we transfer it to the native onError handler\n * @param {string} rid - unique identifier of scriptlet\n * @return {onError}\n */\nexport function createOnErrorHandler(rid) {\n // eslint-disable-next-line consistent-return\n const nativeOnError = window.onerror;\n return function onError(error, ...args) {\n if (typeof error === 'string' && error.indexOf(rid) !== -1) {\n return true;\n }\n if (nativeOnError instanceof Function) {\n return nativeOnError.apply(this, [error, ...args]);\n }\n return false;\n };\n}\n","/**\n * Noop function\n */\nexport const noopFunc = () => { };\n\n/**\n * Function returns null\n */\nexport const noopNull = () => null;\n\n/**\n * Function returns true\n */\nexport const trueFunc = () => true;\n\n/**\n * Function returns false\n */\nexport const falseFunc = () => false;\n\n/**\n * Function returns this\n */\nexport function noopThis() {\n return this;\n}\n\n/**\n * Function returns empty array\n */\nexport const noopArray = () => [];\n\n/**\n * Function returns empty string\n */\nexport const noopStr = () => '';\n","/* eslint-disable no-console, no-underscore-dangle */\n/**\n * Hit used only for debug purposes now\n * @param {Source} source\n * @param {string} [message] - optional message;\n * use LOG_MARKER = 'log: ' at the start of a message\n * for logging scriptlets\n */\nexport const hit = (source, message) => {\n if (source.verbose !== true) {\n return;\n }\n\n try {\n const log = console.log.bind(console);\n const trace = console.trace.bind(console);\n\n const prefix = source.ruleText || '';\n\n // Used to check if scriptlet uses 'hit' function for logging\n const LOG_MARKER = 'log: ';\n\n if (message) {\n if (message.indexOf(LOG_MARKER) === -1) {\n log(`${prefix} message:\\n${message}`);\n } else {\n log(message.slice(LOG_MARKER.length));\n }\n }\n\n log(`${prefix} trace start`);\n if (trace) {\n trace();\n }\n log(`${prefix} trace end`);\n } catch (e) {\n // try catch for Edge 15\n // In according to this issue https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/14495220/\n // console.log throws an error\n }\n\n // This is necessary for unit-tests only!\n if (typeof window.__debug === 'function') {\n window.__debug(source);\n }\n};\n","/**\n * DOM tree changes observer. Used for 'remove-attr' and 'remove-class' scriptlets\n * @param {Function} callback\n * @param {Boolean} observeAttrs - optional parameter - should observer check attibutes changes\n */\nexport const observeDOMChanges = (callback, observeAttrs = false, attrsToObserv = []) => {\n /**\n * Returns a wrapper, passing the call to 'method' at maximum once per 'delay' milliseconds.\n * Those calls that fall into the \"cooldown\" period, are ignored\n * @param {Function} method\n * @param {Number} delay - milliseconds\n */\n const throttle = (method, delay) => {\n let wait = false;\n let savedArgs;\n const wrapper = (...args) => {\n if (wait) {\n savedArgs = args;\n return;\n }\n method(...args);\n wait = true;\n setTimeout(() => {\n wait = false;\n if (savedArgs) {\n wrapper(savedArgs);\n savedArgs = null;\n }\n }, delay);\n };\n return wrapper;\n };\n\n /**\n * 'delay' in milliseconds for 'throttle' method\n */\n const THROTTLE_DELAY_MS = 20;\n /**\n * Used for remove-class\n */\n // eslint-disable-next-line no-use-before-define\n const observer = new MutationObserver(throttle(callbackWrapper, THROTTLE_DELAY_MS));\n\n const connect = () => {\n if (attrsToObserv.length > 0) {\n observer.observe(document.documentElement, {\n childList: true,\n subtree: true,\n attributes: observeAttrs,\n attributeFilter: attrsToObserv,\n });\n } else {\n observer.observe(document.documentElement, {\n childList: true,\n subtree: true,\n attributes: observeAttrs,\n });\n }\n };\n const disconnect = () => {\n observer.disconnect();\n };\n function callbackWrapper() {\n disconnect();\n callback();\n connect();\n }\n\n connect();\n};\n","/**\n * This file must export all used dependencies\n */\nexport * from './random-id';\nexport * from './set-property-access';\nexport * from './get-property-in-chain';\nexport * from './string-utils';\nexport * from './create-on-error-handler';\nexport * from './noop';\nexport * from './hit';\nexport * from './observer';\n","import * as dependencies from '.';\n\n\n/**\n * Concat dependencies to scriptlet code\n * @param {string} scriptlet string view of scriptlet\n */\nexport function attachDependencies(scriptlet) {\n const { injections = [] } = scriptlet;\n return injections.reduce((accum, dep) => `${accum}\\n${dependencies[dep.name]}`, scriptlet.toString());\n}\n\n/**\n * Add scriptlet call to existing code\n * @param {Function} scriptlet\n * @param {string} code\n */\nexport function addCall(scriptlet, code) {\n return `${code};\n const updatedArgs = args ? [].concat(source).concat(args) : [source];\n ${scriptlet.name}.apply(this, updatedArgs);\n `;\n}\n\n/**\n * Wrap function into IIFE (Immediately invoked function expression)\n *\n * @param {Source} source - object with scriptlet properties\n * @param {string} code - scriptlet source code with dependencies\n *\n * @returns {string} full scriptlet code\n *\n * @example\n * const source = {\n * args: [\"aaa\", \"bbb\"],\n * name: 'noeval',\n * };\n * const code = \"function noeval(source, args) { alert(source); } noeval.apply(this, args);\"\n * const result = wrapInIIFE(source, code);\n *\n * // result\n * `(function(source, args) {\n * function noeval(source) { alert(source); }\n * noeval.apply(this, args);\n * )({\"args\": [\"aaa\", \"bbb\"], \"name\":\"noeval\"}, [\"aaa\", \"bbb\"])`\n */\nexport function passSourceAndProps(source, code) {\n if (source.hit) {\n source.hit = source.hit.toString();\n }\n const sourceString = JSON.stringify(source);\n const argsString = source.args ? `[${source.args.map(JSON.stringify)}]` : undefined;\n const params = argsString ? `${sourceString}, ${argsString}` : sourceString;\n return `(function(source, args){\\n${code}\\n})(${params});`;\n}\n\n/**\n * Wrap code in no name function\n * @param {string} code which must be wrapped\n */\nexport function wrapInNonameFunc(code) {\n return `function(source, args){\\n${code}\\n}`;\n}\n","function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\n\nmodule.exports = _arrayWithHoles;","function _iterableToArrayLimit(arr, i) {\n if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === \"[object Arguments]\")) {\n return;\n }\n\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}\n\nmodule.exports = _iterableToArrayLimit;","function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance\");\n}\n\nmodule.exports = _nonIterableRest;","var arrayWithHoles = require(\"./arrayWithHoles\");\n\nvar iterableToArrayLimit = require(\"./iterableToArrayLimit\");\n\nvar nonIterableRest = require(\"./nonIterableRest\");\n\nfunction _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || nonIterableRest();\n}\n\nmodule.exports = _slicedToArray;","function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nmodule.exports = _defineProperty;","/**\n * Iterate over iterable argument and evaluate current state with transitions\n * @param {string} init first transition name\n * @param {Array|Collection|string} iterable\n * @param {Object} transitions transtion functions\n * @param {any} args arguments which should be passed to transition functions\n */\nfunction iterateWithTransitions(iterable, transitions, init, args) {\n let state = init || Object.keys(transitions)[0];\n for (let i = 0; i < iterable.length; i += 1) {\n state = transitions[state](iterable, i, args);\n }\n return state;\n}\n\n/**\n * AdGuard scriptlet rule mask\n */\nexport const ADG_SCRIPTLET_MASK = '#//scriptlet';\n\n/**\n * Helper to accumulate an array of strings char by char\n */\nconst wordSaver = () => {\n let str = '';\n const strs = [];\n const saveSymb = (s) => {\n str += s;\n return str;\n };\n const saveStr = () => {\n strs.push(str);\n str = '';\n };\n const getAll = () => [...strs];\n\n return { saveSymb, saveStr, getAll };\n};\n\nconst substringAfter = (str, separator) => {\n if (!str) {\n return str;\n }\n const index = str.indexOf(separator);\n return index < 0 ? '' : str.substring(index + separator.length);\n};\n\n/**\n * Parse and validate scriptlet rule\n * @param {*} ruleText\n * @returns {{name: string, args: Array}}\n */\nexport const parseRule = (ruleText) => {\n ruleText = substringAfter(ruleText, ADG_SCRIPTLET_MASK);\n /**\n * Transition names\n */\n const TRANSITION = {\n OPENED: 'opened',\n PARAM: 'param',\n CLOSED: 'closed',\n };\n\n /**\n * Transition function: the current index position in start, end or between params\n * @param {string} rule\n * @param {number} index\n * @param {Object} Object\n * @property {Object} Object.sep contains prop symb with current separator char\n */\n const opened = (rule, index, { sep }) => {\n const char = rule[index];\n let transition;\n switch (char) {\n case ' ':\n case '(':\n case ',': {\n transition = TRANSITION.OPENED;\n break;\n }\n case '\\'':\n case '\"': {\n sep.symb = char;\n transition = TRANSITION.PARAM;\n break;\n }\n case ')': {\n transition = index === rule.length - 1\n ? TRANSITION.CLOSED\n : TRANSITION.OPENED;\n break;\n }\n default: {\n throw new Error('The rule is not a scriptlet');\n }\n }\n\n return transition;\n };\n /**\n * Transition function: the current index position inside param\n * @param {string} rule\n * @param {number} index\n * @param {Object} Object\n * @property {Object} Object.sep contains prop `symb` with current separator char\n * @property {Object} Object.saver helper which allow to save strings by car by char\n */\n const param = (rule, index, { saver, sep }) => {\n const char = rule[index];\n switch (char) {\n case '\\'':\n case '\"': {\n const preIndex = index - 1;\n const before = rule[preIndex];\n if (char === sep.symb && before !== '\\\\') {\n sep.symb = null;\n saver.saveStr();\n return TRANSITION.OPENED;\n }\n }\n // eslint-disable-next-line no-fallthrough\n default: {\n saver.saveSymb(char);\n return TRANSITION.PARAM;\n }\n }\n };\n const transitions = {\n [TRANSITION.OPENED]: opened,\n [TRANSITION.PARAM]: param,\n [TRANSITION.CLOSED]: () => { },\n };\n const sep = { symb: null };\n const saver = wordSaver();\n const state = iterateWithTransitions(ruleText, transitions, TRANSITION.OPENED, { sep, saver });\n\n if (state !== 'closed') {\n throw new Error(`Invalid scriptlet rule ${ruleText}`);\n }\n\n const args = saver.getAll();\n return {\n name: args[0],\n args: args.slice(1),\n };\n};\n","import {\n randomId, setPropertyAccess, getPropertyInChain, createOnErrorHandler, hit,\n} from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet abort-on-property-read\n *\n * @description\n * Aborts a script when it attempts to **read** the specified property.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#abort-on-property-readjs-\n *\n * Related ABP source:\n * https://github.com/adblockplus/adblockpluscore/blob/6b2a309054cc23432102b85d13f12559639ef495/lib/content/snippets.js#L864\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet('abort-on-property-read', )\n * ```\n *\n * **Parameters**\n * - `property` (required) path to a property (joined with `.` if needed). The property must be attached to `window`.\n *\n * **Examples**\n * ```\n * ! Aborts script when it tries to access `window.alert`\n * example.org#%#//scriptlet('abort-on-property-read', 'alert')\n *\n * ! Aborts script when it tries to access `navigator.language`\n * example.org#%#//scriptlet('abort-on-property-read', 'navigator.language')\n * ```\n */\n/* eslint-enable max-len */\nexport function abortOnPropertyRead(source, property) {\n if (!property) {\n return;\n }\n const rid = randomId();\n const abort = () => {\n hit(source);\n throw new ReferenceError(rid);\n };\n const setChainPropAccess = (owner, property) => {\n const chainInfo = getPropertyInChain(owner, property);\n let { base } = chainInfo;\n const { prop, chain } = chainInfo;\n if (chain) {\n const setter = (a) => {\n base = a;\n if (a instanceof Object) {\n setChainPropAccess(a, chain);\n }\n };\n Object.defineProperty(owner, prop, {\n get: () => base,\n set: setter,\n });\n return;\n }\n\n setPropertyAccess(base, prop, {\n get: abort,\n set: () => {\n },\n });\n };\n\n setChainPropAccess(window, property);\n\n window.onerror = createOnErrorHandler(rid)\n .bind();\n}\n\nabortOnPropertyRead.names = [\n 'abort-on-property-read',\n 'abort-on-property-read.js',\n 'ubo-abort-on-property-read.js',\n 'aopr.js',\n 'ubo-aopr.js',\n 'abp-abort-on-property-read',\n];\nabortOnPropertyRead.injections = [\n randomId,\n setPropertyAccess,\n getPropertyInChain,\n createOnErrorHandler,\n hit,\n];\n","import {\n randomId, setPropertyAccess, getPropertyInChain, createOnErrorHandler, hit,\n} from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet abort-on-property-write\n *\n * @description\n * Aborts a script when it attempts to **write** the specified property.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#abort-on-property-writejs-\n *\n * Related ABP source:\n * https://github.com/adblockplus/adblockpluscore/blob/6b2a309054cc23432102b85d13f12559639ef495/lib/content/snippets.js#L896\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet('abort-on-property-write', )\n * ```\n *\n * **Parameters**\n * - `property` (required) path to a property (joined with `.` if needed). The property must be attached to `window`.\n *\n * **Examples**\n * ```\n * ! Aborts script when it tries to set `window.adblock` value\n * example.org#%#//scriptlet('abort-on-property-write', 'adblock')\n * ```\n */\n/* eslint-enable max-len */\nexport function abortOnPropertyWrite(source, property) {\n if (!property) {\n return;\n }\n const rid = randomId();\n const abort = () => {\n hit(source);\n throw new ReferenceError(rid);\n };\n const setChainPropAccess = (owner, property) => {\n const chainInfo = getPropertyInChain(owner, property);\n let { base } = chainInfo;\n const { prop, chain } = chainInfo;\n if (chain) {\n const setter = (a) => {\n base = a;\n if (a instanceof Object) {\n setChainPropAccess(a, chain);\n }\n };\n Object.defineProperty(owner, prop, {\n get: () => base,\n set: setter,\n });\n return;\n }\n\n setPropertyAccess(base, prop, { set: abort });\n };\n\n setChainPropAccess(window, property);\n\n window.onerror = createOnErrorHandler(rid).bind();\n}\n\nabortOnPropertyWrite.names = [\n 'abort-on-property-write',\n 'abort-on-property-write.js',\n 'ubo-abort-on-property-write.js',\n 'aopw.js',\n 'ubo-aopw.js',\n 'abp-abort-on-property-write',\n];\n\nabortOnPropertyWrite.injections = [\n randomId,\n setPropertyAccess,\n getPropertyInChain,\n createOnErrorHandler,\n hit,\n];\n","import {\n hit, noopFunc, toRegExp, startsWith,\n} from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet prevent-setTimeout\n *\n * @description\n * Prevents a `setTimeout` call if:\n * 1) the text of the callback is matching the specified search string/regexp which does not start with `!`;\n * otherwise mismatched calls should be defused;\n * 2) the timeout is matching the specified delay; otherwise mismatched calls should be defused.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#no-settimeout-ifjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"prevent-setTimeout\"[, [, ]])\n * ```\n *\n * **Parameters**\n *\n * Call with no arguments will log calls to setTimeout while debugging (`log-setTimeout` superseding),\n * so production filter lists' rules definitely require at least one of the parameters:\n * - `search` (optional) string or regular expression.\n * If starts with `!`, scriptlet will not match the stringified callback but all other will be defused.\n * If do not start with `!`, the stringified callback will be matched.\n * If not set, prevents all `setTimeout` calls due to specified `delay`.\n * - `delay` (optional) must be an integer.\n * If starts with `!`, scriptlet will not match the delay but all other will be defused.\n * If do not start with `!`, the delay passed to the `setTimeout` call will be matched.\n *\n * **Examples**\n *\n * 1. Prevents `setTimeout` calls if the callback matches `/\\.test/` regardless of the delay.\n * ```bash\n * example.org#%#//scriptlet(\"prevent-setTimeout\", \"/\\.test/\")\n * ```\n *\n * For instance, the following call will be prevented:\n * ```javascript\n * setTimeout(function () {\n * window.test = \"value\";\n * }, 100);\n * ```\n *\n * 2. Prevents `setTimeout` calls if the callback does not contain `value`.\n * ```\n * example.org#%#//scriptlet(\"prevent-setTimeout\", \"!value\")\n * ```\n *\n * For instance, only the first of the following calls will be prevented:\n * ```javascript\n * setTimeout(function () {\n * window.test = \"test -- prevented\";\n * }, 300);\n * setTimeout(function () {\n * window.test = \"value -- executed\";\n * }, 400);\n * setTimeout(function () {\n * window.value = \"test -- executed\";\n * }, 500);\n * ```\n *\n * 3. Prevents `setTimeout` calls if the callback contains `value` and the delay is not set to `300`.\n * ```\n * example.org#%#//scriptlet(\"prevent-setTimeout\", \"value\", \"!300\")\n * ```\n *\n * For instance, only the first of the following calls will not be prevented:\n * ```javascript\n * setTimeout(function () {\n * window.test = \"value 1 -- executed\";\n * }, 300);\n * setTimeout(function () {\n * window.test = \"value 2 -- prevented\";\n * }, 400);\n * setTimeout(function () {\n * window.test = \"value 3 -- prevented\";\n * }, 500);\n * ```\n *\n * 4. Prevents `setTimeout` calls if the callback does not contain `value` and the delay is not set to `300`.\n * ```\n * example.org#%#//scriptlet(\"prevent-setTimeout\", \"!value\", \"!300\")\n * ```\n *\n * For instance, only the second of the following calls will be prevented:\n * ```javascript\n * setTimeout(function () {\n * window.test = \"test -- executed\";\n * }, 300);\n * setTimeout(function () {\n * window.test = \"test -- prevented\";\n * }, 400);\n * setTimeout(function () {\n * window.test = \"value -- executed\";\n * }, 400);\n * setTimeout(function () {\n * window.value = \"test -- executed\";\n * }, 500);\n * ```\n */\n/* eslint-enable max-len */\nexport function preventSetTimeout(source, match, delay) {\n const nativeTimeout = window.setTimeout;\n const nativeIsNaN = Number.isNaN || window.isNaN; // eslint-disable-line compat/compat\n const log = console.log.bind(console); // eslint-disable-line no-console\n\n // logs setTimeouts to console if no arguments have been specified\n const shouldLog = ((typeof match === 'undefined') && (typeof delay === 'undefined'));\n\n const INVERT_MARKER = '!';\n\n const isNotMatch = startsWith(match, INVERT_MARKER);\n if (isNotMatch) {\n match = match.slice(1);\n }\n const isNotDelay = startsWith(delay, INVERT_MARKER);\n if (isNotDelay) {\n delay = delay.slice(1);\n }\n\n delay = parseInt(delay, 10);\n delay = nativeIsNaN(delay) ? null : delay;\n\n match = match ? toRegExp(match) : toRegExp('/.?/');\n\n const timeoutWrapper = (callback, timeout, ...args) => {\n let shouldPrevent = false;\n if (shouldLog) {\n hit(source);\n log(`setTimeout(\"${callback.toString()}\", ${timeout})`);\n } else if (!delay) {\n shouldPrevent = match.test(callback.toString()) !== isNotMatch;\n } else if (match === '/.?/') {\n shouldPrevent = (timeout === delay) !== isNotDelay;\n } else {\n shouldPrevent = match.test(callback.toString()) !== isNotMatch\n && (timeout === delay) !== isNotDelay;\n }\n\n if (shouldPrevent) {\n hit(source);\n return nativeTimeout(noopFunc, timeout);\n }\n\n return nativeTimeout.apply(window, [callback, timeout, ...args]);\n };\n window.setTimeout = timeoutWrapper;\n}\n\npreventSetTimeout.names = [\n 'prevent-setTimeout',\n 'no-setTimeout-if.js', // new implementation of setTimeout-defuser.js\n 'ubo-no-setTimeout-if.js',\n 'setTimeout-defuser.js', // old name should be supported as well\n 'ubo-setTimeout-defuser.js',\n 'nostif.js', // new short name of no-setTimeout-if\n 'ubo-nostif.js',\n 'std.js', // old short scriptlet name\n 'ubo-std.js',\n];\n\npreventSetTimeout.injections = [toRegExp, startsWith, hit, noopFunc];\n","import {\n hit, noopFunc, toRegExp, startsWith,\n} from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet prevent-setInterval\n *\n * @description\n * Prevents a `setInterval` call if:\n * 1) the text of the callback is matching the specified `search` string/regexp which does not start with `!`;\n * otherwise mismatched calls should be defused;\n * 2) the interval is matching the specified `delay`; otherwise mismatched calls should be defused.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#no-setinterval-ifjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"prevent-setInterval\"[, [, ]])\n * ```\n *\n * **Parameters**\n *\n * Call with no arguments will log calls to setInterval while debugging (`log-setInterval` superseding),\n * so production filter lists' rules definitely require at least one of the parameters:\n * - `search` (optional) string or regular expression.\n * If starts with `!`, scriptlet will not match the stringified callback but all other will be defused.\n * If do not start with `!`, the stringified callback will be matched.\n * If not set, prevents all `setInterval` calls due to specified `delay`.\n * - `delay` (optional) must be an integer.\n * If starts with `!`, scriptlet will not match the delay but all other will be defused.\n * If do not start with `!`, the delay passed to the `setInterval` call will be matched.\n *\n * **Examples**\n *\n * 1. Prevents `setInterval` calls if the callback matches `/\\.test/` regardless of the delay.\n * ```bash\n * example.org#%#//scriptlet(\"prevent-setInterval\", \"/\\.test/\")\n * ```\n *\n * For instance, the following call will be prevented:\n * ```javascript\n * setInterval(function () {\n * window.test = \"value\";\n * }, 100);\n * ```\n *\n * 2. Prevents `setInterval` calls if the callback does not contain `value`.\n * ```\n * example.org#%#//scriptlet(\"prevent-setInterval\", \"!value\")\n * ```\n *\n * For instance, only the first of the following calls will be prevented:\n * ```javascript\n * setInterval(function () {\n * window.test = \"test -- prevented\";\n * }, 300);\n * setInterval(function () {\n * window.test = \"value -- executed\";\n * }, 400);\n * setInterval(function () {\n * window.value = \"test -- executed\";\n * }, 500);\n * ```\n *\n * 3. Prevents `setInterval` calls if the callback contains `value` and the delay is not set to `300`.\n * ```\n * example.org#%#//scriptlet(\"prevent-setInterval\", \"value\", \"!300\")\n * ```\n *\n * For instance, only the first of the following calls will not be prevented:\n * ```javascript\n * setInterval(function () {\n * window.test = \"value 1 -- executed\";\n * }, 300);\n * setInterval(function () {\n * window.test = \"value 2 -- prevented\";\n * }, 400);\n * setInterval(function () {\n * window.test = \"value 3 -- prevented\";\n * }, 500);\n * ```\n *\n * 4. Prevents `setInterval` calls if the callback does not contain `value` and the delay is not set to `300`.\n * ```\n * example.org#%#//scriptlet(\"prevent-setInterval\", \"!value\", \"!300\")\n * ```\n *\n * For instance, only the second of the following calls will be prevented:\n * ```javascript\n * setInterval(function () {\n * window.test = \"test -- executed\";\n * }, 300);\n * setInterval(function () {\n * window.test = \"test -- prevented\";\n * }, 400);\n * setInterval(function () {\n * window.test = \"value -- executed\";\n * }, 400);\n * setInterval(function () {\n * window.value = \"test -- executed\";\n * }, 500);\n * ```\n */\n/* eslint-enable max-len */\nexport function preventSetInterval(source, match, delay) {\n const nativeInterval = window.setInterval;\n const nativeIsNaN = Number.isNaN || window.isNaN; // eslint-disable-line compat/compat\n const log = console.log.bind(console); // eslint-disable-line no-console\n\n // logs setIntervals to console if no arguments have been specified\n const shouldLog = ((typeof match === 'undefined') && (typeof delay === 'undefined'));\n\n const INVERT_MARKER = '!';\n\n const isNotMatch = startsWith(match, INVERT_MARKER);\n if (isNotMatch) {\n match = match.slice(1);\n }\n const isNotDelay = startsWith(delay, INVERT_MARKER);\n if (isNotDelay) {\n delay = delay.slice(1);\n }\n\n delay = parseInt(delay, 10);\n delay = nativeIsNaN(delay) ? null : delay;\n\n match = match ? toRegExp(match) : toRegExp('/.?/');\n\n const intervalWrapper = (callback, interval, ...args) => {\n let shouldPrevent = false;\n if (shouldLog) {\n hit(source);\n log(`setInterval(\"${callback.toString()}\", ${interval})`);\n } else if (!delay) {\n shouldPrevent = match.test(callback.toString()) !== isNotMatch;\n } else if (match === '/.?/') {\n shouldPrevent = (interval === delay) !== isNotDelay;\n } else {\n shouldPrevent = match.test(callback.toString()) !== isNotMatch\n && (interval === delay) !== isNotDelay;\n }\n\n if (shouldPrevent) {\n hit(source);\n return nativeInterval(noopFunc, interval);\n }\n\n return nativeInterval.apply(window, [callback, interval, ...args]);\n };\n window.setInterval = intervalWrapper;\n}\n\npreventSetInterval.names = [\n 'prevent-setInterval',\n 'no-setInterval-if.js', // new implementation of setInterval-defuser.js\n 'ubo-no-setInterval-if.js',\n 'setInterval-defuser.js', // old name should be supported as well\n 'ubo-setInterval-defuser.js',\n 'nosiif.js', // new short name of no-setInterval-if\n 'ubo-nosiif.js',\n 'sid.js', // old short scriptlet name\n 'ubo-sid.js',\n];\n\npreventSetInterval.injections = [toRegExp, startsWith, hit, noopFunc];\n","import {\n toRegExp,\n substringBefore,\n substringAfter,\n startsWith,\n endsWith,\n hit,\n noopFunc,\n trueFunc,\n} from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet prevent-window-open\n *\n * @description\n * Prevents `window.open` calls when URL either matches or not matches the specified string/regexp. Using it without parameters prevents all `window.open` calls.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#windowopen-defuserjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet('prevent-window-open'[, [, [, ]]])\n * ```\n *\n * **Parameters**\n * - `match` (optional) defaults to \"matching\", any positive number or nothing for \"matching\", 0 or empty string for \"not matching\",\n * - `search` (optional) string or regexp for matching the URL passed to `window.open` call; defaults to search all `window.open` call.\n * - `replacement` (optional) string to return prop value or property instead of window.open; defaults to return noopFunc\n * **Example**\n *\n * 1. Prevent all `window.open` calls:\n * ```\n * example.org#%#//scriptlet('prevent-window-open')\n * ```\n *\n * 2. Prevent `window.open` for all URLs containing `example`:\n * ```\n * example.org#%#//scriptlet('prevent-window-open', '1', 'example')\n * ```\n *\n * 3. Prevent `window.open` for all URLs matching RegExp `/example\\./`:\n * ```\n * example.org#%#//scriptlet('prevent-window-open', '1', '/example\\./')\n * ```\n *\n * 4. Prevent `window.open` for all URLs **NOT** containing `example`:\n * ```\n * example.org#%#//scriptlet('prevent-window-open', '0', 'example')\n * ```\n * 5. Prevent all `window.open` calls and return 'trueFunc' instead of it if website checks it:\n * ```\n * example.org#%#//scriptlet('prevent-window-open', , , 'trueFunc')\n * ```\n * 6. Prevent all `window.open` and returns callback\n * which returns object with property 'propName'=noopFunc\n * as a property of window.open if website checks it:\n * ```\n * example.org#%#//scriptlet('prevent-window-open', '1', , '{propName=noopFunc}')\n * ```\n */\n/* eslint-enable max-len */\nexport function preventWindowOpen(source, match = 1, search, replacement) {\n // Default value of 'match' is needed to prevent all `window.open` calls\n // if the scriptlet is used without parameters\n const nativeOpen = window.open;\n\n // unary plus converts 'match' to a number\n // e.g.: +'1' -> 1; +false -> 0\n match = +match > 0;\n\n search = search\n ? toRegExp(search)\n : toRegExp('/.?/');\n\n // eslint-disable-next-line consistent-return\n const openWrapper = (str, ...args) => {\n if (match !== search.test(str)) {\n return nativeOpen.apply(window, [str, ...args]);\n }\n\n hit(source);\n\n let result;\n\n // defaults to return noopFunc instead of window.open\n if (!replacement) {\n result = noopFunc;\n } else if (replacement === 'trueFunc') {\n result = trueFunc;\n } else if (replacement.indexOf('=') > -1) {\n // We should return noopFunc instead of window.open\n // but with some property if website checks it (examples 5, 6)\n // https://github.com/AdguardTeam/Scriptlets/issues/71\n const isProp = startsWith(replacement, '{') && endsWith(replacement, '}');\n if (isProp) {\n const propertyPart = replacement.slice(1, -1);\n const propertyName = substringBefore(propertyPart, '=');\n const propertyValue = substringAfter(propertyPart, '=');\n if (propertyValue === 'noopFunc') {\n result = () => {\n const resObj = { };\n resObj[propertyName] = noopFunc;\n return resObj;\n };\n }\n }\n }\n\n return result;\n };\n\n window.open = openWrapper;\n}\n\npreventWindowOpen.names = [\n 'prevent-window-open',\n 'window.open-defuser.js',\n 'ubo-window.open-defuser.js',\n];\n\npreventWindowOpen.injections = [\n toRegExp,\n startsWith,\n endsWith,\n substringBefore,\n substringAfter,\n hit,\n noopFunc,\n trueFunc,\n];\n","import {\n randomId,\n setPropertyAccess,\n getPropertyInChain,\n toRegExp,\n createOnErrorHandler,\n hit,\n} from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet abort-current-inline-script\n *\n * @description\n * Aborts an inline script when it attempts to **read** the specified property\n * AND when the contents of the `\n * ```\n *\n * 3. Aborts inline scripts which are trying to access `window.alert` and match this regexp: `/Hello.+world/`.\n * ```\n * example.org#%#//scriptlet('abort-current-inline-script', 'alert', '/Hello.+world/')\n * ```\n *\n * For instance, the following scripts will be aborted:\n * ```html\n * \n * ```\n * ```html\n * \n * ```\n *\n * This script will not be aborted:\n * ```html\n * \n * ```\n */\n/* eslint-enable max-len */\nexport function abortCurrentInlineScript(source, property, search = null) {\n const regex = search ? toRegExp(search) : null;\n const rid = randomId();\n\n const getCurrentScript = () => {\n if (!document.currentScript) { // eslint-disable-line compat/compat\n const scripts = document.getElementsByTagName('script');\n return scripts[scripts.length - 1];\n }\n return document.currentScript; // eslint-disable-line compat/compat\n };\n\n const ourScript = getCurrentScript();\n\n const abort = () => {\n const scriptEl = getCurrentScript();\n let content = scriptEl.textContent;\n\n // We are using Node.prototype.textContent property descriptor\n // to get the real script content\n // even when document.currentScript.textContent is replaced.\n // https://github.com/AdguardTeam/Scriptlets/issues/57#issuecomment-593638991\n try {\n const textContentGetter = Object.getOwnPropertyDescriptor(Node.prototype, 'textContent').get;\n content = textContentGetter.call(scriptEl);\n } catch (e) { } // eslint-disable-line no-empty\n\n if (scriptEl instanceof HTMLScriptElement\n && content.length > 0\n && scriptEl !== ourScript\n && (!regex || regex.test(content))) {\n hit(source);\n throw new ReferenceError(rid);\n }\n };\n\n const setChainPropAccess = (owner, property) => {\n const chainInfo = getPropertyInChain(owner, property);\n let { base } = chainInfo;\n const { prop, chain } = chainInfo;\n\n // The scriptlet might be executed before the chain property has been created\n // (for instance, document.body before the HTML body was loaded).\n // In this case we're checking whether the base element exists or not\n // and if not, we simply exit without overriding anything.\n // e.g. https://github.com/AdguardTeam/Scriptlets/issues/57#issuecomment-575841092\n if (base instanceof Object === false && base === null) {\n const props = property.split('.');\n const propIndex = props.indexOf(prop);\n const baseName = props[propIndex - 1];\n console.log(`The scriptlet had been executed before the ${baseName} was loaded.`); // eslint-disable-line no-console\n return;\n }\n\n if (chain) {\n const setter = (a) => {\n base = a;\n if (a instanceof Object) {\n setChainPropAccess(a, chain);\n }\n };\n Object.defineProperty(owner, prop, {\n get: () => base,\n set: setter,\n });\n return;\n }\n\n let currentValue = base[prop];\n setPropertyAccess(base, prop, {\n set: (value) => {\n abort();\n currentValue = value;\n },\n get: () => {\n abort();\n return currentValue;\n },\n });\n };\n\n setChainPropAccess(window, property);\n\n window.onerror = createOnErrorHandler(rid)\n .bind();\n}\n\nabortCurrentInlineScript.names = [\n 'abort-current-inline-script',\n 'abort-current-inline-script.js',\n 'ubo-abort-current-inline-script.js',\n 'acis.js',\n 'ubo-acis.js',\n 'abp-abort-current-inline-script',\n];\n\nabortCurrentInlineScript.injections = [\n randomId,\n setPropertyAccess,\n getPropertyInChain,\n toRegExp,\n createOnErrorHandler,\n hit,\n];\n","import {\n hit,\n noopFunc,\n trueFunc,\n falseFunc,\n getPropertyInChain,\n setPropertyAccess,\n} from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet set-constant\n *\n * @description\n * Creates a constant property and assigns it one of the values from the predefined list.\n *\n * > Actually, it's not a constant. Please note, that it can be rewritten with a value of a different type.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#set-constantjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"set-constant\", , )\n * ```\n *\n * **Parameters**\n * - `property` (required) path to a property (joined with `.` if needed). The property must be attached to `window`.\n * - `value` (required). Possible values:\n * - positive decimal integer `<= 32767`\n * - one of the predefined constants:\n * - `undefined`\n * - `false`\n * - `true`\n * - `null`\n * - `noopFunc` - function with empty body\n * - `trueFunc` - function returning true\n * - `falseFunc` - function returning false\n * - `''` - empty string\n * - `-1` - number value `-1`\n *\n * **Examples**\n * ```\n * ! window.firstConst === false // this comparision will return true\n * example.org#%#//scriptlet(\"set-constant\", \"firstConst\", \"false\")\n *\n * ! window.secondConst() === true // call to the secondConst will return true\n * example.org#%#//scriptlet(\"set-constant\", \"secondConst\", \"trueFunc\")\n * ```\n */\n/* eslint-enable max-len */\nexport function setConstant(source, property, value) {\n if (!property) {\n return;\n }\n\n const nativeIsNaN = Number.isNaN || window.isNaN; // eslint-disable-line compat/compat\n\n let constantValue;\n if (value === 'undefined') {\n constantValue = undefined;\n } else if (value === 'false') {\n constantValue = false;\n } else if (value === 'true') {\n constantValue = true;\n } else if (value === 'null') {\n constantValue = null;\n } else if (value === 'noopFunc') {\n constantValue = noopFunc;\n } else if (value === 'trueFunc') {\n constantValue = trueFunc;\n } else if (value === 'falseFunc') {\n constantValue = falseFunc;\n } else if (/^\\d+$/.test(value)) {\n constantValue = parseFloat(value);\n if (nativeIsNaN(constantValue)) {\n return;\n }\n if (Math.abs(constantValue) > 0x7FFF) {\n return;\n }\n } else if (value === '-1') {\n constantValue = -1;\n } else if (value === '') {\n constantValue = '';\n } else {\n return;\n }\n\n let canceled = false;\n const mustCancel = (value) => {\n if (canceled) {\n return canceled;\n }\n canceled = value !== undefined\n && constantValue !== undefined\n && typeof value !== typeof constantValue;\n return canceled;\n };\n\n const setChainPropAccess = (owner, property) => {\n const chainInfo = getPropertyInChain(owner, property);\n let { base } = chainInfo;\n const { prop, chain } = chainInfo;\n if (chain) {\n const setter = (a) => {\n base = a;\n if (a instanceof Object) {\n setChainPropAccess(a, chain);\n }\n };\n Object.defineProperty(owner, prop, {\n get: () => base,\n set: setter,\n });\n return;\n }\n\n if (mustCancel(base[prop])) { return; }\n\n hit(source);\n setPropertyAccess(base, prop, {\n get: () => constantValue,\n set: (a) => {\n if (mustCancel(a)) {\n constantValue = a;\n }\n },\n });\n };\n\n setChainPropAccess(window, property);\n}\n\nsetConstant.names = [\n 'set-constant',\n 'set-constant.js',\n 'ubo-set-constant.js',\n 'set.js',\n 'ubo-set.js',\n];\nsetConstant.injections = [\n getPropertyInChain,\n setPropertyAccess,\n hit,\n noopFunc,\n trueFunc,\n falseFunc,\n];\n","import { hit, toRegExp } from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet remove-cookie\n *\n * @description\n * Removes current page cookies by passed string matching with name. For current domain and subdomains. Runs on load and before unload.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#cookie-removerjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"remove-cookie\"[, match])\n * ```\n *\n * **Parameters**\n * - `match` (optional) String or regex matching the cookie name. If not specified all accessible cookies will be removed.\n *\n * **Examples**\n * 1. Removes all cookies:\n * ```\n * example.org#%#//scriptlet(\"remove-cookie\")\n * ```\n *\n * 2. Removes cookies which name contains `example` string.\n * ```\n * example.org#%#//scriptlet(\"remove-cookie\", \"example\")\n * ```\n *\n * For instance this cookie will be removed\n * ```javascript\n * document.cookie = '__example=randomValue';\n * ```\n */\n/* eslint-enable max-len */\nexport function removeCookie(source, match) {\n const regex = match ? toRegExp(match) : toRegExp('/.?/');\n\n const removeCookieFromHost = (cookieName, hostName) => {\n const cookieSpec = `${cookieName}=`;\n const domain1 = `; domain=${hostName}`;\n const domain2 = `; domain=.${hostName}`;\n const path = '; path=/';\n const expiration = '; expires=Thu, 01 Jan 1970 00:00:00 GMT';\n document.cookie = cookieSpec + expiration;\n document.cookie = cookieSpec + domain1 + expiration;\n document.cookie = cookieSpec + domain2 + expiration;\n document.cookie = cookieSpec + path + expiration;\n document.cookie = cookieSpec + domain1 + path + expiration;\n document.cookie = cookieSpec + domain2 + path + expiration;\n hit(source);\n };\n\n const rmCookie = () => {\n document.cookie.split(';').forEach((cookieStr) => {\n const pos = cookieStr.indexOf('=');\n if (pos === -1) {\n return;\n }\n\n const cookieName = cookieStr.slice(0, pos).trim();\n if (!regex.test(cookieName)) {\n return;\n }\n\n const hostParts = document.location.hostname.split('.');\n for (let i = 0; i <= hostParts.length - 1; i += 1) {\n const hostName = hostParts.slice(i).join('.');\n if (hostName) {\n removeCookieFromHost(cookieName, hostName);\n }\n }\n });\n };\n rmCookie();\n window.addEventListener('beforeunload', rmCookie);\n}\n\nremoveCookie.names = [\n 'remove-cookie',\n 'cookie-remover.js',\n 'ubo-cookie-remover.js',\n];\n\nremoveCookie.injections = [toRegExp, hit];\n","import { hit, toRegExp } from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet prevent-addEventListener\n *\n * @description\n * Prevents adding event listeners for the specified events and callbacks.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#addeventlistener-defuserjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"prevent-addEventListener\"[, eventSearch[, functionSearch]])\n * ```\n *\n * **Parameters**\n * - `eventSearch` (optional) String or regex matching the event name. If not specified, the scriptlets prevents all event listeners.\n * - `functionSearch` (optional) String or regex matching the event listener function body. If not set, the scriptlet prevents all event listeners with event name matching `eventSearch`.\n *\n * **Examples**\n * 1. Prevent all `click` listeners:\n * ```\n * example.org#%#//scriptlet(\"prevent-addEventListener\", \"click\")\n * ```\n\n2. Prevent 'click' listeners with the callback body containing `searchString`.\n * ```\n * example.org#%#//scriptlet(\"prevent-addEventListener\", \"click\", \"searchString\")\n * ```\n *\n * For instance, this listener will not be called:\n * ```javascript\n * el.addEventListener('click', () => {\n * window.test = 'searchString';\n * });\n * ```\n */\n/* eslint-enable max-len */\nexport function preventAddEventListener(source, eventSearch, funcSearch) {\n eventSearch = eventSearch ? toRegExp(eventSearch) : toRegExp('/.?/');\n funcSearch = funcSearch ? toRegExp(funcSearch) : toRegExp('/.?/');\n\n const nativeAddEventListener = window.EventTarget.prototype.addEventListener;\n function addEventListenerWrapper(eventName, callback, ...args) {\n // The scriptlet might cause a website broke\n // if the website uses test addEventListener with callback = null\n // https://github.com/AdguardTeam/Scriptlets/issues/76\n let funcToCheck = callback;\n if (callback && typeof callback === 'function') {\n funcToCheck = callback.toString();\n }\n\n if (eventSearch.test(eventName.toString()) && funcSearch.test(funcToCheck)) {\n hit(source);\n return undefined;\n }\n return nativeAddEventListener.apply(this, [eventName, callback, ...args]);\n }\n\n window.EventTarget.prototype.addEventListener = addEventListenerWrapper;\n}\n\npreventAddEventListener.names = [\n 'prevent-addEventListener',\n 'addEventListener-defuser.js',\n 'ubo-addEventListener-defuser.js',\n 'aeld.js',\n 'ubo-aeld.js',\n];\n\npreventAddEventListener.injections = [toRegExp, hit];\n","/* eslint-disable consistent-return, no-eval */\nimport { hit } from '../helpers';\n\n/**\n * @scriptlet prevent-bab\n *\n * @description\n * Prevents BlockAdblock script from detecting an ad blocker.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#bab-defuserjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"prevent-bab\")\n * ```\n */\nexport function preventBab(source) {\n const nativeSetTimeout = window.setTimeout;\n const babRegex = /\\.bab_elementid.$/;\n\n window.setTimeout = (callback, ...args) => {\n if (typeof callback !== 'string' || !babRegex.test(callback)) {\n return nativeSetTimeout.call(this, callback, ...args);\n }\n hit(source);\n };\n\n const signatures = [\n ['blockadblock'],\n ['babasbm'],\n [/getItem\\('babn'\\)/],\n ['getElementById', 'String.fromCharCode', 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789', 'charAt', 'DOMContentLoaded', 'AdBlock', 'addEventListener', 'doScroll', 'fromCharCode', '<<2|r>>4', 'sessionStorage', 'clientWidth', 'localStorage', 'Math', 'random'],\n ];\n const check = (str) => {\n for (let i = 0; i < signatures.length; i += 1) {\n const tokens = signatures[i];\n let match = 0;\n for (let j = 0; j < tokens.length; j += 1) {\n const token = tokens[j];\n const found = token instanceof RegExp ? token.test(str) : str.indexOf(token) > -1;\n if (found) {\n match += 1;\n }\n }\n if (match / tokens.length >= 0.8) {\n return true;\n }\n }\n return false;\n };\n\n const nativeEval = window.eval;\n window.eval = (str) => {\n if (!check(str)) {\n return nativeEval(str);\n }\n hit(source);\n const bodyEl = document.body;\n if (bodyEl) {\n bodyEl.style.removeProperty('visibility');\n }\n const el = document.getElementById('babasbmsgx');\n if (el) {\n el.parentNode.removeChild(el);\n }\n };\n}\n\npreventBab.names = [\n 'prevent-bab',\n 'nobab.js',\n 'ubo-nobab.js',\n 'bab-defuser.js',\n 'ubo-bab-defuser.js',\n];\n\npreventBab.injections = [hit];\n","/* eslint-disable no-unused-vars, no-extra-bind, func-names */\nimport { hit, noopFunc } from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet nowebrtc\n *\n * @description\n * Disables WebRTC by overriding `RTCPeerConnection`. The overriden function will log every attempt to create a new connection.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#nowebrtcjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"nowebrtc\")\n * ```\n */\n/* eslint-enable max-len */\nexport function nowebrtc(source) {\n let propertyName = '';\n if (window.RTCPeerConnection) {\n propertyName = 'RTCPeerConnection';\n } else if (window.webkitRTCPeerConnection) {\n propertyName = 'webkitRTCPeerConnection';\n }\n\n if (propertyName === '') {\n return;\n }\n\n const rtcReplacement = (config) => {\n hit(source, `Document tried to create an RTCPeerConnection: ${config}`);\n };\n rtcReplacement.prototype = {\n close: noopFunc,\n createDataChannel: noopFunc,\n createOffer: noopFunc,\n setRemoteDescription: noopFunc,\n };\n const rtc = window[propertyName];\n window[propertyName] = rtcReplacement;\n if (rtc.prototype) {\n rtc.prototype.createDataChannel = function (a, b) {\n return {\n close: noopFunc,\n send: noopFunc,\n };\n }.bind(null);\n }\n}\n\nnowebrtc.names = [\n 'nowebrtc',\n 'nowebrtc.js',\n 'ubo-nowebrtc.js',\n];\n\nnowebrtc.injections = [hit, noopFunc];\n","/* eslint-disable no-console */\nimport { hit } from '../helpers';\n\n/**\n * @scriptlet log-addEventListener\n *\n * @description\n * Logs all addEventListener calls to the console.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#addeventlistener-loggerjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"log-addEventListener\")\n * ```\n */\nexport function logAddEventListener(source) {\n const log = console.log.bind(console);\n const nativeAddEventListener = window.EventTarget.prototype.addEventListener;\n function addEventListenerWrapper(eventName, callback, ...args) {\n hit(source);\n // The scriptlet might cause a website broke\n // if the website uses test addEventListener with callback = null\n // https://github.com/AdguardTeam/Scriptlets/issues/76\n let callbackToLog = callback;\n if (callback && typeof callback === 'function') {\n callbackToLog = callback.toString();\n }\n log(`addEventListener(\"${eventName}\", ${callbackToLog})`);\n return nativeAddEventListener.apply(this, [eventName, callback, ...args]);\n }\n window.EventTarget.prototype.addEventListener = addEventListenerWrapper;\n}\n\nlogAddEventListener.names = [\n 'log-addEventListener',\n 'addEventListener-logger.js',\n 'ubo-addEventListener-logger.js',\n 'aell.js',\n 'ubo-aell.js',\n];\n\nlogAddEventListener.injections = [hit];\n","/* eslint-disable no-console, no-eval */\nimport { hit } from '../helpers';\n\n/**\n * @scriptlet log-eval\n *\n * @description\n * Logs all `eval()` or `new Function()` calls to the console.\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"log-eval\")\n * ```\n */\nexport function logEval(source) {\n const log = console.log.bind(console);\n // wrap eval function\n const nativeEval = window.eval;\n function evalWrapper(str) {\n hit(source);\n log(`eval(\"${str}\")`);\n return nativeEval(str);\n }\n window.eval = evalWrapper;\n\n // wrap new Function\n const nativeFunction = window.Function;\n\n function FunctionWrapper(...args) {\n hit(source);\n log(`new Function(${args.join(', ')})`);\n return nativeFunction.apply(this, [...args]);\n }\n\n FunctionWrapper.prototype = Object.create(nativeFunction.prototype);\n FunctionWrapper.prototype.constructor = FunctionWrapper;\n\n window.Function = FunctionWrapper;\n}\n\nlogEval.names = [\n 'log-eval',\n];\n\nlogEval.injections = [hit];\n","/**\n * @scriptlet log\n *\n * @description\n * A simple scriptlet which only purpose is to print arguments to console.\n * This scriptlet can be helpful for debugging and troubleshooting other scriptlets.\n * **Example**\n * ```\n * example.org#%#//scriptlet(\"log\", \"arg1\", \"arg2\")\n * ```\n */\nexport function log(...args) {\n console.log(args); // eslint-disable-line no-console\n}\nlog.names = ['log'];\n","/* eslint-disable no-eval, no-extra-bind */\nimport { hit } from '../helpers';\n\n/**\n * @scriptlet noeval\n *\n * @description\n * Prevents page to use eval.\n * Notifies about attempts in the console\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#noevaljs-\n *\n * It also can be used as `$redirect` rules sometimes.\n * See [redirect description](../wiki/about-redirects.md#noeval).\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet('noeval')\n * ```\n */\nexport function noeval(source) {\n window.eval = function evalWrapper(s) {\n hit(source, `AdGuard has prevented eval:\\n${s}`);\n }.bind();\n}\n\nnoeval.names = [\n 'noeval',\n 'noeval.js',\n 'silent-noeval.js',\n 'ubo-noeval.js',\n 'ubo-silent-noeval.js',\n];\n\nnoeval.injections = [hit];\n","/* eslint-disable no-eval, no-extra-bind, func-names */\n\nimport { toRegExp, hit } from '../helpers';\n\n/**\n * @scriptlet prevent-eval-if\n *\n * @description\n * Prevents page to use eval matching payload.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#noeval-ifjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet('prevent-eval-if'[, ])\n * ```\n *\n * **Parameters**\n * - `search` - optional string or regexp for matching stringified eval payload.\n * If 'search is not specified — all stringified eval payload will be matched.\n *\n * **Examples**\n * ```\n * ! Prevents eval if it matches 'test'\n * example.org#%#//scriptlet('prevent-eval-if', 'test')\n * ```\n *\n * @param {string|RegExp} [search] string or regexp matching stringified eval payload\n */\nexport function preventEvalIf(source, search) {\n search = search ? toRegExp(search) : toRegExp('/.?/');\n\n const nativeEval = window.eval;\n window.eval = function (payload) {\n if (!search.test(payload.toString())) {\n return nativeEval.call(window, payload);\n }\n hit(source, payload);\n return undefined;\n }.bind(window);\n}\n\npreventEvalIf.names = [\n 'prevent-eval-if',\n 'noeval-if.js',\n 'ubo-noeval-if.js',\n];\n\npreventEvalIf.injections = [toRegExp, hit];\n","/* eslint-disable no-console, func-names, no-multi-assign */\nimport { hit, noopFunc, noopThis } from '../helpers';\n\n/**\n * @scriptlet prevent-fab-3.2.0\n *\n * @description\n * Prevents execution of the FAB script v3.2.0.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#fuckadblockjs-320-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"prevent-fab-3.2.0\")\n * ```\n */\nexport function preventFab(source) {\n hit(source);\n const Fab = function () {};\n Fab.prototype.check = noopFunc;\n Fab.prototype.clearEvent = noopFunc;\n Fab.prototype.emitEvent = noopFunc;\n Fab.prototype.on = function (a, b) {\n if (!a) {\n b();\n }\n return this;\n };\n Fab.prototype.onDetected = noopThis;\n Fab.prototype.onNotDetected = function (a) {\n a();\n return this;\n };\n Fab.prototype.setOption = noopFunc;\n window.FuckAdBlock = window.BlockAdBlock = Fab;\n //\n window.fuckAdBlock = window.blockAdBlock = new Fab();\n}\n\npreventFab.names = [\n 'prevent-fab-3.2.0',\n 'nofab.js',\n 'ubo-nofab.js',\n 'fuckadblock.js-3.2.0',\n 'ubo-fuckadblock.js-3.2.0',\n];\n\npreventFab.injections = [hit, noopFunc, noopThis];\n","/* eslint-disable no-console, func-names, no-multi-assign */\nimport { hit } from '../helpers';\n\n/**\n * @scriptlet set-popads-dummy\n *\n * @description\n * Sets static properties PopAds and popns.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#popads-dummyjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"set-popads-dummy\")\n * ```\n */\nexport function setPopadsDummy(source) {\n delete window.PopAds;\n delete window.popns;\n Object.defineProperties(window, {\n PopAds: {\n get: () => {\n hit(source);\n return {};\n },\n },\n popns: {\n get: () => {\n hit(source);\n return {};\n },\n },\n });\n}\n\nsetPopadsDummy.names = [\n 'set-popads-dummy',\n 'popads-dummy.js',\n 'ubo-popads-dummy.js',\n];\n\nsetPopadsDummy.injections = [hit];\n","import {\n hit, createOnErrorHandler, randomId,\n} from '../helpers';\n\n/**\n * @scriptlet prevent-popads-net\n *\n * @description\n * Aborts on property write (PopAds, popns), throws reference error with random id.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#popadsnetjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"prevent-popads-net\")\n * ```\n */\nexport function preventPopadsNet(source) {\n const rid = randomId();\n\n const throwError = () => {\n throw new ReferenceError(rid);\n };\n\n delete window.PopAds;\n delete window.popns;\n Object.defineProperties(window, {\n PopAds: { set: throwError },\n popns: { set: throwError },\n });\n\n window.onerror = createOnErrorHandler(rid).bind();\n hit(source);\n}\n\npreventPopadsNet.names = [\n 'prevent-popads-net',\n 'popads.net.js',\n 'ubo-popads.net.js',\n];\n\npreventPopadsNet.injections = [createOnErrorHandler, randomId, hit];\n","/* eslint-disable func-names */\nimport { hit, setPropertyAccess } from '../helpers';\n\n/**\n * @scriptlet prevent-adfly\n *\n * @description\n * Prevents anti-adblock scripts on adfly short links.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#adfly-defuserjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"prevent-adfly\")\n * ```\n */\nexport function preventAdfly(source) {\n const isDigit = (data) => /^\\d$/.test(data);\n const handler = function (encodedURL) {\n let evenChars = '';\n let oddChars = '';\n for (let i = 0; i < encodedURL.length; i += 1) {\n if (i % 2 === 0) {\n evenChars += encodedURL.charAt(i);\n } else {\n oddChars = encodedURL.charAt(i) + oddChars;\n }\n }\n\n let data = (evenChars + oddChars).split('');\n\n for (let i = 0; i < data.length; i += 1) {\n if (isDigit(data[i])) {\n for (let ii = i + 1; ii < data.length; ii += 1) {\n if (isDigit(data[ii])) {\n // eslint-disable-next-line no-bitwise\n const temp = parseInt(data[i], 10) ^ parseInt(data[ii], 10);\n if (temp < 10) {\n data[i] = temp.toString();\n }\n i = ii;\n break;\n }\n }\n }\n }\n data = data.join('');\n const decodedURL = window.atob(data).slice(16, -16);\n /* eslint-disable compat/compat */\n if (window.stop) {\n window.stop();\n }\n /* eslint-enable compat/compat */\n window.onbeforeunload = null;\n window.location.href = decodedURL;\n };\n\n let val;\n // Do not apply handler more than one time\n let applyHandler = true;\n\n const result = setPropertyAccess(window, 'ysmm', {\n configurable: false,\n set: (value) => {\n if (applyHandler) {\n applyHandler = false;\n try {\n if (typeof value === 'string') {\n handler(value);\n }\n } catch (err) { } // eslint-disable-line no-empty\n }\n val = value;\n },\n get: () => val,\n });\n\n if (result) {\n hit(source);\n } else {\n window.console.error('Failed to set up prevent-adfly scriptlet');\n }\n}\n\npreventAdfly.names = [\n 'prevent-adfly',\n 'adfly-defuser.js',\n 'ubo-adfly-defuser.js',\n];\n\npreventAdfly.injections = [setPropertyAccess, hit];\n","import {\n randomId,\n setPropertyAccess,\n getPropertyInChain,\n createOnErrorHandler,\n hit,\n noopFunc,\n} from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet debug-on-property-read\n *\n * @description\n * This scriptlet is basically the same as [abort-on-property-read](#abort-on-property-read), but instead of aborting it starts the debugger.\n *\n * **It is not supposed to be used in production filter lists!**\n *\n * **Syntax**\n * ```\n * ! Aborts script when it tries to access `window.alert`\n * example.org#%#//scriptlet(\"debug-on-property-read\", \"alert\")\n * ```\n */\n/* eslint-enable max-len */\nexport function debugOnPropertyRead(source, property) {\n if (!property) {\n return;\n }\n const rid = randomId();\n const abort = () => {\n hit(source);\n // eslint-disable-next-line no-debugger\n debugger;\n };\n const setChainPropAccess = (owner, property) => {\n const chainInfo = getPropertyInChain(owner, property);\n let { base } = chainInfo;\n const { prop, chain } = chainInfo;\n if (chain) {\n const setter = (a) => {\n base = a;\n if (a instanceof Object) {\n setChainPropAccess(a, chain);\n }\n };\n Object.defineProperty(owner, prop, {\n get: () => base,\n set: setter,\n });\n return;\n }\n\n setPropertyAccess(base, prop, {\n get: abort,\n set: noopFunc,\n });\n };\n\n setChainPropAccess(window, property);\n\n window.onerror = createOnErrorHandler(rid)\n .bind();\n}\n\ndebugOnPropertyRead.names = [\n 'debug-on-property-read',\n];\ndebugOnPropertyRead.injections = [\n randomId,\n setPropertyAccess,\n getPropertyInChain,\n createOnErrorHandler,\n hit,\n noopFunc,\n];\n","import {\n randomId,\n setPropertyAccess,\n getPropertyInChain,\n createOnErrorHandler,\n hit,\n} from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet debug-on-property-write\n *\n * @description\n * This scriptlet is basically the same as [abort-on-property-write](#abort-on-property-write), but instead of aborting it starts the debugger.\n *\n * **It is not supposed to be used in production filter lists!**\n *\n * **Syntax**\n * ```\n * ! Aborts script when it tries to write in property `window.test`\n * example.org#%#//scriptlet(\"debug-on-property-write\", \"test\")\n * ```\n */\n/* eslint-enable max-len */\nexport function debugOnPropertyWrite(source, property) {\n if (!property) {\n return;\n }\n const rid = randomId();\n const abort = () => {\n hit(source);\n // eslint-disable-next-line no-debugger\n debugger;\n };\n const setChainPropAccess = (owner, property) => {\n const chainInfo = getPropertyInChain(owner, property);\n let { base } = chainInfo;\n const { prop, chain } = chainInfo;\n if (chain) {\n const setter = (a) => {\n base = a;\n if (a instanceof Object) {\n setChainPropAccess(a, chain);\n }\n };\n Object.defineProperty(owner, prop, {\n get: () => base,\n set: setter,\n });\n return;\n }\n\n setPropertyAccess(base, prop, { set: abort });\n };\n\n setChainPropAccess(window, property);\n\n window.onerror = createOnErrorHandler(rid).bind();\n}\n\ndebugOnPropertyWrite.names = [\n 'debug-on-property-write',\n];\n\ndebugOnPropertyWrite.injections = [\n randomId,\n setPropertyAccess,\n getPropertyInChain,\n createOnErrorHandler,\n hit,\n];\n","import {\n randomId,\n setPropertyAccess,\n getPropertyInChain,\n toRegExp,\n createOnErrorHandler,\n hit,\n} from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet debug-current-inline-script\n *\n * @description\n * This scriptlet is basically the same as [abort-current-inline-script](#abort-current-inline-script), but instead of aborting it starts the debugger.\n *\n * **It is not supposed to be used in production filter lists!**\n *\n * **Syntax**\n *```\n * ! Aborts script when it tries to access `window.alert`\n * example.org#%#//scriptlet(\"debug-current-inline-script\", \"alert\")\n * ```\n */\n/* eslint-enable max-len */\nexport function debugCurrentInlineScript(source, property, search = null) {\n const regex = search ? toRegExp(search) : null;\n const rid = randomId();\n\n const getCurrentScript = () => {\n if (!document.currentScript) { // eslint-disable-line compat/compat\n const scripts = document.getElementsByTagName('script');\n return scripts[scripts.length - 1];\n }\n return document.currentScript; // eslint-disable-line compat/compat\n };\n\n const ourScript = getCurrentScript();\n\n const abort = () => {\n const scriptEl = getCurrentScript();\n if (scriptEl instanceof HTMLScriptElement\n && scriptEl.textContent.length > 0\n && scriptEl !== ourScript\n && (!regex || regex.test(scriptEl.textContent))) {\n hit(source);\n // eslint-disable-next-line no-debugger\n debugger;\n }\n };\n\n const setChainPropAccess = (owner, property) => {\n const chainInfo = getPropertyInChain(owner, property);\n let { base } = chainInfo;\n const { prop, chain } = chainInfo;\n if (chain) {\n const setter = (a) => {\n base = a;\n if (a instanceof Object) {\n setChainPropAccess(a, chain);\n }\n };\n Object.defineProperty(owner, prop, {\n get: () => base,\n set: setter,\n });\n return;\n }\n\n let currentValue = base[prop];\n setPropertyAccess(base, prop, {\n set: (value) => {\n abort();\n currentValue = value;\n },\n get: () => {\n abort();\n return currentValue;\n },\n });\n };\n\n setChainPropAccess(window, property);\n\n window.onerror = createOnErrorHandler(rid)\n .bind();\n}\n\ndebugCurrentInlineScript.names = [\n 'debug-current-inline-script',\n];\n\ndebugCurrentInlineScript.injections = [\n randomId,\n setPropertyAccess,\n getPropertyInChain,\n toRegExp,\n createOnErrorHandler,\n hit,\n];\n","import { hit, observeDOMChanges } from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet remove-attr\n *\n * @description\n * Removes the specified attributes from DOM nodes. This scriptlet runs once when the page loads\n * and after that periodically in order to DOM tree changes.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#remove-attrjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet('remove-attr', attrs[, selector])\n * ```\n *\n * - `attrs` — required, attribute or list of attributes joined by '|';\n * - `selector` — optional, CSS selector, specifies DOM nodes from which the attributes will be removed\n *\n * **Examples**\n * 1. Removes by attribute\n * ```\n * example.org#%#//scriptlet('remove-attr', 'example|test')\n * ```\n *\n * ```html\n * \n *
Some text
\n *\n * \n *
Some text
\n * ```\n *\n * 2. Removes with specified selector\n * ```\n * example.org#%#//scriptlet('remove-attr', 'example', 'div[class=\"inner\"]')\n * ```\n *\n * ```html\n * \n *
\n *
Some text
\n *
\n *\n * \n *
\n *
Some text
\n *
\n * ```\n */\n/* eslint-enable max-len */\nexport function removeAttr(source, attrs, selector) {\n if (!attrs) { return; }\n attrs = attrs.split(/\\s*\\|\\s*/);\n if (!selector) {\n selector = `[${attrs.join('],[')}]`;\n }\n\n const rmattr = () => {\n const nodes = [].slice.call(document.querySelectorAll(selector));\n let removed = false;\n nodes.forEach((node) => {\n attrs.forEach((attr) => {\n node.removeAttribute(attr);\n removed = true;\n });\n });\n if (removed) {\n hit(source);\n }\n };\n\n rmattr();\n\n // 'true' for observing attributes\n observeDOMChanges(rmattr, true);\n}\n\nremoveAttr.names = [\n 'remove-attr',\n 'remove-attr.js',\n 'ubo-remove-attr.js',\n 'ra.js',\n 'ubo-ra.js',\n];\n\nremoveAttr.injections = [hit, observeDOMChanges];\n","import { hit, observeDOMChanges } from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet remove-class\n *\n * @description\n * Removes the specified classes from DOM nodes. This scriptlet runs once after the page loads\n * and after that periodically in order to DOM tree changes.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#remove-classjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet('remove-class', classes[, selector])\n * ```\n *\n * - `classes` — required, class or list of classes separated by '|';\n * - `selector` — optional, CSS selector, specifies DOM nodes from which the classes will be removed;\n * if there is no selector, every class independently will be removed from all nodes which has one\n *\n * **Examples**\n * 1. Removes by classes\n * ```\n * example.org#%#//scriptlet('remove-class', 'example|test')\n * ```\n *\n * ```html\n * \n *
Some text
\n *
Some text
\n *
Some text
\n *\n * \n *
Some text
\n *
Some text
\n *
Some text
\n * ```\n *\n * 2. Removes with specified selector\n * ```\n * example.org#%#//scriptlet('remove-class', 'branding', 'div[class^=\"inner\"]')\n * ```\n *\n * ```html\n * \n *
\n *
Some text
\n *
\n *\n * \n *
\n *
Some text
\n *
\n * ```\n */\n/* eslint-enable max-len */\n\n\nexport function removeClass(source, classNames, selector) {\n if (!classNames) { return; }\n classNames = classNames.split(/\\s*\\|\\s*/);\n let selectors = [];\n if (!selector) {\n selectors = classNames.map((className) => {\n return `.${className}`;\n });\n }\n\n const removeClassHandler = () => {\n const nodes = new Set();\n if (selector) {\n const foundedNodes = [].slice.call(document.querySelectorAll(selector));\n foundedNodes.forEach((n) => nodes.add(n));\n } else if (selectors.length > 0) {\n selectors.forEach((s) => {\n const elements = document.querySelectorAll(s);\n for (let i = 0; i < elements.length; i += 1) {\n const element = elements[i];\n nodes.add(element);\n }\n });\n }\n\n let removed = false;\n\n nodes.forEach((node) => {\n classNames.forEach((className) => {\n if (node.classList.contains(className)) {\n node.classList.remove(className);\n removed = true;\n }\n });\n });\n\n if (removed) {\n hit(source);\n }\n };\n\n removeClassHandler();\n\n const CLASS_ATTR_NAME = ['class'];\n // 'true' for observing attributes\n // 'class' for observing only classes\n observeDOMChanges(removeClassHandler, true, CLASS_ATTR_NAME);\n}\n\nremoveClass.names = [\n 'remove-class',\n 'remove-class.js',\n 'ubo-remove-class.js',\n 'rc.js',\n 'ubo-rc.js',\n];\n\nremoveClass.injections = [hit, observeDOMChanges];\n","import { hit } from '../helpers';\n\n/**\n * @scriptlet disable-newtab-links\n *\n * @description\n * Prevents opening new tabs and windows if there is `target` attribute in element.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#disable-newtab-linksjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"disable-newtab-links\")\n * ```\n */\nexport function disableNewtabLinks(source) {\n document.addEventListener('click', (ev) => {\n let { target } = ev;\n while (target !== null) {\n if (target.localName === 'a' && target.hasAttribute('target')) {\n ev.stopPropagation();\n ev.preventDefault();\n hit(source);\n break;\n }\n target = target.parentNode;\n }\n });\n}\n\ndisableNewtabLinks.names = [\n 'disable-newtab-links',\n 'disable-newtab-links.js',\n 'ubo-disable-newtab-links.js',\n];\n\ndisableNewtabLinks.injections = [\n hit,\n];\n","import { hit, toRegExp } from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet adjust-setInterval\n *\n * @description\n * Adjusts interval for specified setInterval() callbacks.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#nano-setinterval-boosterjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"adjust-setInterval\"[, match [, interval[, boost]]])\n * ```\n *\n * - `match` - optional, string/regular expression, matching in stringified callback function\n * - `interval` - optional, defaults to 1000, decimal integer, matching interval\n * - `boost` - optional, default to 0.05, float, capped at 50 times for up and down, interval multiplier\n *\n * **Examples**\n * 1. Adjust all setInterval() x20 times where interval equal 1000ms:\n * ```\n * example.org#%#//scriptlet(\"adjust-setInterval\")\n * ```\n *\n * 2. Adjust all setInterval() x20 times where callback mathed with `example` and interval equal 1000ms\n * ```\n * example.org#%#//scriptlet(\"adjust-setInterval\", \"example\")\n * ```\n *\n * 3. Adjust all setInterval() x20 times where callback mathed with `example` and interval equal 400ms\n * ```\n * example.org#%#//scriptlet(\"adjust-setInterval\", \"example\", \"400\")\n * ```\n *\n * 4. Slow down setInterval() x2 times where callback matched with `example` and interval equal 400ms\n * ```\n * example.org#%#//scriptlet(\"adjust-setInterval\", \"example\", \"400\", \"2\")\n * ```\n */\n/* eslint-enable max-len */\nexport function adjustSetInterval(source, match, interval, boost) {\n const nativeInterval = window.setInterval;\n const nativeIsNaN = Number.isNaN || window.isNaN; // eslint-disable-line compat/compat\n const nativeIsFinite = Number.isFinite || window.isFinite; // eslint-disable-line compat/compat\n\n interval = parseInt(interval, 10);\n interval = nativeIsNaN(interval) ? 1000 : interval;\n\n boost = parseInt(boost, 10);\n boost = nativeIsNaN(interval) || !nativeIsFinite(boost) ? 0.05 : boost;\n\n match = match ? toRegExp(match) : toRegExp('/.?/');\n\n if (boost < 0.02) {\n boost = 0.02;\n }\n if (boost > 50) {\n boost = 50;\n }\n\n const intervalWrapper = (cb, d, ...args) => {\n if (d === interval && match.test(cb.toString())) {\n d *= boost;\n hit(source);\n }\n return nativeInterval.apply(window, [cb, d, ...args]);\n };\n window.setInterval = intervalWrapper;\n}\n\nadjustSetInterval.names = [\n 'adjust-setInterval',\n 'nano-setInterval-booster.js',\n 'ubo-nano-setInterval-booster.js',\n 'nano-sib.js',\n 'ubo-nano-sib.js',\n];\n\nadjustSetInterval.injections = [toRegExp, hit];\n","import { hit, toRegExp } from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet adjust-setTimeout\n *\n * @description\n * Adjusts timeout for specified setTimout() callbacks.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#nano-settimeout-boosterjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"adjust-setTimeout\"[, match [, timeout[, boost]]])\n * ```\n *\n * - `match` - optional, string/regular expression, matching in stringified callback function\n * - `timeout` - optional, defaults to 1000, decimal integer, matching interval\n * - `boost` - optional, default to 0.05, float, capped at 50 times for up and down, interval multiplier\n *\n * **Examples**\n * 1. Adjust all setTimeout() x20 times where interval equal 1000ms:\n * ```\n * example.org#%#//scriptlet(\"adjust-setTimeout\")\n * ```\n *\n * 2. Adjust all setTimeout() x20 times where callback mathed with `example` and interval equal 1000ms\n * ```\n * example.org#%#//scriptlet(\"adjust-setTimeout\", \"example\")\n * ```\n *\n * 3. Adjust all setTimeout() x20 times where callback mathed with `example` and interval equal 400ms\n * ```\n * example.org#%#//scriptlet(\"adjust-setTimeout\", \"example\", \"400\")\n * ```\n *\n * 4. Slow down setTimeout() x2 times where callback matched with `example` and interval equal 400ms\n * ```\n * example.org#%#//scriptlet(\"adjust-setTimeout\", \"example\", \"400\", \"2\")\n * ```\n */\n/* eslint-enable max-len */\nexport function adjustSetTimeout(source, match, timeout, boost) {\n const nativeTimeout = window.setTimeout;\n const nativeIsNaN = Number.isNaN || window.isNaN; // eslint-disable-line compat/compat\n const nativeIsFinite = Number.isFinite || window.isFinite; // eslint-disable-line compat/compat\n\n timeout = parseInt(timeout, 10);\n timeout = nativeIsNaN(timeout) ? 1000 : timeout;\n\n boost = parseInt(boost, 10);\n boost = nativeIsNaN(timeout) || !nativeIsFinite(boost) ? 0.05 : boost;\n\n match = match ? toRegExp(match) : toRegExp('/.?/');\n\n if (boost < 0.02) {\n boost = 0.02;\n }\n if (boost > 50) {\n boost = 50;\n }\n\n const timeoutWrapper = (cb, d, ...args) => {\n if (d === timeout && match.test(cb.toString())) {\n d *= boost;\n hit(source);\n }\n return nativeTimeout.apply(window, [cb, d, ...args]);\n };\n window.setTimeout = timeoutWrapper;\n}\n\nadjustSetTimeout.names = [\n 'adjust-setTimeout',\n 'nano-setTimeout-booster.js',\n 'ubo-nano-setTimeout-booster.js',\n 'nano-stb.js',\n 'ubo-nano-stb.js',\n];\n\nadjustSetTimeout.injections = [toRegExp, hit];\n","import { hit } from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet dir-string\n *\n * @description\n * Wraps the `console.dir` API to call the `toString` method of the argument.\n * There are several adblock circumvention systems that detect browser devtools\n * and hide themselves. Therefore, if we force them to think\n * that devtools are open (using this scrciptlet),\n * it will automatically disable the adblock circumvention script.\n *\n * Related ABP source:\n * https://github.com/adblockplus/adblockpluscore/blob/6b2a309054cc23432102b85d13f12559639ef495/lib/content/snippets.js#L766\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"dir-string\"[, times])\n * ```\n * - `times` - optional, the number of times to call the `toString` method of the argument to `console.dir`\n *\n * **Example**\n * ```\n * ! Run 2 times\n * example.org#%#//scriptlet(\"dir-string\", \"2\")\n * ```\n */\n/* eslint-enable max-len */\nexport function dirString(source, times) {\n const { dir } = console;\n times = parseInt(times, 10);\n\n function dirWrapper(object) {\n // eslint-disable-next-line no-unused-vars\n let temp;\n for (let i = 0; i < times; i += 1) {\n // eslint-disable-next-line no-unused-expressions\n temp = `${object}`;\n }\n if (typeof dir === 'function') {\n dir.call(this, object);\n }\n hit(source, temp);\n }\n // eslint-disable-next-line no-console\n console.dir = dirWrapper;\n}\n\ndirString.names = [\n 'dir-string',\n 'abp-dir-string',\n];\n\ndirString.injections = [hit];\n","import { hit, getPropertyInChain } from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet json-prune\n *\n * @description\n * Removes specified properties from the result of calling JSON.parse and returns the caller\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet(\"json-prune\"[, propsToRemove [, obligatoryProps]])\n * ```\n *\n * - `propsToRemove` - string of space-separated properties to remove\n * - `obligatoryProps` - optional, string of space-separated properties which must be all present for the pruning to occur\n *\n * **Examples**\n * 1. Removes property `example` from the results of JSON.parse call\n * ```\n * example.org#%#//scriptlet(\"json-prune\", \"example\")\n * ```\n *\n * For instance, the following call will return `{ one: 1}`\n *\n * ```html\n * JSON.parse('{\"one\":1,\"example\":true}')\n * ```\n *\n * 2. If there are no specified properties in the result of JSON.parse call, pruning will NOT occur\n * ```\n * example.org#%#//scriptlet(\"json-prune\", \"one\", \"obligatoryProp\")\n * ```\n *\n * For instance, the following call will return `{ one: 1, two: 2}`\n *\n * ```html\n * JSON.parse('{\"one\":1,\"two\":2}')\n * ```\n *\n * 3. A property in a list of properties can be a chain of properties\n *\n * ```\n * example.org#%#//scriptlet(\"json-prune\", \"a.b\", \"adpath.url.first\")\n * ```\n *\n * 4. Call with no arguments will log the current hostname and json payload at the console\n * ```\n * example.org#%#//scriptlet(\"json-prune\")\n * ```\n */\n/* eslint-enable max-len */\nexport function jsonPrune(source, propsToRemove, requiredInitialProps) {\n // eslint-disable-next-line no-console\n const log = console.log.bind(console);\n const prunePaths = propsToRemove !== undefined && propsToRemove !== ''\n ? propsToRemove.split(/ +/)\n : [];\n const needlePaths = requiredInitialProps !== undefined && requiredInitialProps !== ''\n ? requiredInitialProps.split(/ +/)\n : [];\n\n function isPruningNeeded(root) {\n if (!root) {\n return false;\n }\n\n for (let i = 0; i < needlePaths.length; i += 1) {\n const needlePath = needlePaths[i];\n const details = getPropertyInChain(root, needlePath, false);\n const nestedPropName = needlePath.split('.').pop();\n if (details && details.base[nestedPropName] === undefined) {\n return false;\n }\n }\n return true;\n }\n\n const nativeParse = JSON.parse;\n\n const parseWrapper = (...args) => {\n const r = nativeParse.apply(window, args);\n if (prunePaths.length === 0) {\n log(window.location.hostname, r);\n return r;\n }\n if (isPruningNeeded(r) === false) {\n return r;\n }\n prunePaths.forEach((path) => {\n const ownerObj = getPropertyInChain(r, path, false);\n if (ownerObj !== undefined && ownerObj.base) {\n delete ownerObj.base[ownerObj.prop];\n }\n });\n hit(source);\n return r;\n };\n\n JSON.parse = parseWrapper;\n}\n\n\njsonPrune.names = [\n 'json-prune',\n 'json-prune.js',\n 'ubo-json-prune.js',\n];\n\njsonPrune.injections = [hit, getPropertyInChain];\n","import {\n hit, startsWith, toRegExp, noopFunc,\n} from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @scriptlet prevent-requestAnimationFrame\n *\n * @description\n * Prevents a `requestAnimationFrame` call\n * if the text of the callback is matching the specified search string which does not start with `!`;\n * otherwise mismatched calls should be defused.\n *\n * Related UBO scriptlet:\n * https://github.com/gorhill/uBlock/wiki/Resources-Library#requestanimationframe-ifjs-\n *\n * **Syntax**\n * ```\n * example.org#%#//scriptlet('prevent-requestAnimationFrame'[, ])\n * ```\n *\n * **Parameters**\n *\n * - `search` (optional) string or regular expression.\n * If starts with `!`, scriptlet will not match the stringified callback but all other will be defused.\n * If do not start with `!`, the stringified callback will be matched.\n *\n * Call with no argument will log all requestAnimationFrame calls while debugging.\n * So do not use the scriptlet without any parameter in production filter lists.\n *\n * **Examples**\n *\n * 1. Prevents `requestAnimationFrame` calls if the callback matches `/\\.test/`.\n * ```bash\n * example.org#%#//scriptlet('prevent-requestAnimationFrame', '/\\.test/')\n * ```\n *\n * For instance, the following call will be prevented:\n * ```javascript\n * var times = 0;\n * requestAnimationFrame(function change() {\n * window.test = 'new value';\n * if (times < 2) {\n * times += 1;\n * requestAnimationFrame(change);\n * }\n * });\n * ```\n * 2. Prevents `requestAnimationFrame` calls if **does not match** 'check'.\n * ```bash\n * example.org#%#//scriptlet('prevent-requestAnimationFrame', '!check')\n * ```\n *\n * For instance, only the first call will be prevented:\n *\n * ```javascript\n * var timesFirst = 0;\n * requestAnimationFrame(function changeFirst() {\n * window.check = 'should not be prevented';\n * if (timesFirst < 2) {\n * timesFirst += 1;\n * requestAnimationFrame(changeFirst);\n * }\n * });\n *\n * var timesSecond = 0;\n * requestAnimationFrame(function changeSecond() {\n * window.second = 'should be prevented';\n * if (timesSecond < 2) {\n * timesSecond += 1;\n * requestAnimationFrame(changeSecond);\n * }\n * });\n * ```\n */\n/* eslint-enable max-len */\n\nexport function preventRequestAnimationFrame(source, match) {\n const nativeRequestAnimationFrame = window.requestAnimationFrame;\n\n // logs requestAnimationFrame to console if no arguments have been specified\n const shouldLog = typeof match === 'undefined';\n\n const INVERT_MARKER = '!';\n\n const doNotMatch = startsWith(match, INVERT_MARKER);\n if (doNotMatch) {\n match = match.slice(1);\n }\n\n match = match ? toRegExp(match) : toRegExp('/.?/');\n\n const rafWrapper = (callback, ...args) => {\n let shouldPrevent = false;\n if (shouldLog) {\n const logMessage = `log: requestAnimationFrame(\"${callback.toString()}\")`;\n hit(source, logMessage);\n } else {\n shouldPrevent = match.test(callback.toString()) !== doNotMatch;\n }\n\n if (shouldPrevent) {\n hit(source);\n return nativeRequestAnimationFrame(noopFunc);\n }\n\n return nativeRequestAnimationFrame.apply(window, [callback, ...args]);\n };\n\n window.requestAnimationFrame = rafWrapper;\n}\n\npreventRequestAnimationFrame.names = [\n 'prevent-requestAnimationFrame',\n 'requestAnimationFrame-if.js',\n 'ubo-requestAnimationFrame-if.js',\n 'raf-if.js',\n 'ubo-raf-if.js',\n];\n\npreventRequestAnimationFrame.injections = [hit, startsWith, toRegExp, noopFunc];\n","/**\n * This file must export all scriptlets which should be accessible\n */\nexport * from './abort-on-property-read';\nexport * from './abort-on-property-write';\nexport * from './prevent-setTimeout';\nexport * from './prevent-setInterval';\nexport * from './prevent-window-open';\nexport * from './abort-current-inline-script';\nexport * from './set-constant';\nexport * from './remove-cookie';\nexport * from './prevent-addEventListener';\nexport * from './prevent-bab';\nexport * from './nowebrtc';\nexport * from './log-addEventListener';\nexport * from './log-eval';\nexport * from './log';\nexport * from './noeval';\nexport * from './prevent-eval-if';\nexport * from './prevent-fab-3.2.0';\nexport * from './set-popads-dummy';\nexport * from './prevent-popads-net';\nexport * from './prevent-adfly';\nexport * from './debug-on-property-read';\nexport * from './debug-on-property-write';\nexport * from './debug-current-inline-script';\nexport * from './remove-attr';\nexport * from './remove-class';\nexport * from './disable-newtab-links';\nexport * from './adjust-setInterval';\nexport * from './adjust-setTimeout';\nexport * from './dir-string';\nexport * from './json-prune';\nexport * from './prevent-requestAnimationFrame';\n","import {\n startsWith,\n substringAfter,\n} from './string-utils';\n\nimport { ADG_SCRIPTLET_MASK } from './parse-rule';\n\nimport * as scriptletsList from '../scriptlets/scriptletsList';\n\nimport { redirects } from '../../scripts/compatibility-table.json';\n\nconst JS_RULE_MASK = '#%#';\nconst COMMENT_MARKER = '!';\n\n/**\n * Checks if rule text is comment e.g. !!example.org##+js(set-constant.js, test, false)\n * @param {string} rule\n * @return {boolean}\n */\nconst isComment = (rule) => startsWith(rule, COMMENT_MARKER);\n\n\n/* ************************************************************************\n *\n * Scriptlets\n *\n ************************************************************************** */\n\n\n/**\n * uBlock scriptlet rule mask\n */\nconst UBO_SCRIPTLET_MASK_REG = /#@?#script:inject|#@?#\\s*\\+js/;\nconst UBO_SCRIPTLET_MASK_1 = '##+js';\nconst UBO_SCRIPTLET_MASK_2 = '##script:inject';\nconst UBO_SCRIPTLET_EXCEPTION_MASK_1 = '#@#+js';\nconst UBO_SCRIPTLET_EXCEPTION_MASK_2 = '#@#script:inject';\n\n/**\n * AdBlock Plus snippet rule mask\n */\nconst ABP_SCRIPTLET_MASK = '#$#';\nconst ABP_SCRIPTLET_EXCEPTION_MASK = '#@$#';\n\n/**\n * AdGuard CSS rule mask\n */\nconst ADG_CSS_MASK_REG = /#@?\\$#.+?\\s*\\{.*\\}\\s*$/g;\n\n\n/**\n * Checks if the `rule` is AdGuard scriptlet rule\n * @param {string} rule - rule text\n */\nconst isAdgScriptletRule = (rule) => {\n return (\n !isComment(rule)\n && rule.indexOf(ADG_SCRIPTLET_MASK) > -1\n );\n};\n\n/**\n * Checks if the `rule` is uBO scriptlet rule\n * @param {string} rule rule text\n */\nconst isUboScriptletRule = (rule) => {\n return (\n rule.indexOf(UBO_SCRIPTLET_MASK_1) > -1\n || rule.indexOf(UBO_SCRIPTLET_MASK_2) > -1\n || rule.indexOf(UBO_SCRIPTLET_EXCEPTION_MASK_1) > -1\n || rule.indexOf(UBO_SCRIPTLET_EXCEPTION_MASK_2) > -1\n )\n && UBO_SCRIPTLET_MASK_REG.test(rule)\n && !isComment(rule);\n};\n\n/**\n * Checks if the `rule` is AdBlock Plus snippet\n * @param {string} rule rule text\n */\nconst isAbpSnippetRule = (rule) => {\n return (\n rule.indexOf(ABP_SCRIPTLET_MASK) > -1\n || rule.indexOf(ABP_SCRIPTLET_EXCEPTION_MASK) > -1\n )\n && rule.search(ADG_CSS_MASK_REG) === -1\n && !isComment(rule);\n};\n\n/**\n * Finds scriptlet by it's name\n * @param {string} name - scriptlet name\n */\nconst getScriptletByName = (name) => {\n const scriptlets = Object.keys(scriptletsList).map((key) => scriptletsList[key]);\n return scriptlets\n .find((s) => s.names && s.names.indexOf(name) > -1);\n};\n\n/**\n * Checks if the scriptlet name is valid\n * @param {string} name - Scriptlet name\n */\nconst isValidScriptletName = (name) => {\n if (!name) {\n return false;\n }\n const scriptlet = getScriptletByName(name);\n if (!scriptlet) {\n return false;\n }\n return true;\n};\n\n/* ************************************************************************\n *\n * Redirects\n *\n ************************************************************************** */\n\n/**\n * Redirect resources markers\n */\nconst ADG_UBO_REDIRECT_MARKER = 'redirect=';\nconst ABP_REDIRECT_MARKER = 'rewrite=abp-resource:';\n\nconst VALID_SOURCE_TYPES = [\n 'image',\n 'subdocument',\n 'stylesheet',\n 'script',\n 'xmlhttprequest',\n 'media',\n];\n\nconst validAdgRedirects = redirects.filter((el) => el.adg);\n\n/**\n * Converts array of pairs to object.\n * Sort of Object.fromEntries() polyfill.\n * @param {Array} pairs - array of pairs\n * @returns {Object}\n */\nconst objFromEntries = (pairs) => {\n const output = pairs\n .reduce((acc, el) => {\n const [key, value] = el;\n acc[key] = value;\n return acc;\n }, {});\n return output;\n};\n\n/**\n * Compatibility object where KEYS = UBO redirect names and VALUES = ADG redirect names\n * It's used for UBO -> ADG converting\n */\nconst uboToAdgCompatibility = objFromEntries(\n validAdgRedirects\n .filter((el) => el.ubo)\n .map((el) => {\n return [el.ubo, el.adg];\n }),\n);\n\n/**\n * Compatibility object where KEYS = ABP redirect names and VALUES = ADG redirect names\n * It's used for ABP -> ADG converting\n */\nconst abpToAdgCompatibility = objFromEntries(\n validAdgRedirects\n .filter((el) => el.abp)\n .map((el) => {\n return [el.abp, el.adg];\n }),\n);\n\n/**\n * Compatibility object where KEYS = UBO redirect names and VALUES = ADG redirect names\n * It's used for ADG -> UBO converting\n */\nconst adgToUboCompatibility = objFromEntries(\n validAdgRedirects\n .filter((el) => el.ubo)\n .map((el) => {\n return [el.adg, el.ubo];\n }),\n);\n\n/**\n * Needed for AdGuard redirect names validation where KEYS = **valid** AdGuard redirect names\n * 'adgToUboCompatibility' is still needed for ADG -> UBO converting\n */\nconst validAdgCompatibility = objFromEntries(\n validAdgRedirects\n .map((el) => {\n return [el.adg, 'valid adg redirect'];\n }),\n);\n\nconst REDIRECT_RULE_TYPES = {\n VALID_ADG: {\n marker: ADG_UBO_REDIRECT_MARKER,\n compatibility: validAdgCompatibility,\n },\n ADG: {\n marker: ADG_UBO_REDIRECT_MARKER,\n compatibility: adgToUboCompatibility,\n },\n UBO: {\n marker: ADG_UBO_REDIRECT_MARKER,\n compatibility: uboToAdgCompatibility,\n },\n ABP: {\n marker: ABP_REDIRECT_MARKER,\n compatibility: abpToAdgCompatibility,\n },\n};\n\n/**\n * Parses redirect rule modifiers\n * @param {string} rule\n * @returns {Array}\n */\nconst parseModifiers = (rule) => substringAfter(rule, '$').split(',');\n\n/**\n * Gets redirect resource name\n * @param {string} rule\n * @param {string} marker - specific Adg/Ubo or Abp redirect resources marker\n * @returns {string} - redirect resource name\n */\nconst getRedirectName = (rule, marker) => {\n const ruleModifiers = parseModifiers(rule);\n const redirectNamePart = ruleModifiers\n .find((el) => el.indexOf(marker) > -1);\n return substringAfter(redirectNamePart, marker);\n};\n\n\n/**\n * Checks if the `rule` is AdGuard redirect rule.\n * Discards comments and JS rules and checks if the `rule` has 'redirect' modifier.\n * @param {string} rule - rule text\n */\nconst isAdgRedirectRule = (rule) => {\n return (\n !isComment(rule)\n // some js rules may have 'redirect=' in it, so we should get rid of them\n && !rule.indexOf(JS_RULE_MASK) > -1\n && rule.indexOf(REDIRECT_RULE_TYPES.ADG.marker) > -1\n );\n};\n\n/**\n * Checks if the `rule` satisfies the `type`\n * @param {string} rule - rule text\n * @param {'VALID_ADG'|'ADG'|'UBO'|'ABP'} type - type of a redirect rule\n */\nconst isRedirectRuleByType = (rule, type) => {\n const { marker, compatibility } = REDIRECT_RULE_TYPES[type];\n\n if (rule\n && (!isComment(rule))\n && (rule.indexOf(marker) > -1)) {\n const redirectName = getRedirectName(rule, marker);\n\n return redirectName === Object\n .keys(compatibility)\n .find((el) => el === redirectName);\n }\n return false;\n};\n\n/**\n* Checks if the `rule` is **valid** AdGuard redirect resource rule\n* @param {string} rule - rule text\n* @returns {boolean}\n*/\nconst isValidAdgRedirectRule = (rule) => {\n return isRedirectRuleByType(rule, 'VALID_ADG');\n};\n\n\n/**\n* Checks if the AdGuard redirect `rule` has Ubo analog. Needed for Adg->Ubo conversion\n* @param {string} rule - AdGuard rule text\n* @returns {boolean} - true if the rule can be converted to Ubo\n*/\nconst isAdgRedirectCompatibleWithUbo = (rule) => {\n return isRedirectRuleByType(rule, 'ADG');\n};\n\n/**\n* Checks if the Ubo redirect `rule` has AdGuard analog. Needed for Ubo->Adg conversion\n* @param {string} rule - Ubo rule text\n* @returns {boolean} - true if the rule can be converted to AdGuard\n*/\nconst isUboRedirectCompatibleWithAdg = (rule) => {\n return isRedirectRuleByType(rule, 'UBO');\n};\n\n/**\n* Checks if the Abp redirect `rule` has AdGuard analog. Needed for Abp->Adg conversion\n* @param {string} rule - Abp rule text\n* @returns {boolean} - true if the rule can be converted to AdGuard\n*/\nconst isAbpRedirectCompatibleWithAdg = (rule) => {\n return isRedirectRuleByType(rule, 'ABP');\n};\n\n\n/**\n * Checks if the rule has specified content type before Adg -> Ubo conversion.\n *\n * Used ONLY for Adg -> Ubo conversion\n * because Ubo redirect rules must contain content type, but Adg and Abp must not.\n *\n * Also source type can not be added automatically because of such valid rules:\n * ! Abp:\n * $rewrite=abp-resource:blank-js,xmlhttprequest\n * ! Adg:\n * $script,redirect=noopvast-2.0\n * $xmlhttprequest,redirect=noopvast-2.0\n *\n * @param {string} rule\n * @returns {boolean}\n */\nconst hasValidContentType = (rule) => {\n if (isRedirectRuleByType(rule, 'ADG')) {\n const ruleModifiers = parseModifiers(rule);\n const sourceType = ruleModifiers\n .find((el) => VALID_SOURCE_TYPES.indexOf(el) > -1);\n\n return sourceType !== undefined;\n }\n return false;\n};\n\nconst validator = {\n UBO_SCRIPTLET_MASK_REG,\n ABP_SCRIPTLET_MASK,\n ABP_SCRIPTLET_EXCEPTION_MASK,\n isComment,\n isAdgScriptletRule,\n isUboScriptletRule,\n isAbpSnippetRule,\n getScriptletByName,\n isValidScriptletName,\n REDIRECT_RULE_TYPES,\n isAdgRedirectRule,\n isValidAdgRedirectRule,\n isAdgRedirectCompatibleWithUbo,\n isUboRedirectCompatibleWithAdg,\n isAbpRedirectCompatibleWithAdg,\n parseModifiers,\n getRedirectName,\n hasValidContentType,\n};\n\nexport default validator;\n","function _iterableToArray(iter) {\n if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter);\n}\n\nmodule.exports = _iterableToArray;","var arrayWithHoles = require(\"./arrayWithHoles\");\n\nvar iterableToArray = require(\"./iterableToArray\");\n\nvar nonIterableRest = require(\"./nonIterableRest\");\n\nfunction _toArray(arr) {\n return arrayWithHoles(arr) || iterableToArray(arr) || nonIterableRest();\n}\n\nmodule.exports = _toArray;","import {\n getBeforeRegExp,\n substringAfter,\n substringBefore,\n wrapInSingleQuotes,\n getStringInBraces,\n} from './string-utils';\n\nimport validator from './validator';\n\nimport { parseRule } from './parse-rule';\n\nimport * as scriptletList from '../scriptlets/scriptletsList';\n\n/**\n * AdGuard scriptlet rule\n */\nconst ADGUARD_SCRIPTLET_MASK_REG = /#@?%#\\/\\/scriptlet\\(.+\\)/;\n// eslint-disable-next-line no-template-curly-in-string\nconst ADGUARD_SCRIPTLET_TEMPLATE = '${domains}#%#//scriptlet(${args})';\n// eslint-disable-next-line no-template-curly-in-string\nconst ADGUARD_SCRIPTLET_EXCEPTION_TEMPLATE = '${domains}#@%#//scriptlet(${args})';\n\n/**\n * uBlock scriptlet rule mask\n */\n// eslint-disable-next-line no-template-curly-in-string\nconst UBO_SCRIPTLET_TEMPLATE = '${domains}##+js(${args})';\n// eslint-disable-next-line no-template-curly-in-string\nconst UBO_SCRIPTLET_EXCEPTION_TEMPLATE = '${domains}#@#+js(${args})';\n\nconst UBO_ALIAS_NAME_MARKER = 'ubo-';\n\n// https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#xhr\nconst UBO_XHR_TYPE = 'xhr';\n\nconst ADG_XHR_TYPE = 'xmlhttprequest';\n\n\n/**\n * Returns array of strings separated by space which not in quotes\n * @param {string} str\n */\nconst getSentences = (str) => {\n const reg = /'.*?'|\".*?\"|\\S+/g;\n return str.match(reg);\n};\n\n/**\n * Replaces string with data by placeholders\n * @param {string} str\n * @param {Object} data - where keys are placeholders names\n */\nconst replacePlaceholders = (str, data) => {\n return Object.keys(data).reduce((acc, key) => {\n const reg = new RegExp(`\\\\$\\\\{${key}\\\\}`, 'g');\n acc = acc.replace(reg, data[key]);\n return acc;\n }, str);\n};\n\n/**\n * Converts string of UBO scriptlet rule to AdGuard scritlet rule\n * @param {string} rule - UBO scriptlet rule\n * @returns {Array} - array with one AdGuard scriptlet rule\n */\nexport const convertUboScriptletToAdg = (rule) => {\n const domains = getBeforeRegExp(rule, validator.UBO_SCRIPTLET_MASK_REG);\n const mask = rule.match(validator.UBO_SCRIPTLET_MASK_REG)[0];\n let template;\n if (mask.indexOf('@') > -1) {\n template = ADGUARD_SCRIPTLET_EXCEPTION_TEMPLATE;\n } else {\n template = ADGUARD_SCRIPTLET_TEMPLATE;\n }\n const args = getStringInBraces(rule)\n .split(/, /g)\n .map((arg, index) => {\n let outputArg;\n if (index === 0) {\n outputArg = (arg.indexOf('.js') > -1) ? `ubo-${arg}` : `ubo-${arg}.js`;\n } else {\n outputArg = arg;\n }\n // for example: dramaserial.xyz##+js(abort-current-inline-script, $, popup)\n if (arg === '$') {\n outputArg = '$$';\n }\n return outputArg;\n })\n .map((arg) => wrapInSingleQuotes(arg))\n .join(', ');\n const adgRule = replacePlaceholders(\n template,\n { domains, args },\n );\n return [adgRule];\n};\n\n/**\n * Convert string of ABP snippet rule to AdGuard scritlet rule\n * @param {string} rule - ABP snippet rule\n * @returns {Array} - array of AdGuard scriptlet rules -\n * one or few items depends on Abp-rule\n */\nexport const convertAbpSnippetToAdg = (rule) => {\n const SEMICOLON_DIVIDER = /;(?=(?:(?:[^\"]*\"){2})*[^\"]*$)/g;\n const mask = rule.indexOf(validator.ABP_SCRIPTLET_MASK) > -1\n ? validator.ABP_SCRIPTLET_MASK\n : validator.ABP_SCRIPTLET_EXCEPTION_MASK;\n const template = mask === validator.ABP_SCRIPTLET_MASK\n ? ADGUARD_SCRIPTLET_TEMPLATE\n : ADGUARD_SCRIPTLET_EXCEPTION_TEMPLATE;\n const domains = substringBefore(rule, mask);\n const args = substringAfter(rule, mask);\n\n return args.split(SEMICOLON_DIVIDER)\n .map((args) => getSentences(args)\n .filter((arg) => arg)\n .map((arg, index) => (index === 0 ? `abp-${arg}` : arg))\n .map((arg) => wrapInSingleQuotes(arg))\n .join(', '))\n .map((args) => replacePlaceholders(template, { domains, args }));\n};\n\n/**\n * Converts scriptlet rule to AdGuard one\n * @param {string} rule\n * @returns {Array} - array of AdGuard scriptlet rules -\n * one item for Adg and Ubo or few items for Abp\n */\nexport const convertScriptletToAdg = (rule) => {\n let result;\n if (validator.isUboScriptletRule(rule)) {\n result = convertUboScriptletToAdg(rule);\n } else if (validator.isAbpSnippetRule(rule)) {\n result = convertAbpSnippetToAdg(rule);\n } else if (validator.isAdgScriptletRule(rule) || (validator.isComment(rule))) {\n result = [rule];\n }\n\n return result;\n};\n\n/**\n * Converts UBO scriptlet rule to AdGuard one\n * @param {string} rule - AdGuard scriptlet rule\n * @returns {string} - UBO scriptlet rule\n */\nexport const convertAdgScriptletToUbo = (rule) => {\n let res;\n\n if (validator.isAdgScriptletRule(rule)) {\n const { name: parsedName, args: parsedParams } = parseRule(rule);\n\n // object of name and aliases for the Adg-scriptlet\n const adgScriptletObject = Object\n .keys(scriptletList)\n .map((el) => scriptletList[el])\n .map((s) => {\n const [name, ...aliases] = s.names;\n return { name, aliases };\n })\n .find((el) => (el.name === parsedName\n || el.aliases.indexOf(parsedName) >= 0));\n\n const { aliases } = adgScriptletObject;\n\n if (aliases.length > 0) {\n const uboAlias = adgScriptletObject.aliases\n // eslint-disable-next-line no-restricted-properties\n .find((alias) => alias.includes(UBO_ALIAS_NAME_MARKER));\n\n if (uboAlias) {\n const mask = rule.match(ADGUARD_SCRIPTLET_MASK_REG)[0];\n let template;\n if (mask.indexOf('@') > -1) {\n template = UBO_SCRIPTLET_EXCEPTION_TEMPLATE;\n } else {\n template = UBO_SCRIPTLET_TEMPLATE;\n }\n const domains = getBeforeRegExp(rule, ADGUARD_SCRIPTLET_MASK_REG);\n const uboName = uboAlias\n .replace(UBO_ALIAS_NAME_MARKER, '')\n // '.js' in the Ubo scriptlet name can be omitted\n // https://github.com/gorhill/uBlock/wiki/Resources-Library#general-purpose-scriptlets\n .replace('.js', '');\n\n const args = (parsedParams.length > 0) ? `${uboName}, ${parsedParams.join(', ')}` : uboName;\n\n const uboRule = replacePlaceholders(\n template,\n { domains, args },\n );\n\n res = uboRule;\n }\n }\n }\n\n return res;\n};\n\n/**\n * Validates any scriptlet rule\n * @param {string} input - can be Adguard or Ubo or Abp scriptlet rule\n */\nexport const isValidScriptletRule = (input) => {\n if (!input) {\n return false;\n }\n // ABP 'input' rule may contain more than one snippet\n const rulesArray = convertScriptletToAdg(input);\n\n // checking if each of parsed scriptlets is valid\n // if at least one of them is not valid - whole 'input' rule is not valid too\n const isValid = rulesArray.reduce((acc, rule) => {\n const parsedRule = parseRule(rule);\n return validator.isValidScriptletName(parsedRule.name) && acc;\n }, true);\n\n return isValid;\n};\n\n\n/**\n * Converts Ubo redirect rule to Adg one\n * @param {string} rule\n * @returns {string}\n */\nexport const convertUboRedirectToAdg = (rule) => {\n const firstPartOfRule = substringBefore(rule, '$');\n const uboModifiers = validator.parseModifiers(rule);\n const adgModifiers = uboModifiers\n .map((el) => {\n if (el.indexOf(validator.REDIRECT_RULE_TYPES.UBO.marker) > -1) {\n const uboName = substringAfter(el, validator.REDIRECT_RULE_TYPES.UBO.marker);\n const adgName = validator.REDIRECT_RULE_TYPES.UBO.compatibility[uboName];\n return `${validator.REDIRECT_RULE_TYPES.ADG.marker}${adgName}`;\n }\n if (el === UBO_XHR_TYPE) {\n return ADG_XHR_TYPE;\n }\n return el;\n })\n .join(',');\n\n return `${firstPartOfRule}$${adgModifiers}`;\n};\n\n/**\n * Converts Abp redirect rule to Adg one\n * @param {string} rule\n * @returns {string}\n */\nexport const convertAbpRedirectToAdg = (rule) => {\n const firstPartOfRule = substringBefore(rule, '$');\n const abpModifiers = validator.parseModifiers(rule);\n const adgModifiers = abpModifiers\n .map((el) => {\n if (el.indexOf(validator.REDIRECT_RULE_TYPES.ABP.marker) > -1) {\n const abpName = substringAfter(el, validator.REDIRECT_RULE_TYPES.ABP.marker);\n const adgName = validator.REDIRECT_RULE_TYPES.ABP.compatibility[abpName];\n return `${validator.REDIRECT_RULE_TYPES.ADG.marker}${adgName}`;\n }\n return el;\n })\n .join(',');\n\n return `${firstPartOfRule}$${adgModifiers}`;\n};\n\n/**\n * Converts redirect rule to AdGuard one\n * @param {string} rule\n * @returns {string}\n */\nexport const convertRedirectToAdg = (rule) => {\n let result;\n if (validator.isUboRedirectCompatibleWithAdg(rule)) {\n result = convertUboRedirectToAdg(rule);\n } else if (validator.isAbpRedirectCompatibleWithAdg(rule)) {\n result = convertAbpRedirectToAdg(rule);\n } else if (validator.isValidAdgRedirectRule(rule)) {\n result = rule;\n }\n\n return result;\n};\n\n/**\n * Converts Adg redirect rule to Ubo one\n * @param {string} rule\n * @returns {string}\n */\nexport const convertAdgRedirectToUbo = (rule) => {\n if (!validator.hasValidContentType(rule)) {\n throw new Error(`Rule is not valid for converting to Ubo. Source type is not specified in the rule: ${rule}`);\n } else {\n const firstPartOfRule = substringBefore(rule, '$');\n const uboModifiers = validator.parseModifiers(rule);\n const adgModifiers = uboModifiers\n .map((el) => {\n if (el.indexOf(validator.REDIRECT_RULE_TYPES.ADG.marker) > -1) {\n const adgName = substringAfter(el, validator.REDIRECT_RULE_TYPES.ADG.marker);\n const uboName = validator.REDIRECT_RULE_TYPES.ADG.compatibility[adgName];\n return `${validator.REDIRECT_RULE_TYPES.UBO.marker}${uboName}`;\n }\n return el;\n })\n .join(',');\n\n return `${firstPartOfRule}$${adgModifiers}`;\n }\n};\n","import {\n hit, noopFunc, noopNull, noopArray,\n} from '../helpers';\n\n/**\n * @redirect google-analytics\n *\n * @description\n * Mocks Google Analytics API.\n *\n * Related UBO redirect resource:\n * https://github.com/gorhill/uBlock/blob/a94df7f3b27080ae2dcb3b914ace39c0c294d2f6/src/web_accessible_resources/google-analytics_analytics.js\n *\n * **Example**\n * ```\n * ||google-analytics.com/analytics.js$script,redirect=google-analytics\n * ```\n */\nexport function GoogleAnalytics(source) {\n // eslint-disable-next-line func-names\n const Tracker = function () { }; // constructor\n const proto = Tracker.prototype;\n proto.get = noopFunc;\n proto.set = noopFunc;\n proto.send = noopFunc;\n\n const googleAnalyticsName = window.GoogleAnalyticsObject || 'ga';\n function ga() {\n const len = arguments.length;\n if (len === 0) {\n return;\n }\n // eslint-disable-next-line prefer-rest-params\n const lastArg = arguments[len - 1];\n if (typeof lastArg !== 'object'\n || lastArg === null\n || typeof lastArg.hitCallback !== 'function'\n ) {\n return;\n }\n\n try {\n lastArg.hitCallback();\n // eslint-disable-next-line no-empty\n } catch (ex) { }\n }\n\n ga.create = () => new Tracker();\n ga.getByName = noopNull;\n ga.getAll = noopArray;\n ga.remove = noopFunc;\n ga.loaded = true;\n window[googleAnalyticsName] = ga;\n\n const { dataLayer } = window;\n if (dataLayer instanceof Object\n && dataLayer.hide instanceof Object\n && typeof dataLayer.hide.end === 'function'\n ) {\n dataLayer.hide.end();\n }\n\n hit(source);\n}\n\nGoogleAnalytics.names = [\n 'google-analytics',\n 'ubo-google-analytics_analytics.js',\n 'google-analytics_analytics.js',\n];\n\nGoogleAnalytics.injections = [\n hit,\n noopFunc,\n noopNull,\n noopArray,\n];\n","/* eslint-disable no-underscore-dangle */\nimport { hit, noopFunc } from '../helpers';\n\n/**\n * @redirect google-analytics-ga\n *\n * @description\n * Mocks old Google Analytics API.\n *\n * Related UBO redirect resource:\n * https://github.com/gorhill/uBlock/blob/a94df7f3b27080ae2dcb3b914ace39c0c294d2f6/src/web_accessible_resources/google-analytics_ga.js\n *\n * **Example**\n * ```\n * ||google-analytics.com/ga.js$script,redirect=google-analytics-ga\n * ```\n */\nexport function GoogleAnalyticsGa(source) {\n // Gaq constructor\n function Gaq() { }\n\n Gaq.prototype.Na = noopFunc;\n Gaq.prototype.O = noopFunc;\n Gaq.prototype.Sa = noopFunc;\n Gaq.prototype.Ta = noopFunc;\n Gaq.prototype.Va = noopFunc;\n Gaq.prototype._createAsyncTracker = noopFunc;\n Gaq.prototype._getAsyncTracker = noopFunc;\n Gaq.prototype._getPlugin = noopFunc;\n Gaq.prototype.push = (data) => {\n if (typeof data === 'function') {\n data();\n return;\n }\n if (Array.isArray(data) === false) {\n return;\n }\n // https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiDomainDirectory#_gat.GA_Tracker_._link\n if (data[0] === '_link' && typeof data[1] === 'string') {\n window.location.assign(data[1]);\n }\n // https://github.com/gorhill/uBlock/issues/2162\n if (data[0] === '_set' && data[1] === 'hitCallback' && typeof data[2] === 'function') {\n data[2]();\n }\n };\n\n const gaq = new Gaq();\n const asyncTrackers = window._gaq || [];\n if (Array.isArray(asyncTrackers)) {\n while (asyncTrackers[0]) {\n gaq.push(asyncTrackers.shift());\n }\n }\n // eslint-disable-next-line no-multi-assign\n window._gaq = gaq.qf = gaq;\n\n\n // Gat constructor\n function Gat() { }\n\n // Mock tracker api\n const api = [\n '_addIgnoredOrganic', '_addIgnoredRef', '_addItem', '_addOrganic',\n '_addTrans', '_clearIgnoredOrganic', '_clearIgnoredRef', '_clearOrganic',\n '_cookiePathCopy', '_deleteCustomVar', '_getName', '_setAccount',\n '_getAccount', '_getClientInfo', '_getDetectFlash', '_getDetectTitle',\n '_getLinkerUrl', '_getLocalGifPath', '_getServiceMode', '_getVersion',\n '_getVisitorCustomVar', '_initData', '_link', '_linkByPost',\n '_setAllowAnchor', '_setAllowHash', '_setAllowLinker', '_setCampContentKey',\n '_setCampMediumKey', '_setCampNameKey', '_setCampNOKey', '_setCampSourceKey',\n '_setCampTermKey', '_setCampaignCookieTimeout', '_setCampaignTrack', '_setClientInfo',\n '_setCookiePath', '_setCookiePersistence', '_setCookieTimeout', '_setCustomVar',\n '_setDetectFlash', '_setDetectTitle', '_setDomainName', '_setLocalGifPath',\n '_setLocalRemoteServerMode', '_setLocalServerMode', '_setReferrerOverride', '_setRemoteServerMode',\n '_setSampleRate', '_setSessionTimeout', '_setSiteSpeedSampleRate', '_setSessionCookieTimeout',\n '_setVar', '_setVisitorCookieTimeout', '_trackEvent', '_trackPageLoadTime',\n '_trackPageview', '_trackSocial', '_trackTiming', '_trackTrans',\n '_visitCode',\n ];\n const tracker = api.reduce((res, funcName) => {\n res[funcName] = noopFunc;\n return res;\n }, {});\n tracker._getLinkerUrl = (a) => a;\n\n Gat.prototype._anonymizeIP = noopFunc;\n Gat.prototype._createTracker = noopFunc;\n Gat.prototype._forceSSL = noopFunc;\n Gat.prototype._getPlugin = noopFunc;\n Gat.prototype._getTracker = () => tracker;\n Gat.prototype._getTrackerByName = () => tracker;\n Gat.prototype._getTrackers = noopFunc;\n Gat.prototype.aa = noopFunc;\n Gat.prototype.ab = noopFunc;\n Gat.prototype.hb = noopFunc;\n Gat.prototype.la = noopFunc;\n Gat.prototype.oa = noopFunc;\n Gat.prototype.pa = noopFunc;\n Gat.prototype.u = noopFunc;\n\n const gat = new Gat();\n window._gat = gat;\n\n hit(source);\n}\n\nGoogleAnalyticsGa.names = [\n 'google-analytics-ga',\n 'ubo-google-analytics_ga.js',\n 'google-analytics_ga.js',\n];\n\nGoogleAnalyticsGa.injections = [hit, noopFunc];\n","import { hit } from '../helpers';\n\n/* eslint-disable max-len */\n/**\n * @redirect googlesyndication-adsbygoogle\n *\n * @description\n * Mocks Google AdSense API.\n *\n * Related UBO redirect resource:\n * https://github.com/gorhill/uBlock/blob/a94df7f3b27080ae2dcb3b914ace39c0c294d2f6/src/web_accessible_resources/googlesyndication_adsbygoogle.js\n *\n * **Example**\n * ```\n * ||pagead2.googlesyndication.com/pagead/js/adsbygoogle.js$script,redirect=googlesyndication-adsbygoogle\n * ```\n */\n/* eslint-enable max-len */\nexport function GoogleSyndicationAdsByGoogle(source) {\n window.adsbygoogle = window.adsbygoogle || {\n length: 0,\n loaded: true,\n push() {\n this.length += 1;\n },\n };\n const adElems = document.querySelectorAll('.adsbygoogle');\n const css = 'height:1px!important;max-height:1px!important;max-width:1px!important;width:1px!important;';\n let executed = false;\n for (let i = 0; i < adElems.length; i += 1) {\n adElems[i].setAttribute('data-adsbygoogle-status', 'done');\n\n const aswiftIframe = document.createElement('iframe');\n aswiftIframe.id = `aswift_${i + 1}`;\n aswiftIframe.style = css;\n adElems[i].appendChild(aswiftIframe);\n\n const googleadsIframe = document.createElement('iframe');\n googleadsIframe.id = `google_ads_iframe_${i}`;\n googleadsIframe.style = css;\n adElems[i].appendChild(googleadsIframe);\n\n executed = true;\n }\n\n if (executed) {\n hit(source);\n }\n}\n\nGoogleSyndicationAdsByGoogle.names = [\n 'googlesyndication-adsbygoogle',\n 'ubo-googlesyndication_adsbygoogle.js',\n 'googlesyndication_adsbygoogle.js',\n];\n\nGoogleSyndicationAdsByGoogle.injections = [\n hit,\n];\n","import { hit, noopFunc } from '../helpers';\n\n/**\n * @redirect googletagmanager-gtm\n *\n * @description\n * Mocks Google Tag Manager API.\n *\n * Related UBO redirect resource:\n * https://github.com/gorhill/uBlock/blob/a94df7f3b27080ae2dcb3b914ace39c0c294d2f6/src/web_accessible_resources/googletagmanager_gtm.js\n *\n * **Example**\n * ```\n * ||googletagmanager.com/gtm.js$script,redirect=googletagmanager-gtm\n * ```\n */\nexport function GoogleTagManagerGtm(source) {\n window.ga = window.ga || noopFunc;\n const { dataLayer } = window;\n if (dataLayer instanceof Object === false) {\n return;\n }\n\n if (dataLayer.hide instanceof Object && typeof dataLayer.hide.end === 'function') {\n dataLayer.hide.end();\n }\n\n if (typeof dataLayer.push === 'function') {\n dataLayer.push = (data) => {\n if (data instanceof Object && typeof data.eventCallback === 'function') {\n setTimeout(data.eventCallback, 1);\n }\n };\n }\n\n hit(source);\n}\n\nGoogleTagManagerGtm.names = [\n 'googletagmanager-gtm',\n 'ubo-googletagmanager_gtm.js',\n 'googletagmanager_gtm.js',\n];\n\nGoogleTagManagerGtm.injections = [hit, noopFunc];\n","import {\n hit, noopFunc, noopThis, noopNull, noopArray, noopStr,\n} from '../helpers';\n\n/**\n * @redirect googletagservices-gpt\n *\n * @description\n * Mocks Google Publisher Tag API.\n *\n * Related UBO redirect resource:\n * https://github.com/gorhill/uBlock/blob/a94df7f3b27080ae2dcb3b914ace39c0c294d2f6/src/web_accessible_resources/googletagservices_gpt.js\n *\n * **Example**\n * ```\n * ||googletagservices.com/tag/js/gpt.js$script,redirect=googletagservices-gpt\n * ```\n */\nexport function GoogleTagServicesGpt(source) {\n const companionAdsService = {\n addEventListener: noopThis,\n enableSyncLoading: noopFunc,\n setRefreshUnfilledSlots: noopFunc,\n };\n const contentService = {\n addEventListener: noopThis,\n setContent: noopFunc,\n };\n function PassbackSlot() { } // constructor\n\n PassbackSlot.prototype.display = noopFunc;\n PassbackSlot.prototype.get = noopNull;\n PassbackSlot.prototype.set = noopThis;\n PassbackSlot.prototype.setClickUrl = noopThis;\n PassbackSlot.prototype.setTagForChildDirectedTreatment = noopThis;\n PassbackSlot.prototype.setTargeting = noopThis;\n PassbackSlot.prototype.updateTargetingFromMap = noopThis;\n\n function SizeMappingBuilder() { } // constructor\n SizeMappingBuilder.prototype.addSize = noopThis;\n SizeMappingBuilder.prototype.build = noopNull;\n\n function Slot() { } // constructor\n Slot.prototype.addService = noopThis;\n Slot.prototype.clearCategoryExclusions = noopThis;\n Slot.prototype.clearTargeting = noopThis;\n Slot.prototype.defineSizeMapping = noopThis;\n Slot.prototype.get = noopNull;\n Slot.prototype.getAdUnitPath = noopArray;\n Slot.prototype.getAttributeKeys = noopArray;\n Slot.prototype.getCategoryExclusions = noopArray;\n Slot.prototype.getDomId = noopStr;\n Slot.prototype.getSlotElementId = noopStr;\n Slot.prototype.getSlotId = noopThis;\n Slot.prototype.getTargeting = noopArray;\n Slot.prototype.getTargetingKeys = noopArray;\n Slot.prototype.set = noopThis;\n Slot.prototype.setCategoryExclusion = noopThis;\n Slot.prototype.setClickUrl = noopThis;\n Slot.prototype.setCollapseEmptyDiv = noopThis;\n Slot.prototype.setTargeting = noopThis;\n\n const pubAdsService = {\n addEventListener: noopThis,\n clear: noopFunc,\n clearCategoryExclusions: noopThis,\n clearTagForChildDirectedTreatment: noopThis,\n clearTargeting: noopThis,\n collapseEmptyDivs: noopFunc,\n defineOutOfPagePassback() { return new PassbackSlot(); },\n definePassback() { return new PassbackSlot(); },\n disableInitialLoad: noopFunc,\n display: noopFunc,\n enableAsyncRendering: noopFunc,\n enableSingleRequest: noopFunc,\n enableSyncRendering: noopFunc,\n enableVideoAds: noopFunc,\n get: noopNull,\n getAttributeKeys: noopArray,\n getTargeting: noopFunc,\n getTargetingKeys: noopArray,\n getSlots: noopArray,\n refresh: noopFunc,\n set: noopThis,\n setCategoryExclusion: noopThis,\n setCentering: noopFunc,\n setCookieOptions: noopThis,\n setForceSafeFrame: noopThis,\n setLocation: noopThis,\n setPublisherProvidedId: noopThis,\n setRequestNonPersonalizedAds: noopThis,\n setSafeFrameConfig: noopThis,\n setTagForChildDirectedTreatment: noopThis,\n setTargeting: noopThis,\n setVideoContent: noopThis,\n updateCorrelator: noopFunc,\n };\n\n\n const { googletag = {} } = window;\n const { cmd = [] } = googletag;\n\n googletag.apiReady = true;\n googletag.cmd = [];\n googletag.cmd.push = (a) => {\n try {\n a();\n // eslint-disable-next-line no-empty\n } catch (ex) { }\n return 1;\n };\n googletag.companionAds = () => companionAdsService;\n googletag.content = () => contentService;\n googletag.defineOutOfPageSlot = () => new Slot();\n googletag.defineSlot = () => new Slot();\n googletag.destroySlots = noopFunc;\n googletag.disablePublisherConsole = noopFunc;\n googletag.display = noopFunc;\n googletag.enableServices = noopFunc;\n googletag.getVersion = noopStr;\n googletag.pubads = () => pubAdsService;\n googletag.pubadsReady = true;\n googletag.setAdIframeTitle = noopFunc;\n googletag.sizeMapping = () => new SizeMappingBuilder();\n\n window.googletag = googletag;\n while (cmd.length !== 0) {\n googletag.cmd.push(cmd.shift());\n }\n\n hit(source);\n}\n\nGoogleTagServicesGpt.names = [\n 'googletagservices-gpt',\n 'ubo-googletagservices_gpt.js',\n 'googletagservices_gpt.js',\n];\n\nGoogleTagServicesGpt.injections = [\n hit,\n noopFunc,\n noopThis,\n noopNull,\n noopArray,\n noopStr,\n];\n","import { hit } from '../helpers';\n\n/**\n * @redirect scorecardresearch-beacon\n *\n * @description\n * Mocks Scorecard Research API.\n *\n * Related UBO redirect resource:\n * https://github.com/gorhill/uBlock/blob/a94df7f3b27080ae2dcb3b914ace39c0c294d2f6/src/web_accessible_resources/scorecardresearch_beacon.js\n *\n * **Example**\n * ```\n * ||sb.scorecardresearch.com/beacon.js$script,redirect=scorecardresearch-beacon\n * ```\n */\nexport function ScoreCardResearchBeacon(source) {\n window.COMSCORE = {\n purge() {\n // eslint-disable-next-line no-underscore-dangle\n window._comscore = [];\n },\n beacon() {},\n };\n hit(source);\n}\n\nScoreCardResearchBeacon.names = [\n 'scorecardresearch-beacon',\n 'ubo-scorecardresearch_beacon.js',\n 'scorecardresearch_beacon.js',\n];\n\nScoreCardResearchBeacon.injections = [\n hit,\n];\n","import { hit, noopFunc } from '../helpers';\n\n/**\n * @redirect metrika-yandex-tag\n *\n * @description\n * Mocks Yandex Metrika API.\n * https://yandex.ru/support/metrica/objects/method-reference.html\n *\n * **Example**\n * ```\n * ||mc.yandex.ru/metrika/tag.js$script,redirect=metrika-yandex-tag\n * ```\n */\nexport function metrikaYandexTag(source) {\n const asyncCallbackFromOptions = (param, options = {}) => {\n let { callback } = options;\n const { ctx } = options;\n if (typeof callback === 'function') {\n callback = ctx !== undefined ? callback.bind(ctx) : callback;\n setTimeout(() => callback());\n }\n };\n\n const init = noopFunc;\n\n /**\n * https://yandex.ru/support/metrica/objects/addfileextension.html\n */\n const addFileExtension = noopFunc;\n\n /**\n * https://yandex.ru/support/metrica/objects/extlink.html\n */\n const extLink = asyncCallbackFromOptions;\n\n /**\n * https://yandex.ru/support/metrica/objects/file.html\n */\n const file = asyncCallbackFromOptions;\n\n /**\n * https://yandex.ru/support/metrica/objects/get-client-id.html\n * @param {Function} cb\n */\n const getClientID = (cb) => {\n setTimeout(cb(null));\n };\n\n /**\n * https://yandex.ru/support/metrica/objects/hit.html\n */\n const hitFunc = asyncCallbackFromOptions;\n\n /**\n * https://yandex.ru/support/metrica/objects/notbounce.html\n */\n const notBounce = asyncCallbackFromOptions;\n\n /**\n * https://yandex.ru/support/metrica/objects/params-method.html\n */\n const params = noopFunc;\n\n /**\n * https://yandex.ru/support/metrica/objects/reachgoal.html\n * @param {string} target\n * @param {Object} params\n * @param {Function} callback\n * @param {any} ctx\n */\n const reachGoal = (target, params, callback, ctx) => {\n asyncCallbackFromOptions(null, { callback, ctx });\n };\n\n /**\n * https://yandex.ru/support/metrica/objects/set-user-id.html\n */\n const setUserID = noopFunc;\n\n /**\n * https://yandex.ru/support/metrica/objects/user-params.html\n */\n const userParams = noopFunc;\n\n const api = {\n init,\n addFileExtension,\n extLink,\n file,\n getClientID,\n hit: hitFunc,\n notBounce,\n params,\n reachGoal,\n setUserID,\n userParams,\n };\n\n function ym(id, funcName, ...args) {\n return api[funcName] && api[funcName](...args);\n }\n\n window.ym = ym;\n\n hit(source);\n}\n\nmetrikaYandexTag.names = [\n 'metrika-yandex-tag',\n];\n\nmetrikaYandexTag.injections = [hit, noopFunc];\n","import { hit, noopFunc } from '../helpers';\n\n/**\n * @redirect metrika-yandex-watch\n *\n * @description\n * Mocks the old Yandex Metrika API.\n * https://yandex.ru/support/metrica/objects/_method-reference.html\n *\n * **Example**\n * ```\n * ||mc.yandex.ru/metrika/watch.js$script,redirect=metrika-yandex-watch\n * ```\n */\nexport function metrikaYandexWatch(source) {\n const cbName = 'yandex_metrika_callbacks';\n\n /**\n * Gets callback and its context from options and call it in async way\n * @param {Object} options Yandex Metrika API options\n */\n const asyncCallbackFromOptions = (options = {}) => {\n let { callback } = options;\n const { ctx } = options;\n if (typeof callback === 'function') {\n callback = ctx !== undefined ? callback.bind(ctx) : callback;\n setTimeout(() => callback());\n }\n };\n\n function Metrika() { } // constructor\n\n // Methods without options\n Metrika.prototype.addFileExtension = noopFunc;\n Metrika.prototype.getClientID = noopFunc;\n Metrika.prototype.setUserID = noopFunc;\n Metrika.prototype.userParams = noopFunc;\n\n // Methods with options\n // The order of arguments should be kept in according to API\n Metrika.prototype.extLink = (url, options) => {\n asyncCallbackFromOptions(options);\n };\n Metrika.prototype.file = (url, options) => {\n asyncCallbackFromOptions(options);\n };\n Metrika.prototype.hit = (url, options) => {\n asyncCallbackFromOptions(options);\n };\n Metrika.prototype.reachGoal = (target, params, cb, ctx) => {\n asyncCallbackFromOptions({ callback: cb, ctx });\n };\n Metrika.prototype.notBounce = asyncCallbackFromOptions;\n\n if (window.Ya) {\n window.Ya.Metrika = Metrika;\n } else {\n window.Ya = { Metrika };\n }\n\n if (window[cbName] && Array.isArray(window[cbName])) {\n window[cbName].forEach((func) => {\n if (typeof func === 'function') {\n func();\n }\n });\n }\n\n hit(source);\n}\n\nmetrikaYandexWatch.names = [\n 'metrika-yandex-watch',\n];\n\nmetrikaYandexWatch.injections = [hit, noopFunc];\n","import {\n attachDependencies,\n addCall,\n wrapInNonameFunc,\n passSourceAndProps,\n} from '../helpers/injector';\n\nimport validator from '../helpers/validator';\n\nimport {\n convertUboRedirectToAdg,\n convertAbpRedirectToAdg,\n convertRedirectToAdg,\n convertAdgRedirectToUbo,\n} from '../helpers/converter';\n\nimport * as redirectsList from './redirectsList';\n\n/**\n * Finds redirect resource by it's name\n * @param {string} name - redirect name\n */\nconst getRedirectByName = (name) => {\n const redirects = Object.keys(redirectsList).map((key) => redirectsList[key]);\n return redirects.find((r) => r.names && r.names.indexOf(name) > -1);\n};\n\n/**\n * @typedef {Object} Source - redirect properties\n * @property {string} name redirect name\n * @property {Array} args Arguments for redirect function\n * @property {'extension'|'test'} [engine] -\n * Defines the final form of redirect string presentation\n * @property {boolean} [verbose] flag to enable printing to console debug information\n */\n\n/**\n * Returns redirect code by param\n * @param {Source} source\n * @returns {string} redirect code\n */\nconst getRedirectCode = (source) => {\n const redirect = getRedirectByName(source.name);\n let result = attachDependencies(redirect);\n result = addCall(redirect, result);\n\n // redirect code for different sources is checked in tests\n // so it should be just a code without any source and props passed\n result = source.engine === 'test'\n ? wrapInNonameFunc(result)\n : passSourceAndProps(source, result);\n\n return result;\n};\n\n\nexport const redirectsCjs = {\n getCode: getRedirectCode,\n isAdgRedirectRule: validator.isAdgRedirectRule,\n isValidAdgRedirectRule: validator.isValidAdgRedirectRule,\n isAdgRedirectCompatibleWithUbo: validator.isAdgRedirectCompatibleWithUbo,\n isUboRedirectCompatibleWithAdg: validator.isUboRedirectCompatibleWithAdg,\n isAbpRedirectCompatibleWithAdg: validator.isAbpRedirectCompatibleWithAdg,\n convertUboRedirectToAdg,\n convertAbpRedirectToAdg,\n convertRedirectToAdg,\n convertAdgRedirectToUbo,\n};\n","import { redirectsCjs } from '../redirects';\n\nimport {\n attachDependencies,\n addCall,\n passSourceAndProps,\n wrapInNonameFunc,\n} from '../helpers/injector';\n\nimport validator from '../helpers/validator';\n\nimport {\n isValidScriptletRule,\n convertUboScriptletToAdg,\n convertAbpSnippetToAdg,\n convertScriptletToAdg,\n convertAdgScriptletToUbo,\n} from '../helpers/converter';\n\n\n/**\n * @typedef {Object} Source - scriptlet properties\n * @property {string} name Scriptlet name\n * @property {Array} args Arguments for scriptlet function\n * @property {'extension'|'corelibs'|'test'} engine -\n * Defines the final form of scriptlet string presentation\n * @property {string} [version]\n * @property {boolean} [verbose] flag to enable printing to console debug information\n * @property {string} [ruleText] Source rule text is used for debugging purposes\n */\n\n/**\n * Returns scriptlet code by param\n * @param {Source} source\n * @returns {string} scriptlet code\n */\nfunction getScriptletCode(source) {\n if (!validator.isValidScriptletName(source.name)) {\n return null;\n }\n\n const scriptlet = validator.getScriptletByName(source.name);\n let result = attachDependencies(scriptlet);\n result = addCall(scriptlet, result);\n result = source.engine === 'corelibs' || source.engine === 'test'\n ? wrapInNonameFunc(result)\n : passSourceAndProps(source, result);\n return result;\n}\n\n/**\n * Scriptlets variable\n *\n * @returns {Object} object with methods:\n * `invoke` method receives one argument with `Source` type\n * `validate` method receives one argument with `String` type\n */\nconst scriptletsObject = (() => ({\n invoke: getScriptletCode,\n isValidScriptletName: validator.isValidScriptletName,\n isValidScriptletRule,\n isAdgScriptletRule: validator.isAdgScriptletRule,\n isUboScriptletRule: validator.isUboScriptletRule,\n isAbpSnippetRule: validator.isAbpSnippetRule,\n convertUboToAdg: convertUboScriptletToAdg,\n convertAbpToAdg: convertAbpSnippetToAdg,\n convertScriptletToAdg,\n convertAdgToUbo: convertAdgScriptletToUbo,\n redirects: redirectsCjs,\n}))();\n\nexport default scriptletsObject;\n","import scriptletsObject from './index';\n\n/**\n * Expose scriptlets to global\n */\n// eslint-disable-next-line no-undef\nscriptlets = scriptletsObject;\n"],"names":["randomId","Math","random","toString","substr","setPropertyAccess","object","property","descriptor","currentDescriptor","Object","getOwnPropertyDescriptor","configurable","defineProperty","getPropertyInChain","base","chain","addProp","pos","indexOf","prop","slice","own","undefined","escapeRegExp","str","replace","toRegExp","length","RegExp","escaped","getBeforeRegExp","rx","index","search","substring","startsWith","prefix","endsWith","substringAfter","separator","substringBefore","wrapInSingleQuotes","getStringInBraces","firstIndex","lastIndex","lastIndexOf","createOnErrorHandler","rid","nativeOnError","window","onerror","onError","error","Function","args","apply","noopFunc","noopNull","trueFunc","falseFunc","noopThis","noopArray","noopStr","hit","source","message","verbose","log","console","bind","trace","ruleText","LOG_MARKER","e","__debug","observeDOMChanges","callback","observeAttrs","attrsToObserv","throttle","method","delay","wait","savedArgs","wrapper","setTimeout","THROTTLE_DELAY_MS","observer","MutationObserver","callbackWrapper","connect","observe","document","documentElement","childList","subtree","attributes","attributeFilter","disconnect","attachDependencies","scriptlet","injections","reduce","accum","dep","dependencies","name","addCall","code","passSourceAndProps","sourceString","JSON","stringify","argsString","map","params","wrapInNonameFunc","iterateWithTransitions","iterable","transitions","init","state","keys","i","ADG_SCRIPTLET_MASK","wordSaver","strs","saveSymb","s","saveStr","push","getAll","parseRule","TRANSITION","OPENED","PARAM","CLOSED","opened","rule","sep","char","transition","symb","Error","param","saver","preIndex","before","abortOnPropertyRead","abort","ReferenceError","setChainPropAccess","owner","chainInfo","setter","a","get","set","names","abortOnPropertyWrite","preventSetTimeout","match","nativeTimeout","nativeIsNaN","Number","isNaN","shouldLog","INVERT_MARKER","isNotMatch","isNotDelay","parseInt","timeoutWrapper","timeout","shouldPrevent","test","preventSetInterval","nativeInterval","setInterval","intervalWrapper","interval","preventWindowOpen","replacement","nativeOpen","open","openWrapper","result","isProp","propertyPart","propertyName","propertyValue","resObj","abortCurrentInlineScript","regex","getCurrentScript","currentScript","scripts","getElementsByTagName","ourScript","scriptEl","content","textContent","textContentGetter","Node","prototype","call","HTMLScriptElement","props","split","propIndex","baseName","currentValue","value","setConstant","constantValue","parseFloat","abs","canceled","mustCancel","removeCookie","removeCookieFromHost","cookieName","hostName","cookieSpec","domain1","domain2","path","expiration","cookie","rmCookie","forEach","cookieStr","trim","hostParts","location","hostname","join","addEventListener","preventAddEventListener","eventSearch","funcSearch","nativeAddEventListener","EventTarget","addEventListenerWrapper","eventName","funcToCheck","preventBab","nativeSetTimeout","babRegex","signatures","check","tokens","j","token","found","nativeEval","eval","bodyEl","body","style","removeProperty","el","getElementById","parentNode","removeChild","nowebrtc","RTCPeerConnection","webkitRTCPeerConnection","rtcReplacement","config","close","createDataChannel","createOffer","setRemoteDescription","rtc","b","send","logAddEventListener","callbackToLog","logEval","evalWrapper","nativeFunction","FunctionWrapper","create","constructor","noeval","preventEvalIf","payload","preventFab","Fab","clearEvent","emitEvent","on","onDetected","onNotDetected","setOption","FuckAdBlock","BlockAdBlock","fuckAdBlock","blockAdBlock","setPopadsDummy","PopAds","popns","defineProperties","preventPopadsNet","throwError","preventAdfly","isDigit","data","handler","encodedURL","evenChars","oddChars","charAt","ii","temp","decodedURL","atob","stop","onbeforeunload","href","val","applyHandler","err","debugOnPropertyRead","debugOnPropertyWrite","debugCurrentInlineScript","removeAttr","attrs","selector","rmattr","nodes","querySelectorAll","removed","node","attr","removeAttribute","removeClass","classNames","selectors","className","removeClassHandler","Set","foundedNodes","n","add","elements","element","classList","contains","remove","CLASS_ATTR_NAME","disableNewtabLinks","ev","target","localName","hasAttribute","stopPropagation","preventDefault","adjustSetInterval","boost","nativeIsFinite","isFinite","cb","d","adjustSetTimeout","dirString","times","dir","dirWrapper","jsonPrune","propsToRemove","requiredInitialProps","prunePaths","needlePaths","isPruningNeeded","root","needlePath","details","nestedPropName","pop","nativeParse","parse","parseWrapper","r","ownerObj","preventRequestAnimationFrame","nativeRequestAnimationFrame","requestAnimationFrame","doNotMatch","rafWrapper","logMessage","JS_RULE_MASK","COMMENT_MARKER","isComment","UBO_SCRIPTLET_MASK_REG","UBO_SCRIPTLET_MASK_1","UBO_SCRIPTLET_MASK_2","UBO_SCRIPTLET_EXCEPTION_MASK_1","UBO_SCRIPTLET_EXCEPTION_MASK_2","ABP_SCRIPTLET_MASK","ABP_SCRIPTLET_EXCEPTION_MASK","ADG_CSS_MASK_REG","isAdgScriptletRule","isUboScriptletRule","isAbpSnippetRule","getScriptletByName","scriptlets","scriptletsList","key","find","isValidScriptletName","ADG_UBO_REDIRECT_MARKER","ABP_REDIRECT_MARKER","VALID_SOURCE_TYPES","validAdgRedirects","redirects","filter","adg","objFromEntries","pairs","output","acc","uboToAdgCompatibility","ubo","abpToAdgCompatibility","abp","adgToUboCompatibility","validAdgCompatibility","REDIRECT_RULE_TYPES","VALID_ADG","marker","compatibility","ADG","UBO","ABP","parseModifiers","getRedirectName","ruleModifiers","redirectNamePart","isAdgRedirectRule","isRedirectRuleByType","type","redirectName","isValidAdgRedirectRule","isAdgRedirectCompatibleWithUbo","isUboRedirectCompatibleWithAdg","isAbpRedirectCompatibleWithAdg","hasValidContentType","sourceType","validator","ADGUARD_SCRIPTLET_MASK_REG","ADGUARD_SCRIPTLET_TEMPLATE","ADGUARD_SCRIPTLET_EXCEPTION_TEMPLATE","UBO_SCRIPTLET_TEMPLATE","UBO_SCRIPTLET_EXCEPTION_TEMPLATE","UBO_ALIAS_NAME_MARKER","UBO_XHR_TYPE","ADG_XHR_TYPE","getSentences","reg","replacePlaceholders","convertUboScriptletToAdg","domains","mask","template","arg","outputArg","adgRule","convertAbpSnippetToAdg","SEMICOLON_DIVIDER","convertScriptletToAdg","convertAdgScriptletToUbo","res","parsedName","parsedParams","adgScriptletObject","scriptletList","aliases","uboAlias","alias","includes","uboName","uboRule","isValidScriptletRule","input","rulesArray","isValid","parsedRule","convertUboRedirectToAdg","firstPartOfRule","uboModifiers","adgModifiers","adgName","convertAbpRedirectToAdg","abpModifiers","abpName","convertRedirectToAdg","convertAdgRedirectToUbo","GoogleAnalytics","Tracker","proto","googleAnalyticsName","GoogleAnalyticsObject","ga","len","arguments","lastArg","hitCallback","ex","getByName","loaded","dataLayer","hide","end","GoogleAnalyticsGa","Gaq","Na","O","Sa","Ta","Va","_createAsyncTracker","_getAsyncTracker","_getPlugin","Array","isArray","assign","gaq","asyncTrackers","_gaq","shift","qf","Gat","api","tracker","funcName","_getLinkerUrl","_anonymizeIP","_createTracker","_forceSSL","_getTracker","_getTrackerByName","_getTrackers","aa","ab","hb","la","oa","pa","u","gat","_gat","GoogleSyndicationAdsByGoogle","adsbygoogle","adElems","css","executed","setAttribute","aswiftIframe","createElement","id","appendChild","googleadsIframe","GoogleTagManagerGtm","eventCallback","GoogleTagServicesGpt","companionAdsService","enableSyncLoading","setRefreshUnfilledSlots","contentService","setContent","PassbackSlot","display","setClickUrl","setTagForChildDirectedTreatment","setTargeting","updateTargetingFromMap","SizeMappingBuilder","addSize","build","Slot","addService","clearCategoryExclusions","clearTargeting","defineSizeMapping","getAdUnitPath","getAttributeKeys","getCategoryExclusions","getDomId","getSlotElementId","getSlotId","getTargeting","getTargetingKeys","setCategoryExclusion","setCollapseEmptyDiv","pubAdsService","clear","clearTagForChildDirectedTreatment","collapseEmptyDivs","defineOutOfPagePassback","definePassback","disableInitialLoad","enableAsyncRendering","enableSingleRequest","enableSyncRendering","enableVideoAds","getSlots","refresh","setCentering","setCookieOptions","setForceSafeFrame","setLocation","setPublisherProvidedId","setRequestNonPersonalizedAds","setSafeFrameConfig","setVideoContent","updateCorrelator","googletag","cmd","apiReady","companionAds","defineOutOfPageSlot","defineSlot","destroySlots","disablePublisherConsole","enableServices","getVersion","pubads","pubadsReady","setAdIframeTitle","sizeMapping","ScoreCardResearchBeacon","COMSCORE","purge","_comscore","beacon","metrikaYandexTag","asyncCallbackFromOptions","options","ctx","addFileExtension","extLink","file","getClientID","hitFunc","notBounce","reachGoal","setUserID","userParams","ym","metrikaYandexWatch","cbName","Metrika","url","Ya","func","getRedirectByName","redirectsList","getRedirectCode","redirect","engine","redirectsCjs","getCode","getScriptletCode","scriptletsObject","invoke","convertUboToAdg","convertAbpToAdg","convertAdgToUbo"],"mappings":";;;;;;;IACA;;;IAGO,SAASA,QAAT,GAAoB;IACvB,SAAOC,IAAI,CAACC,MAAL,GAAcC,QAAd,CAAuB,EAAvB,EAA2BC,MAA3B,CAAkC,CAAlC,EAAqC,CAArC,CAAP;IACH;;ICND;;;;;;;AAOA,IAAO,SAASC,iBAAT,CAA2BC,MAA3B,EAAmCC,QAAnC,EAA6CC,UAA7C,EAAyD;IAC5D,MAAMC,iBAAiB,GAAGC,MAAM,CAACC,wBAAP,CAAgCL,MAAhC,EAAwCC,QAAxC,CAA1B;;IACA,MAAIE,iBAAiB,IAAI,CAACA,iBAAiB,CAACG,YAA5C,EAA0D;IACtD,WAAO,KAAP;IACH;;IACDF,EAAAA,MAAM,CAACG,cAAP,CAAsBP,MAAtB,EAA8BC,QAA9B,EAAwCC,UAAxC;IACA,SAAO,IAAP;IACH;;ICdD;;;;;;;IAOA;;;;;;;;;;;;;AAaA,IAAO,SAASM,kBAAT,CAA4BC,IAA5B,EAAkCC,KAAlC,EAAyD;IAAA,MAAhBC,OAAgB,uEAAN,IAAM;IAC5D,MAAMC,GAAG,GAAGF,KAAK,CAACG,OAAN,CAAc,GAAd,CAAZ;;IACA,MAAID,GAAG,KAAK,CAAC,CAAb,EAAgB;IACZ,WAAO;IAAEH,MAAAA,IAAI,EAAJA,IAAF;IAAQK,MAAAA,IAAI,EAAEJ;IAAd,KAAP;IACH;;IACD,MAAMI,IAAI,GAAGJ,KAAK,CAACK,KAAN,CAAY,CAAZ,EAAeH,GAAf,CAAb;IACA,MAAMI,GAAG,GAAGP,IAAI,CAACK,IAAD,CAAhB;IACAJ,EAAAA,KAAK,GAAGA,KAAK,CAACK,KAAN,CAAYH,GAAG,GAAG,CAAlB,CAAR;;IACA,MAAII,GAAG,KAAKC,SAAZ,EAAuB;IACnB,WAAOT,kBAAkB,CAACQ,GA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A,MAAM,EAAEF,gBADqB;IAE7B7P,IAAAA,oBAAoB,EAAEuC,SAAS,CAACvC,oBAFH;IAG7ByE,IAAAA,oBAAoB,EAApBA,oBAH6B;IAI7BjF,IAAAA,kBAAkB,EAAE+C,SAAS,CAAC/C,kBAJD;IAK7BC,IAAAA,kBAAkB,EAAE8C,SAAS,CAAC9C,kBALD;IAM7BC,IAAAA,gBAAgB,EAAE6C,SAAS,CAAC7C,gBANC;IAO7BsQ,IAAAA,eAAe,EAAE7M,wBAPY;IAQ7B8M,IAAAA,eAAe,EAAEvM,sBARY;IAS7BE,IAAAA,qBAAqB,EAArBA,qBAT6B;IAU7BsM,IAAAA,eAAe,EAAErM,wBAVY;IAW7BxD,IAAAA,SAAS,EAAEsP;IAXkB,GAAP;IAAA,CAAD,EAAzB;;ICvDA;;;IAGA;;IACA/P,UAAU,GAAGkQ,gBAAb;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/src/redirects/index.js b/src/redirects/index.js index ecbd3272..41241871 100644 --- a/src/redirects/index.js +++ b/src/redirects/index.js @@ -37,6 +37,7 @@ const getRedirectByName = (name) => { /** * Returns redirect code by param * @param {Source} source + * @returns {string} redirect code */ const getRedirectCode = (source) => { const redirect = getRedirectByName(source.name); diff --git a/src/scriptlets/index.js b/src/scriptlets/index.js index 5992550e..d1f9ccb9 100644 --- a/src/scriptlets/index.js +++ b/src/scriptlets/index.js @@ -30,9 +30,10 @@ import { */ /** -* Returns scriptlet code by param -* @param {Source} source -*/ + * Returns scriptlet code by param + * @param {Source} source + * @returns {string} scriptlet code + */ function getScriptletCode(source) { if (!validator.isValidScriptletName(source.name)) { return null; diff --git a/src/scriptlets/remove-class.js b/src/scriptlets/remove-class.js index 0489e000..3ba35f5f 100644 --- a/src/scriptlets/remove-class.js +++ b/src/scriptlets/remove-class.js @@ -109,6 +109,10 @@ export function removeClass(source, classNames, selector) { removeClass.names = [ 'remove-class', + 'remove-class.js', + 'ubo-remove-class.js', + 'rc.js', + 'ubo-rc.js', ]; removeClass.injections = [hit, observeDOMChanges]; diff --git a/tests/redirects/google-analytics-ga.test.js b/tests/redirects/google-analytics-ga.test.js index 7c6ecbbb..dfb0b4eb 100644 --- a/tests/redirects/google-analytics-ga.test.js +++ b/tests/redirects/google-analytics-ga.test.js @@ -8,110 +8,22 @@ module(name); const evalWrapper = eval; -test('UBO alias _gat', (assert) => { - const params = { - name: 'ubo-google-analytics_ga.js', +test('Checking if alias name works', (assert) => { + const adgParams = { + name, + engine: 'test', verbose: true, }; - window.__debug = () => { window.hit = 'FIRED'; }; - - // run scriptlet - const resString = window.scriptlets.redirects.getCode(params); - evalWrapper(resString); - - assert.ok(window._gat, '_gat object was created'); - assert.notOk(window._gat._createTracker(), '_createTracker returns nothing'); - - const tracker = window._gat._getTracker(); - assert.ok(typeof tracker === 'object', '_getTracker returns tracker object'); - assert.notOk(tracker._addIgnoredOrganic(), 'checks _addIgnoredOrganic tracker method'); - assert.notOk(tracker._setCookiePersistence(), 'checks _setCookiePersistence tracker method'); - - // hit checking - assert.strictEqual(window.hit, 'FIRED', 'hit function was executed'); - - clearGlobalProps('__debug', 'hit', '_gat'); -}); - -test('UBO alias _gaq', (assert) => { - const params = { + const uboParams = { name: 'ubo-google-analytics_ga.js', + engine: 'test', verbose: true, }; - window.__debug = () => { window.hit = 'FIRED'; }; - - // run scriptlet - const resString = window.scriptlets.redirects.getCode(params); - evalWrapper(resString); - - assert.expect(6); - - assert.ok(window._gaq, '_gaq object was created'); - assert.notOk(window._gaq._createAsyncTracker(), '_createAsyncTracker returns nothing'); - window._gaq.push(() => assert.ok(true, 'push with cb runs it')); - assert.notOk(window._gaq.push([]), 'push with array returns nothing'); - - // https://github.com/gorhill/uBlock/issues/2162 - const cb = () => assert.ok(true, 'hitCallback was executed'); - window._gaq.push(['_set', 'hitCallback', cb]); - - // hit checking - assert.strictEqual(window.hit, 'FIRED', 'hit function was executed'); - - clearGlobalProps('__debug', 'hit', '_gaq'); -}); - -test('UBO Syntax _gat', (assert) => { - const params = { - name: 'google-analytics_ga.js', - verbose: true, - }; - window.__debug = () => { window.hit = 'FIRED'; }; - - // run scriptlet - const resString = window.scriptlets.redirects.getCode(params); - evalWrapper(resString); - - assert.ok(window._gat, '_gat object was created'); - assert.notOk(window._gat._createTracker(), '_createTracker returns nothing'); - - const tracker = window._gat._getTracker(); - assert.ok(typeof tracker === 'object', '_getTracker returns tracker object'); - assert.notOk(tracker._addIgnoredOrganic(), 'checks _addIgnoredOrganic tracker method'); - assert.notOk(tracker._setCookiePersistence(), 'checks _setCookiePersistence tracker method'); - - // hit checking - assert.strictEqual(window.hit, 'FIRED', 'hit function was executed'); - - clearGlobalProps('__debug', 'hit', '_gat'); -}); - -test('UBO Syntax _gaq', (assert) => { - const params = { - name: 'google-analytics_ga.js', - verbose: true, - }; - window.__debug = () => { window.hit = 'FIRED'; }; - - // run scriptlet - const resString = window.scriptlets.redirects.getCode(params); - evalWrapper(resString); - assert.expect(6); + const codeByAdgParams = window.scriptlets.redirects.getCode(adgParams); + const codeByUboParams = window.scriptlets.redirects.getCode(uboParams); - assert.ok(window._gaq, '_gaq object was created'); - assert.notOk(window._gaq._createAsyncTracker(), '_createAsyncTracker returns nothing'); - window._gaq.push(() => assert.ok(true, 'push with cb runs it')); - assert.notOk(window._gaq.push([]), 'push with array returns nothing'); - - // https://github.com/gorhill/uBlock/issues/2162 - const cb = () => assert.ok(true, 'hitCallback was executed'); - window._gaq.push(['_set', 'hitCallback', cb]); - - // hit checking - assert.strictEqual(window.hit, 'FIRED', 'hit function was executed'); - - clearGlobalProps('__debug', 'hit', '_gaq'); + assert.strictEqual(codeByAdgParams, codeByUboParams, 'ubo name - ok'); }); test('AdGuard Syntax _gat', (assert) => { diff --git a/tests/redirects/google-analytics.test.js b/tests/redirects/google-analytics.test.js index 47b33f24..0161f921 100644 --- a/tests/redirects/google-analytics.test.js +++ b/tests/redirects/google-analytics.test.js @@ -20,62 +20,22 @@ const mockGoogleDataLayer = (endCallback) => { return window.dataLayer; }; -test('UBO alias', (assert) => { - const params = { - name: 'ubo-google-analytics_analytics.js', +test('Checking if alias name works', (assert) => { + const adgParams = { + name, + engine: 'test', verbose: true, }; - window.__debug = () => { window.hit = 'FIRED'; }; - - const endCallback = () => { - assert.ok(true, 'hide.end() was executed'); - }; - // emulate DataLayer - mockGoogleDataLayer(endCallback); - - // run scriptlet - const resString = window.scriptlets.redirects.getCode(params); - evalWrapper(resString); - - // check ga api - assert.ok(window.ga, 'ga object was created'); - assert.ok(window.ga.create(), 'Tracker was created'); - assert.notOk(window.ga.getByName(), 'getByName returns null'); - assert.strictEqual(window.ga.getAll().length, 0, 'getAll returns empty array'); - assert.notOk(window.ga.remove(), 'remove returns undefined'); - assert.strictEqual(window.ga.loaded, true, 'loaded returns true'); - assert.strictEqual(window.hit, 'FIRED', 'hit function was executed'); - - clearGlobalProps('__debug', 'hit', 'dataLayer', 'ga'); -}); - -test('UBO Syntax', (assert) => { - const params = { - name: 'google-analytics_analytics.js', + const uboParams = { + name: 'ubo-google-analytics_analytics.js', + engine: 'test', verbose: true, }; - window.__debug = () => { window.hit = 'FIRED'; }; - - const endCallback = () => { - assert.ok(true, 'hide.end() was executed'); - }; - // emulate DataLayer - mockGoogleDataLayer(endCallback); - - // run scriptlet - const resString = window.scriptlets.redirects.getCode(params); - evalWrapper(resString); - // check ga api - assert.ok(window.ga, 'ga object was created'); - assert.ok(window.ga.create(), 'Tracker was created'); - assert.notOk(window.ga.getByName(), 'getByName returns null'); - assert.strictEqual(window.ga.getAll().length, 0, 'getAll returns empty array'); - assert.notOk(window.ga.remove(), 'remove returns undefined'); - assert.strictEqual(window.ga.loaded, true, 'loaded returns true'); - assert.strictEqual(window.hit, 'FIRED', 'hit function was executed'); + const codeByAdgParams = window.scriptlets.redirects.getCode(adgParams); + const codeByUboParams = window.scriptlets.redirects.getCode(uboParams); - clearGlobalProps('__debug', 'hit', 'dataLayer', 'ga'); + assert.strictEqual(codeByAdgParams, codeByUboParams, 'ubo name - ok'); }); test('AdGuard Syntax', (assert) => { diff --git a/tests/redirects/googlesyndication-adsbygoogle.test.js b/tests/redirects/googlesyndication-adsbygoogle.test.js index 2491e1a8..1bbb72c9 100644 --- a/tests/redirects/googlesyndication-adsbygoogle.test.js +++ b/tests/redirects/googlesyndication-adsbygoogle.test.js @@ -35,7 +35,7 @@ test('Checking if alias name works', (assert) => { const codeByAdgParams = window.scriptlets.redirects.getCode(adgParams); const codeByUboParams = window.scriptlets.redirects.getCode(uboParams); - assert.strictEqual(codeByAdgParams.toString(), codeByUboParams.toString()); + assert.strictEqual(codeByAdgParams, codeByUboParams); }); test('Redirect testing', (assert) => { diff --git a/tests/redirects/googletagmanager-gtm.test.js b/tests/redirects/googletagmanager-gtm.test.js index af1461f7..7c60c397 100644 --- a/tests/redirects/googletagmanager-gtm.test.js +++ b/tests/redirects/googletagmanager-gtm.test.js @@ -21,68 +21,22 @@ const mockGoogleTagManagerApi = (endCallback) => { return window.dataLayer; }; -test('UBO alias', (assert) => { - const params = { - name: 'ubo-googletagmanager_gtm.js', +test('Checking if alias name works', (assert) => { + const adgParams = { + name, + engine: 'test', verbose: true, }; - window.__debug = () => { window.hit = 'FIRED'; }; - - assert.expect(3); - - const endCallback = () => { - assert.ok(true, 'hide.end() was executed'); - }; - // emulate API - const dataLayer = mockGoogleTagManagerApi(endCallback); - - // run scriptlet - const resString = window.scriptlets.redirects.getCode(params); - evalWrapper(resString); - - const done = assert.async(); - dataLayer.push({ - eventCallback() { - assert.ok(true, 'Event callback was executed'); - done(); - }, - }); - - assert.strictEqual(window.hit, 'FIRED', 'hit function was executed'); - - clearGlobalProps('__debug', 'hit'); -}); - -test('UBO Syntax', (assert) => { - const params = { - name: 'googletagmanager_gtm.js', + const uboParams = { + name: 'ubo-googletagmanager_gtm.js', + engine: 'test', verbose: true, }; - window.__debug = () => { window.hit = 'FIRED'; }; - - assert.expect(3); - const endCallback = () => { - assert.ok(true, 'hide.end() was executed'); - }; - // emulate API - const dataLayer = mockGoogleTagManagerApi(endCallback); + const codeByAdgParams = window.scriptlets.redirects.getCode(adgParams); + const codeByUboParams = window.scriptlets.redirects.getCode(uboParams); - // run scriptlet - const resString = window.scriptlets.redirects.getCode(params); - evalWrapper(resString); - - const done = assert.async(); - dataLayer.push({ - eventCallback() { - assert.ok(true, 'Event callback was executed'); - done(); - }, - }); - - assert.strictEqual(window.hit, 'FIRED', 'hit function was executed'); - - clearGlobalProps('__debug', 'hit'); + assert.strictEqual(codeByAdgParams, codeByUboParams, 'ubo name - ok'); }); test('AdGuard Syntax', (assert) => { diff --git a/tests/redirects/googletagservices-gpt.test.js b/tests/redirects/googletagservices-gpt.test.js index 1cbe16d1..899d0183 100644 --- a/tests/redirects/googletagservices-gpt.test.js +++ b/tests/redirects/googletagservices-gpt.test.js @@ -19,44 +19,22 @@ const contentService = { setContent: null, }; -test('UBO alias', (assert) => { - const params = { - name: 'ubo-googletagservices_gpt.js', +test('Checking if alias name works', (assert) => { + const adgParams = { + name, + engine: 'test', verbose: true, }; - window.__debug = () => { window.hit = 'FIRED'; }; - - // run scriptlet - const resString = window.scriptlets.redirects.getCode(params); - evalWrapper(resString); - - assert.ok(window.googletag, 'window.googletag have been created'); - assert.equal(window.googletag.apiReady, true, 'apiReady'); - assert.notDeepEqual(window.googletag.companionAds(), companionAdsService, 'companionAds() returns the mocked data'); - assert.notDeepEqual(window.googletag.content(), contentService, 'content() returns the mocked data'); - - assert.strictEqual(window.hit, 'FIRED', 'hit function was executed'); - clearGlobalProps('__debug', 'hit'); -}); - -test('UBO Syntax', (assert) => { - const params = { - name: 'googletagservices_gpt.js', + const uboParams = { + name: 'ubo-googletagservices_gpt.js', + engine: 'test', verbose: true, }; - window.__debug = () => { window.hit = 'FIRED'; }; - // run scriptlet - const resString = window.scriptlets.redirects.getCode(params); - evalWrapper(resString); + const codeByAdgParams = window.scriptlets.redirects.getCode(adgParams); + const codeByUboParams = window.scriptlets.redirects.getCode(uboParams); - assert.ok(window.googletag, 'window.googletag have been created'); - assert.equal(window.googletag.apiReady, true, 'apiReady'); - assert.notDeepEqual(window.googletag.companionAds(), companionAdsService, 'companionAds() returns the mocked data'); - assert.notDeepEqual(window.googletag.content(), contentService, 'content() returns the mocked data'); - - assert.strictEqual(window.hit, 'FIRED', 'hit function was executed'); - clearGlobalProps('__debug', 'hit'); + assert.strictEqual(codeByAdgParams, codeByUboParams, 'ubo name - ok'); }); test('AdGuard Syntax', (assert) => { diff --git a/tests/redirects/noeval.test.js b/tests/redirects/noeval.test.js index 7be08a0f..11b38a8d 100644 --- a/tests/redirects/noeval.test.js +++ b/tests/redirects/noeval.test.js @@ -30,49 +30,24 @@ const runScriptlet = (name) => { nativeEval(resultString); }; -test('ubo noeval alias', (assert) => { - runScriptlet('ubo-noeval.js'); - - const evalStr = '2'; - - console.log = function log(input) { - nativeConsole(input); - if (input.indexOf('trace') > -1) { - return; - } - assert.ok(input.includes('AdGuard has prevented eval:'), 'console.hit should print info'); +test('Checking if alias name works', (assert) => { + const adgParams = { + name, + engine: 'test', + verbose: true, }; - - const evalWrapper = eval; - const actual = evalWrapper(evalStr); - - assert.strictEqual(window.hit, 'FIRED', 'hit function should fire'); - assert.strictEqual(actual, undefined, 'result of eval evaluation should be undefined'); -}); - -test('ubo silent-noeval alias', (assert) => { - runScriptlet('ubo-silent-noeval.js'); - - const evalStr = '2'; - - // set assertions amount - assert.expect(3); - - console.log = function log(input) { - if (input.indexOf('trace') > -1) { - return; - } - assert.ok(input.includes('AdGuard has prevented eval:'), 'console.hit should print info'); + const uboParams = { + name: 'ubo-silent-noeval.js', + engine: 'test', + verbose: true, }; - const evalWrapper = eval; - const actual = evalWrapper(evalStr); + const codeByAdgParams = window.scriptlets.redirects.getCode(adgParams); + const codeByUboParams = window.scriptlets.redirects.getCode(uboParams); - assert.strictEqual(window.hit, 'FIRED', 'hit function should fire'); - assert.strictEqual(actual, undefined, 'result of eval evaluation should be undefined'); + assert.strictEqual(codeByAdgParams, codeByUboParams, 'ubo name - ok'); }); - test('AG noeval alias', (assert) => { runScriptlet(name); diff --git a/tests/redirects/scorecardresearch-beacon.test.js b/tests/redirects/scorecardresearch-beacon.test.js index 9c8012c6..f8a6f3f9 100644 --- a/tests/redirects/scorecardresearch-beacon.test.js +++ b/tests/redirects/scorecardresearch-beacon.test.js @@ -8,44 +8,22 @@ module(name); const evalWrapper = eval; -test('UBO alias', (assert) => { - const params = { - name: 'ubo-scorecardresearch_beacon.js', +test('Checking if alias name works', (assert) => { + const adgParams = { + name, + engine: 'test', verbose: true, }; - window.__debug = () => { window.hit = 'FIRED'; }; - - // run scriptlet - const resString = window.scriptlets.redirects.getCode(params); - evalWrapper(resString); - - assert.strictEqual(window.hit, 'FIRED', 'hit function was executed'); - assert.ok(window.COMSCORE, 'COMSCORE object was created'); - window.COMSCORE.purge(); - assert.strictEqual(window._comscore.length, 0, 'purge function reset _compscore var to []'); - assert.notOk(window.COMSCORE.beacon(), 'becacon function was mocked'); - - clearGlobalProps('__debug', 'hit', 'COMSCORE', '_comscore'); -}); - -test('UBO Syntax', (assert) => { - const params = { - name: 'scorecardresearch_beacon.js', + const uboParams = { + name: 'ubo-scorecardresearch_beacon.js', + engine: 'test', verbose: true, }; - window.__debug = () => { window.hit = 'FIRED'; }; - // run scriptlet - const resString = window.scriptlets.redirects.getCode(params); - evalWrapper(resString); + const codeByAdgParams = window.scriptlets.redirects.getCode(adgParams); + const codeByUboParams = window.scriptlets.redirects.getCode(uboParams); - assert.strictEqual(window.hit, 'FIRED', 'hit function was executed'); - assert.ok(window.COMSCORE, 'COMSCORE object was created'); - window.COMSCORE.purge(); - assert.strictEqual(window._comscore.length, 0, 'purge function reset _compscore var to []'); - assert.notOk(window.COMSCORE.beacon(), 'becacon function was mocked'); - - clearGlobalProps('__debug', 'hit', 'COMSCORE', '_comscore'); + assert.strictEqual(codeByAdgParams, codeByUboParams, 'ubo name - ok'); }); test('AdGuard Syntax', (assert) => { diff --git a/tests/scriptlets/abort-current-inline-script.test.js b/tests/scriptlets/abort-current-inline-script.test.js index ea5ac5c2..89ac8a5d 100644 --- a/tests/scriptlets/abort-current-inline-script.test.js +++ b/tests/scriptlets/abort-current-inline-script.test.js @@ -26,47 +26,29 @@ const addAndRemoveInlineScript = (scriptText) => { scriptElement.parentNode.removeChild(scriptElement); }; -test('ubo alias', (assert) => { - const property = '___aaa'; - const params = { - name: 'ubo-abort-current-inline-script.js', - args: [property], +test('Checking if alias name works', (assert) => { + const adgParams = { + name, + engine: 'test', verbose: true, }; - window.__debug = () => { - window.hit = 'FIRED'; + const uboParams = { + name: 'ubo-abort-current-inline-script.js', + engine: 'test', + verbose: true, }; - const resString = window.scriptlets.invoke(params); - - window.onerror = onError(assert); - - evalWrapper(resString); - addAndRemoveInlineScript('window.___aaa;'); - - assert.strictEqual(window.hit, 'FIRED'); - - clearGlobalProps(...changingGlobals); -}); - -test('abp alias', (assert) => { - const property = '___aaa'; - const params = { + const abpParams = { name: 'abp-abort-current-inline-script', - args: [property], + engine: 'test', verbose: true, }; - window.__debug = () => { - window.hit = 'FIRED'; - }; - const resString = window.scriptlets.invoke(params); - - window.onerror = onError(assert); - evalWrapper(resString); - addAndRemoveInlineScript('window.___aaa;'); + const codeByAdgParams = window.scriptlets.invoke(adgParams); + const codeByUboParams = window.scriptlets.invoke(uboParams); + const codeByAbpParams = window.scriptlets.invoke(abpParams); - assert.strictEqual(window.hit, 'FIRED'); - clearGlobalProps(...changingGlobals); + assert.strictEqual(codeByAdgParams, codeByUboParams, 'ubo name - ok'); + assert.strictEqual(codeByAdgParams, codeByAbpParams, 'abp name - ok'); }); test('works', (assert) => { diff --git a/tests/scriptlets/abort-on-property-read.test.js b/tests/scriptlets/abort-on-property-read.test.js index 1632f451..4e4e99ac 100644 --- a/tests/scriptlets/abort-on-property-read.test.js +++ b/tests/scriptlets/abort-on-property-read.test.js @@ -23,39 +23,29 @@ const afterEach = () => { module(name, { beforeEach, afterEach }); -test('abort-on-property-read simple check ubo alias', (assert) => { - const params = { - name: `ubo-${name}.js`, - args: [PROPERTY], +test('Checking if alias name works', (assert) => { + const adgParams = { + name, + engine: 'test', verbose: true, }; - - window[PROPERTY] = 'value'; - const resString = window.scriptlets.invoke(params); - evalWrap(resString); - assert.throws( - () => window[PROPERTY], - /ReferenceError/, - `should throw Reference error when try to access property ${PROPERTY}`, - ); - assert.equal(window.hit, 'value', 'Hit function was executed'); -}); - -test('abort-on-property-read simple check abp alias', (assert) => { - const params = { - name: `abp-${name}`, - args: [PROPERTY], + const uboParams = { + name: 'ubo-abort-on-property-read.js', + engine: 'test', verbose: true, }; - window[PROPERTY] = 'value'; - const resString = window.scriptlets.invoke(params); - evalWrap(resString); - assert.throws( - () => window[PROPERTY], - /ReferenceError/, - `should throw Reference error when try to access property ${PROPERTY}`, - ); - assert.equal(window.hit, 'value', 'Hit function was executed'); + const abpParams = { + name: 'abp-abort-on-property-read', + engine: 'test', + verbose: true, + }; + + const codeByAdgParams = window.scriptlets.invoke(adgParams); + const codeByUboParams = window.scriptlets.invoke(uboParams); + const codeByAbpParams = window.scriptlets.invoke(abpParams); + + assert.strictEqual(codeByAdgParams, codeByUboParams, 'ubo name - ok'); + assert.strictEqual(codeByAdgParams, codeByAbpParams, 'abp name - ok'); }); test('abort-on-property-read simple', (assert) => { diff --git a/tests/scriptlets/abort-on-property-write.test.js b/tests/scriptlets/abort-on-property-write.test.js index 3c65cab6..9e674fd5 100644 --- a/tests/scriptlets/abort-on-property-write.test.js +++ b/tests/scriptlets/abort-on-property-write.test.js @@ -12,50 +12,29 @@ const evalWrap = eval; const changingProps = [PROPERTY, 'hit', '__debug']; module(name); -test('abort-on-property-write: ubo alias, set prop for existed prop', (assert) => { - const params = { - name: `ubo-${name}.js`, - args: [PROPERTY], +test('Checking if alias name works', (assert) => { + const adgParams = { + name, + engine: 'test', verbose: true, }; - window.__debug = () => { - window.hit = 'value'; - }; - window[PROPERTY] = 'value'; - const resString = window.scriptlets.invoke(params); - evalWrap(resString); - assert.throws( - () => { - window[PROPERTY] = 'new value'; - }, - /ReferenceError/, - `should throw Reference error when try to write property ${PROPERTY}`, - ); - assert.equal(window.hit, 'value', 'Hit function was executed'); - clearGlobalProps(...changingProps); -}); - -test('abort-on-property-write: abp alias, set prop for existed prop', (assert) => { - const params = { - name: `abp-${name}`, - args: [PROPERTY], + const uboParams = { + name: 'ubo-abort-on-property-write.js', + engine: 'test', verbose: true, }; - window.__debug = () => { - window.hit = 'value'; + const abpParams = { + name: 'abp-abort-on-property-write', + engine: 'test', + verbose: true, }; - window[PROPERTY] = 'value'; - const resString = window.scriptlets.invoke(params); - evalWrap(resString); - assert.throws( - () => { - window[PROPERTY] = 'new value'; - }, - /ReferenceError/, - `should throw Reference error when try to write property ${PROPERTY}`, - ); - assert.equal(window.hit, 'value', 'Hit function was executed'); - clearGlobalProps(...changingProps); + + const codeByAdgParams = window.scriptlets.invoke(adgParams); + const codeByUboParams = window.scriptlets.invoke(uboParams); + const codeByAbpParams = window.scriptlets.invoke(abpParams); + + assert.strictEqual(codeByAdgParams, codeByUboParams, 'ubo name - ok'); + assert.strictEqual(codeByAdgParams, codeByAbpParams, 'abp name - ok'); }); test('abort-on-property-write: adg alias, set prop for existed prop', (assert) => { diff --git a/tests/scriptlets/adjust-setInterval.test.js b/tests/scriptlets/adjust-setInterval.test.js index 928421a7..00ef57c9 100644 --- a/tests/scriptlets/adjust-setInterval.test.js +++ b/tests/scriptlets/adjust-setInterval.test.js @@ -20,35 +20,22 @@ const createHit = () => { const evalWrapper = eval; -test('ubo alias', (assert) => { - createHit(); - const params = { +test('Checking if alias name works', (assert) => { + const adgParams = { + name, + engine: 'test', + verbose: true, + }; + const uboParams = { name: 'ubo-nano-setInterval-booster.js', - args: ['intervalValue', '100', '2'], + engine: 'test', verbose: true, }; - const resString = window.scriptlets.invoke(params); - evalWrapper(resString); - - const done1 = assert.async(); - const done2 = assert.async(); - - const interval = setInterval(() => { - window.intervalValue = 'value'; - }, 100); - - setTimeout(() => { - assert.notOk(window.intervalValue, 'Still not defined'); - done1(); - }, 150); + const codeByAdgParams = window.scriptlets.invoke(adgParams); + const codeByUboParams = window.scriptlets.invoke(uboParams); - setTimeout(() => { - assert.strictEqual(window.intervalValue, 'value', 'Defined after boosted setInterval'); - assert.strictEqual(window.hit, 'FIRED', 'hit fired'); - clearInterval(interval); - done2(); - }, 250); + assert.strictEqual(codeByAdgParams, codeByUboParams, 'ubo name - ok'); }); test('Adg no args', (assert) => { diff --git a/tests/scriptlets/adjust-setTimeout.test.js b/tests/scriptlets/adjust-setTimeout.test.js index 885f5288..8ac28a01 100644 --- a/tests/scriptlets/adjust-setTimeout.test.js +++ b/tests/scriptlets/adjust-setTimeout.test.js @@ -20,35 +20,22 @@ const createHit = () => { const evalWrapper = eval; -test('ubo alias', (assert) => { - createHit(); - const params = { +test('Checking if alias name works', (assert) => { + const adgParams = { + name, + engine: 'test', + verbose: true, + }; + const uboParams = { name: 'ubo-nano-setTimeout-booster.js', - args: ['intervalValue', '100', '2'], + engine: 'test', verbose: true, }; - const resString = window.scriptlets.invoke(params); - evalWrapper(resString); - - const done1 = assert.async(); - const done2 = assert.async(); - - const timeout = setTimeout(() => { - window.intervalValue = 'value'; - }, 100); - - setTimeout(() => { - assert.notOk(window.intervalValue, 'Still not defined'); - done1(); - }, 150); + const codeByAdgParams = window.scriptlets.invoke(adgParams); + const codeByUboParams = window.scriptlets.invoke(uboParams); - setTimeout(() => { - assert.strictEqual(window.intervalValue, 'value', 'Defined after boosted setTimeout'); - assert.strictEqual(window.hit, 'FIRED', 'hit fired'); - clearTimeout(timeout); - done2(); - }, 250); + assert.strictEqual(codeByAdgParams, codeByUboParams, 'ubo name - ok'); }); test('Adg no args', (assert) => { diff --git a/tests/scriptlets/dir-string.test.js b/tests/scriptlets/dir-string.test.js index dd103c9b..3547c9c5 100644 --- a/tests/scriptlets/dir-string.test.js +++ b/tests/scriptlets/dir-string.test.js @@ -18,19 +18,22 @@ const createHit = () => { const evalWrapper = eval; - -test('ubo alias', (assert) => { - createHit(); - const params = { +test('Checking if alias name works', (assert) => { + const adgParams = { + name, + engine: 'test', + verbose: true, + }; + const abpParams = { name: 'abp-dir-string', - args: [], + engine: 'test', verbose: true, }; - const resString = window.scriptlets.invoke(params); - evalWrapper(resString); - console.dir({}); - assert.strictEqual(window.hit, 'FIRED', 'Console dir was updated and invoked'); + const codeByAdgParams = window.scriptlets.invoke(adgParams); + const codeByAbpParams = window.scriptlets.invoke(abpParams); + + assert.strictEqual(codeByAdgParams, codeByAbpParams, 'abp name - ok'); }); test('Adg rule times = 2', (assert) => { diff --git a/tests/scriptlets/disable-newtab-links.test.js b/tests/scriptlets/disable-newtab-links.test.js index a0eb3b33..5a756fdf 100644 --- a/tests/scriptlets/disable-newtab-links.test.js +++ b/tests/scriptlets/disable-newtab-links.test.js @@ -26,28 +26,25 @@ const createLink = () => { return elem; }; -test('ubo alias', (assert) => { - createHit(); - const params = { +test('Checking if alias name works', (assert) => { + const adgParams = { + name, + engine: 'test', + verbose: true, + }; + const uboParams = { name: 'ubo-disable-newtab-links.js', - args: [], + engine: 'test', verbose: true, }; - const elem = createLink(); - const resString = window.scriptlets.invoke(params); - - evalWrapper(resString); - elem.click(); + const codeByAdgParams = window.scriptlets.invoke(adgParams); + const codeByUboParams = window.scriptlets.invoke(uboParams); - const done = assert.async(); - setTimeout(() => { - assert.strictEqual(window.hit, 'FIRED'); - done(); - }); + assert.strictEqual(codeByAdgParams, codeByUboParams, 'ubo name - ok'); }); -test('adg alias', (assert) => { +test('adg works', (assert) => { createHit(); const params = { name, diff --git a/tests/scriptlets/json-prune.test.js b/tests/scriptlets/json-prune.test.js index 1c1b37e4..989e6b9e 100644 --- a/tests/scriptlets/json-prune.test.js +++ b/tests/scriptlets/json-prune.test.js @@ -18,6 +18,24 @@ const runScriptlet = (name, propsToRemove, requiredInitialProps) => { evalWrapper(resultString); }; +test('Checking if alias name works', (assert) => { + const adgParams = { + name, + engine: 'test', + verbose: true, + }; + const uboParams = { + name: 'ubo-json-prune.js', + engine: 'test', + verbose: true, + }; + + const codeByAdgParams = window.scriptlets.invoke(adgParams); + const codeByUboParams = window.scriptlets.invoke(uboParams); + + assert.strictEqual(codeByAdgParams, codeByUboParams, 'ubo name - ok'); +}); + test('removes propsToRemove', (assert) => { runScriptlet('json-prune', 'c'); assert.deepEqual(JSON.parse('{"a":1,"b":2,"c":3}'), { a: 1, b: 2 }, 'should remove single propsToRemove'); diff --git a/tests/scriptlets/log-addEventListener.test.js b/tests/scriptlets/log-addEventListener.test.js index b26b1e65..651eaf72 100644 --- a/tests/scriptlets/log-addEventListener.test.js +++ b/tests/scriptlets/log-addEventListener.test.js @@ -43,7 +43,7 @@ test('Checking if alias name works', (assert) => { const codeByAdgParams = window.scriptlets.invoke(adgParams); const codeByAliasParams = window.scriptlets.invoke(aliasParams); - assert.strictEqual(codeByAdgParams.toString(), codeByAliasParams.toString()); + assert.strictEqual(codeByAdgParams, codeByAliasParams); }); test('logs events to console', (assert) => { diff --git a/tests/scriptlets/noeval.test.js b/tests/scriptlets/noeval.test.js index eb45e8d1..71893792 100644 --- a/tests/scriptlets/noeval.test.js +++ b/tests/scriptlets/noeval.test.js @@ -30,49 +30,24 @@ const runScriptlet = (name) => { nativeEval(resultString); }; -test('ubo noeval alias', (assert) => { - runScriptlet('ubo-noeval.js'); - - const evalStr = '2'; - - console.log = function log(input) { - nativeConsole(input); - if (input.indexOf('trace') > -1) { - return; - } - assert.ok(input.includes('AdGuard has prevented eval:'), 'console.hit should print info'); +test('Checking if alias name works', (assert) => { + const adgParams = { + name, + engine: 'test', + verbose: true, }; - - const evalWrapper = eval; - const actual = evalWrapper(evalStr); - - assert.strictEqual(window.hit, 'FIRED', 'hit function should fire'); - assert.strictEqual(actual, undefined, 'result of eval evaluation should be undefined'); -}); - -test('ubo silent-noeval alias', (assert) => { - runScriptlet('ubo-silent-noeval.js'); - - const evalStr = '2'; - - // set assertions amount - assert.expect(3); - - console.log = function log(input) { - if (input.indexOf('trace') > -1) { - return; - } - assert.ok(input.includes('AdGuard has prevented eval:'), 'console.hit should print info'); + const uboParams = { + name: 'ubo-noeval.js', + engine: 'test', + verbose: true, }; - const evalWrapper = eval; - const actual = evalWrapper(evalStr); + const codeByAdgParams = window.scriptlets.invoke(adgParams); + const codeByUboParams = window.scriptlets.invoke(uboParams); - assert.strictEqual(window.hit, 'FIRED', 'hit function should fire'); - assert.strictEqual(actual, undefined, 'result of eval evaluation should be undefined'); + assert.strictEqual(codeByAdgParams, codeByUboParams, 'ubo name - ok'); }); - test('AG noeval alias', (assert) => { runScriptlet(name); diff --git a/tests/scriptlets/nowebrtc.test.js b/tests/scriptlets/nowebrtc.test.js index 1efff147..0004ea36 100644 --- a/tests/scriptlets/nowebrtc.test.js +++ b/tests/scriptlets/nowebrtc.test.js @@ -28,19 +28,22 @@ const runScriptlet = (name) => { evalWrapper(resultString); }; -test('ubo alias works', (assert) => { - if (!window.RTCPeerConnection) { - assert.ok(true, 'Browser does not support RTCPeerConnection'); - return; - } - - runScriptlet('ubo-nowebrtc.js'); +test('Checking if alias name works', (assert) => { + const adgParams = { + name, + engine: 'test', + verbose: true, + }; + const uboParams = { + name: 'ubo-nowebrtc.js', + engine: 'test', + verbose: true, + }; - const localConnection = new RTCPeerConnection(); - const sendChannel = localConnection.createDataChannel('sendChannel'); + const codeByAdgParams = window.scriptlets.invoke(adgParams); + const codeByUboParams = window.scriptlets.invoke(uboParams); - assert.strictEqual(window.hit, 'FIRED'); - assert.notOk(sendChannel); + assert.strictEqual(codeByAdgParams, codeByUboParams, 'ubo name - ok'); }); test('does not allow to create webRTC', (assert) => { diff --git a/tests/scriptlets/prevent-addEventListener.test.js b/tests/scriptlets/prevent-addEventListener.test.js index 78ecb515..ddade4c6 100644 --- a/tests/scriptlets/prevent-addEventListener.test.js +++ b/tests/scriptlets/prevent-addEventListener.test.js @@ -46,7 +46,7 @@ test('Checking if alias name works', (assert) => { const codeByAdgParams = window.scriptlets.invoke(adgParams); const codeByAliasParams = window.scriptlets.invoke(aliasParams); - assert.strictEqual(codeByAdgParams.toString(), codeByAliasParams.toString()); + assert.strictEqual(codeByAdgParams, codeByAliasParams); }); test('should not prevent addEventListener if callback = null', (assert) => { diff --git a/tests/scriptlets/prevent-adfly.test.js b/tests/scriptlets/prevent-adfly.test.js index 7b2093c4..962246ef 100644 --- a/tests/scriptlets/prevent-adfly.test.js +++ b/tests/scriptlets/prevent-adfly.test.js @@ -26,8 +26,26 @@ const runScriptlet = (name) => { evalWrapper(resultString); }; -test('ag and ubo aliases work', (assert) => { - assert.expect(4); +test('Checking if alias name works', (assert) => { + const adgParams = { + name, + engine: 'test', + verbose: true, + }; + const uboParams = { + name: 'ubo-adfly-defuser.js', + engine: 'test', + verbose: true, + }; + + const codeByAdgParams = window.scriptlets.invoke(adgParams); + const codeByUboParams = window.scriptlets.invoke(uboParams); + + assert.strictEqual(codeByAdgParams, codeByUboParams, 'ubo name - ok'); +}); + +test('ag works', (assert) => { + assert.expect(2); const nativeDefineProperty = Object.defineProperty; Object.defineProperty = (arg1, arg2) => { assert.strictEqual(arg1, window, 'Object.defineProperty should be called with window'); @@ -35,6 +53,5 @@ test('ag and ubo aliases work', (assert) => { }; runScriptlet(name); - runScriptlet('ubo-adfly-defuser.js'); Object.defineProperty = nativeDefineProperty; }); diff --git a/tests/scriptlets/prevent-bab.test.js b/tests/scriptlets/prevent-bab.test.js index 64b0c93b..ef1e6af1 100644 --- a/tests/scriptlets/prevent-bab.test.js +++ b/tests/scriptlets/prevent-bab.test.js @@ -27,18 +27,22 @@ const runScriptlet = (name) => { evalWrapper(resultString); }; -test('ubo alias works', (assert) => { - runScriptlet('ubo-bab-defuser.js'); - - const evalProp = 'evalProp'; - - const evalWrap = eval; +test('Checking if alias name works', (assert) => { + const adgParams = { + name, + engine: 'test', + verbose: true, + }; + const uboParams = { + name: 'ubo-bab-defuser.js', + engine: 'test', + verbose: true, + }; - evalWrap(`(function test() { const temp = 'blockadblock'; window.${evalProp} = 'test';})()`); + const codeByAdgParams = window.scriptlets.invoke(adgParams); + const codeByUboParams = window.scriptlets.invoke(uboParams); - assert.strictEqual(window[evalProp], undefined); - assert.strictEqual(window.hit, 'FIRED'); - clearGlobalProps(evalProp); + assert.strictEqual(codeByAdgParams, codeByUboParams, 'ubo name - ok'); }); test('works eval with AdblockBlock', (assert) => { diff --git a/tests/scriptlets/prevent-eval-if.test.js b/tests/scriptlets/prevent-eval-if.test.js index 33dc8e3a..85bff3ba 100644 --- a/tests/scriptlets/prevent-eval-if.test.js +++ b/tests/scriptlets/prevent-eval-if.test.js @@ -29,23 +29,25 @@ const runScriptlet = (name, search) => { nativeEval(resultString); }; -test('ubo noeval-if.js alias', (assert) => { - runScriptlet('ubo-noeval-if.js', 'test'); +test('Checking if alias name works', (assert) => { + const adgParams = { + name, + engine: 'test', + verbose: true, + }; + const uboParams = { + name: 'ubo-noeval-if.js', + engine: 'test', + verbose: true, + }; - const uboNoEvalIf = 'uboNoEvalIf'; + const codeByAdgParams = window.scriptlets.invoke(adgParams); + const codeByUboParams = window.scriptlets.invoke(uboParams); - const evalWrapper = eval; - const firstActual = evalWrapper(`(function () {return '${uboNoEvalIf}'})()`); - assert.strictEqual(window.hit, undefined, 'hit function should not fire for not matched function'); - assert.strictEqual(firstActual, uboNoEvalIf, 'result of eval evaluation should exist'); - - const secondActual = evalWrapper(`(function () {const test = 0; return '${uboNoEvalIf}'})()`); - assert.strictEqual(window.hit, 'FIRED', 'hit function should fire'); - assert.strictEqual(secondActual, undefined, 'result of eval evaluation should be undefined'); + assert.strictEqual(codeByAdgParams, codeByUboParams, 'ubo name - ok'); }); - -test('AG prevent-eval-if', (assert) => { +test('AG prevent-eval-if works', (assert) => { runScriptlet(name, '/\\(.*test.*\\(\\)/'); const agPreventEvalIf = 'agPreventEvalIf'; diff --git a/tests/scriptlets/prevent-fab-3.2.0.test.js b/tests/scriptlets/prevent-fab-3.2.0.test.js index 00f0b26f..39a996b3 100644 --- a/tests/scriptlets/prevent-fab-3.2.0.test.js +++ b/tests/scriptlets/prevent-fab-3.2.0.test.js @@ -40,30 +40,25 @@ const createFuckAdBlockSample = () => { window.fuckAdBlock = window.blockAdBlock = new FuckAdBlock(); }; -test('ubo alias works', (assert) => { - const uboFuckAdBlock = 'uboFuckAdBlock'; - createFuckAdBlockSample(); - assert.ok(window.fuckAdBlock.check()); - window.fuckAdBlock.onDetected(() => { - window[uboFuckAdBlock] = uboFuckAdBlock; - }); - assert.strictEqual(window[uboFuckAdBlock], uboFuckAdBlock, 'callback should apply'); - - - clearGlobalProps(uboFuckAdBlock); - runScriptlet('ubo-fuckadblock.js-3.2.0'); +test('Checking if alias name works', (assert) => { + const adgParams = { + name, + engine: 'test', + verbose: true, + }; + const uboParams = { + name: 'ubo-nofab.js', + engine: 'test', + verbose: true, + }; - assert.notOk(window.fuckAdBlock.check(), 'should be undefined'); - window.fuckAdBlock.onDetected(() => { - window[uboFuckAdBlock] = uboFuckAdBlock; - }); - assert.strictEqual(window[uboFuckAdBlock], undefined, 'callback should not be applied'); + const codeByAdgParams = window.scriptlets.invoke(adgParams); + const codeByUboParams = window.scriptlets.invoke(uboParams); - assert.strictEqual(window.hit, 'FIRED'); - clearGlobalProps(uboFuckAdBlock); + assert.strictEqual(codeByAdgParams, codeByUboParams, 'ubo name - ok'); }); -test('ag alias works', (assert) => { +test('ag works', (assert) => { const agFuckAdBlock = 'agFuckAdBlock'; createFuckAdBlockSample(); assert.ok(window.fuckAdBlock.check()); diff --git a/tests/scriptlets/prevent-popads-net.test.js b/tests/scriptlets/prevent-popads-net.test.js index 341e0e50..005266e0 100644 --- a/tests/scriptlets/prevent-popads-net.test.js +++ b/tests/scriptlets/prevent-popads-net.test.js @@ -28,16 +28,30 @@ const runScriptlet = (name) => { evalWrapper(resultString); }; -test('ag and ubo aliases work', (assert) => { +test('Checking if alias name works', (assert) => { + const adgParams = { + name, + engine: 'test', + verbose: true, + }; + const uboParams = { + name: 'ubo-popads.net.js', + engine: 'test', + verbose: true, + }; + + const codeByAdgParams = window.scriptlets.invoke(adgParams); + const codeByUboParams = window.scriptlets.invoke(uboParams); + + assert.strictEqual(codeByAdgParams, codeByUboParams, 'ubo name - ok'); +}); + +test('ag works', (assert) => { const stub = sinon.stub(Object, 'defineProperties').callsFake((obj, props) => props); runScriptlet(name); assert.ok(stub.calledOnce, 'Object.defineProperties called once'); assert.ok(stub.calledWith(window), 'Object.defineProperties called with window object'); - runScriptlet('ubo-popads.net.js'); - assert.ok(stub.calledTwice, 'Object.defineProperties called twice'); - assert.ok(stub.calledWith(window), 'Object.defineProperties called with window object'); - assert.strictEqual(window.hit, 'FIRED', 'hit function should fire'); stub.restore(); diff --git a/tests/scriptlets/prevent-requestAnimationFrame.test.js b/tests/scriptlets/prevent-requestAnimationFrame.test.js index 0c4a96a6..06c77549 100644 --- a/tests/scriptlets/prevent-requestAnimationFrame.test.js +++ b/tests/scriptlets/prevent-requestAnimationFrame.test.js @@ -42,7 +42,7 @@ test('Checking if alias name works', (assert) => { const codeByAdgParams = window.scriptlets.invoke(adgParams); const codeByAliasParams = window.scriptlets.invoke(aliasParams); - assert.strictEqual(codeByAdgParams.toString(), codeByAliasParams.toString()); + assert.strictEqual(codeByAdgParams, codeByAliasParams); }); diff --git a/tests/scriptlets/prevent-setInterval.test.js b/tests/scriptlets/prevent-setInterval.test.js index 9d2d829a..9b890d64 100644 --- a/tests/scriptlets/prevent-setInterval.test.js +++ b/tests/scriptlets/prevent-setInterval.test.js @@ -31,47 +31,27 @@ const afterEach = () => { module(name, { beforeEach, afterEach }); - -test('prevent-setInterval: adg no args -- logging', (assert) => { - const params = { +test('Checking if alias name works', (assert) => { + const adgParams = { name, - args: [], + engine: 'test', verbose: true, }; - const scriptlet = window.scriptlets.invoke(params); - evalWrap(scriptlet); - const done = assert.async(); - - const agLogSetInterval = 'agLogSetInterval'; - function callback() { - window[agLogSetInterval] = 'changed'; - } - const timeout = 10; - - const intervalId = setInterval(callback, timeout); - testIntervals.push(intervalId); - - // eslint-disable-next-line no-console - console.log = function log(input) { - if (input.indexOf('trace') > -1) { - return; - } - assert.strictEqual(input, `setInterval("${callback.toString()}", ${timeout})`, 'console.hit input should be equal'); + const uboParams = { + name: 'ubo-no-setInterval-if.js', + engine: 'test', + verbose: true, }; - // We need to run our assertion after all timeouts - setTimeout(() => { - assert.equal(window.hit, 'value', 'Hit function was executed'); - assert.strictEqual(window[agLogSetInterval], 'changed', 'property changed'); - clearGlobalProps(agLogSetInterval); - done(); - }, 50); -}); + const codeByAdgParams = window.scriptlets.invoke(adgParams); + const codeByUboParams = window.scriptlets.invoke(uboParams); + assert.strictEqual(codeByAdgParams, codeByUboParams, 'ubo name - ok'); +}); -test('prevent-setInterval: ubo alias no args -- logging', (assert) => { +test('prevent-setInterval: adg no args -- logging', (assert) => { const params = { - name: 'ubo-no-setInterval-if.js', + name, args: [], verbose: true, }; @@ -79,9 +59,9 @@ test('prevent-setInterval: ubo alias no args -- logging', (assert) => { evalWrap(scriptlet); const done = assert.async(); - const uboLogSetInterval = 'uboLogSetInterval'; + const agLogSetInterval = 'agLogSetInterval'; function callback() { - window[uboLogSetInterval] = 'changed'; + window[agLogSetInterval] = 'changed'; } const timeout = 10; @@ -99,8 +79,8 @@ test('prevent-setInterval: ubo alias no args -- logging', (assert) => { // We need to run our assertion after all timeouts setTimeout(() => { assert.equal(window.hit, 'value', 'Hit function was executed'); - assert.strictEqual(window[uboLogSetInterval], 'changed', 'property changed'); - clearGlobalProps(uboLogSetInterval); + assert.strictEqual(window[agLogSetInterval], 'changed', 'property changed'); + clearGlobalProps(agLogSetInterval); done(); }, 50); }); diff --git a/tests/scriptlets/prevent-setTimeout.test.js b/tests/scriptlets/prevent-setTimeout.test.js index 00f35d0a..d3e458f9 100644 --- a/tests/scriptlets/prevent-setTimeout.test.js +++ b/tests/scriptlets/prevent-setTimeout.test.js @@ -31,47 +31,28 @@ const afterEach = () => { module(name, { beforeEach, afterEach }); - -test('prevent-setTimeout: adg no args -- logging', (assert) => { - const params = { +test('Checking if alias name works', (assert) => { + const adgParams = { name, - args: [], + engine: 'test', verbose: true, }; - const scriptlet = window.scriptlets.invoke(params); - evalWrap(scriptlet); - const done = assert.async(); - - const agLogSetTimeout = 'agLogSetTimeout'; - function callback() { - window[agLogSetTimeout] = 'changed'; - } - const timeout = 10; - - const timeoutId = setTimeout(callback, timeout); - testTimeouts.push(timeoutId); - - // eslint-disable-next-line no-console - console.log = function log(input) { - if (input.indexOf('trace') > -1) { - return; - } - assert.strictEqual(input, `setTimeout("${callback.toString()}", ${timeout})`, 'console.hit input'); + const uboParams = { + name: 'ubo-no-setTimeout-if.js', + engine: 'test', + verbose: true, }; - // We need to run our assertion after all timeouts - setTimeout(() => { - assert.equal(window.hit, 'value', 'Hit function was executed'); - assert.strictEqual(window[agLogSetTimeout], 'changed', 'property changed'); - clearGlobalProps(agLogSetTimeout); - done(); - }, 50); + const codeByAdgParams = window.scriptlets.invoke(adgParams); + const codeByUboParams = window.scriptlets.invoke(uboParams); + + assert.strictEqual(codeByAdgParams, codeByUboParams, 'ubo name - ok'); }); -test('prevent-setTimeout: ubo alias no args -- logging', (assert) => { +test('prevent-setTimeout: adg no args -- logging', (assert) => { const params = { - name: 'ubo-no-setTimeout-if.js', + name, args: [], verbose: true, }; @@ -79,9 +60,9 @@ test('prevent-setTimeout: ubo alias no args -- logging', (assert) => { evalWrap(scriptlet); const done = assert.async(); - const uboLogSetTimeout = 'uboLogSetTimeout'; + const agLogSetTimeout = 'agLogSetTimeout'; function callback() { - window[uboLogSetTimeout] = 'changed'; + window[agLogSetTimeout] = 'changed'; } const timeout = 10; @@ -93,14 +74,14 @@ test('prevent-setTimeout: ubo alias no args -- logging', (assert) => { if (input.indexOf('trace') > -1) { return; } - assert.strictEqual(input, `setTimeout("${callback.toString()}", ${timeout})`, 'console.hit input should be equal'); + assert.strictEqual(input, `setTimeout("${callback.toString()}", ${timeout})`, 'console.hit input'); }; // We need to run our assertion after all timeouts setTimeout(() => { assert.equal(window.hit, 'value', 'Hit function was executed'); - assert.strictEqual(window[uboLogSetTimeout], 'changed', 'property changed'); - clearGlobalProps(uboLogSetTimeout); + assert.strictEqual(window[agLogSetTimeout], 'changed', 'property changed'); + clearGlobalProps(agLogSetTimeout); done(); }, 50); }); diff --git a/tests/scriptlets/prevent-window-open.test.js b/tests/scriptlets/prevent-window-open.test.js index 610d6bf3..04b627b4 100644 --- a/tests/scriptlets/prevent-window-open.test.js +++ b/tests/scriptlets/prevent-window-open.test.js @@ -25,31 +25,35 @@ const afterEach = () => { module(name, { beforeEach, afterEach }); -test('prevent-window-open: adg no args', (assert) => { - const params = { +test('Checking if alias name works', (assert) => { + const adgParams = { name, - args: [], + engine: 'test', verbose: true, }; - const scriptlet = window.scriptlets.invoke(params); - // run scriptlet code - evalWrap(scriptlet); - // check if scriptlet works - window.open('some url'); - assert.equal(window.hit, 'value', 'Hit function was executed'); + const uboParams = { + name: 'ubo-window.open-defuser.js', + engine: 'test', + verbose: true, + }; + + const codeByAdgParams = window.scriptlets.invoke(adgParams); + const codeByUboParams = window.scriptlets.invoke(uboParams); + + assert.strictEqual(codeByAdgParams, codeByUboParams, 'ubo name - ok'); }); -test('prevent-window-open: ubo alias: not reverse, string', (assert) => { +test('prevent-window-open: adg no args', (assert) => { const params = { - name: 'ubo-window.open-defuser.js', - args: ['1', 'test'], + name, + args: [], verbose: true, }; const scriptlet = window.scriptlets.invoke(params); // run scriptlet code evalWrap(scriptlet); // check if scriptlet works - window.open('test url', 'some target'); + window.open('some url'); assert.equal(window.hit, 'value', 'Hit function was executed'); }); diff --git a/tests/scriptlets/remove-attr.test.js b/tests/scriptlets/remove-attr.test.js index 781aac16..ac2c27a5 100644 --- a/tests/scriptlets/remove-attr.test.js +++ b/tests/scriptlets/remove-attr.test.js @@ -32,38 +32,22 @@ function addAttr(elem, attr) { } -test('ubo alias', (assert) => { - createHit(); - const attrs = ['test1', 'test2']; - const className = 'test'; - const params = { +test('Checking if alias name works', (assert) => { + const adgParams = { + name, + engine: 'test', + verbose: true, + }; + const uboParams = { name: 'ubo-remove-attr.js', - args: [attrs.join('|'), `.${className}`], + engine: 'test', verbose: true, }; - const elem = createElem(className, attrs); + const codeByAdgParams = window.scriptlets.invoke(adgParams); + const codeByUboParams = window.scriptlets.invoke(uboParams); - const resString = window.scriptlets.invoke(params); - evalWrapper(resString); - - attrs.forEach((a) => { - assert.notOk(elem.getAttribute(a), `Attr ${a} removed`); - }); - assert.strictEqual(window.hit, 'FIRED'); - clearGlobalProps('hit'); - - const done = assert.async(); - - setTimeout(() => { addAttr(elem, 'test2'); }, 10); - - setTimeout(() => { - attrs.forEach((a) => { - assert.notOk(elem.getAttribute(a), `Attr ${a} removed`); - }); - assert.strictEqual(window.hit, 'FIRED'); - done(); - }, 50); + assert.strictEqual(codeByAdgParams, codeByUboParams, 'ubo name - ok'); }); diff --git a/tests/scriptlets/remove-class.test.js b/tests/scriptlets/remove-class.test.js index d208c400..9e746174 100644 --- a/tests/scriptlets/remove-class.test.js +++ b/tests/scriptlets/remove-class.test.js @@ -27,6 +27,24 @@ const createElem = (selector, classNames) => { return elem; }; +test('Checking if alias name works', (assert) => { + const adgParams = { + name, + engine: 'test', + verbose: true, + }; + const uboParams = { + name: 'ubo-remove-class.js', + engine: 'test', + verbose: true, + }; + + const codeByAdgParams = window.scriptlets.invoke(adgParams); + const codeByUboParams = window.scriptlets.invoke(uboParams); + + assert.strictEqual(codeByAdgParams, codeByUboParams, 'ubo name - ok'); +}); + test('Adg rule: no selector', (assert) => { createHit(); diff --git a/tests/scriptlets/remove-cookie.test.js b/tests/scriptlets/remove-cookie.test.js index b060cc8c..685479ca 100644 --- a/tests/scriptlets/remove-cookie.test.js +++ b/tests/scriptlets/remove-cookie.test.js @@ -28,6 +28,24 @@ const runScriptlet = (name, match) => { evalWrapper(resultString); }; +test('Checking if alias name works', (assert) => { + const adgParams = { + name, + engine: 'test', + verbose: true, + }; + const uboParams = { + name: 'ubo-cookie-remover.js', + engine: 'test', + verbose: true, + }; + + const codeByAdgParams = window.scriptlets.invoke(adgParams); + const codeByUboParams = window.scriptlets.invoke(uboParams); + + assert.strictEqual(codeByAdgParams, codeByUboParams, 'ubo name - ok'); +}); + test('Cookie works fine', (assert) => { const cName = '__test-cookie-name__'; document.cookie = `${cName}=cookie`; @@ -46,16 +64,6 @@ test('Remove cookie by match', (assert) => { assert.strictEqual(document.cookie.includes(cName1), true, 'Another cookies works'); }); -test('Remove cookie by match ubo syntax', (assert) => { - const name = 'ubo-cookie-remover.js'; - const cName = '__test-cookie-name__14'; - document.cookie = `${cName}=cookie`; - runScriptlet(name, cName); - - assert.strictEqual(window.hit, 'FIRED', 'Hit was fired'); - assert.strictEqual(document.cookie.includes(cName), false, 'Cookie by match was removed'); -}); - test('Remove all cookies', (assert) => { const cName = '__test-cookie-name__2'; document.cookie = `${cName}=cookie`; diff --git a/tests/scriptlets/set-constant.test.js b/tests/scriptlets/set-constant.test.js index 06769734..17316df1 100644 --- a/tests/scriptlets/set-constant.test.js +++ b/tests/scriptlets/set-constant.test.js @@ -24,26 +24,22 @@ const createScriptletRunner = (counter) => (property, value) => { return counter; }; -test('ubo alias works', (assert) => { - window.__debug = () => { - window.hit = 'FIRED'; +test('Checking if alias name works', (assert) => { + const adgParams = { + name, + engine: 'test', + verbose: true, }; - - const value = 'false'; - const property = 'ubo'; - const params = { + const uboParams = { name: 'ubo-set-constant.js', - args: [property, value], + engine: 'test', verbose: true, }; - const resString = window.scriptlets.invoke(params); + const codeByAdgParams = window.scriptlets.invoke(adgParams); + const codeByUboParams = window.scriptlets.invoke(uboParams); - evalWrapper(resString); - - assert.strictEqual(window[property], false); - assert.strictEqual(window.hit, 'FIRED'); - clearGlobalProps(property); + assert.strictEqual(codeByAdgParams, codeByUboParams, 'ubo name - ok'); }); test('sets values correctly', (assert) => { diff --git a/tests/scriptlets/set-popads-dummy.test.js b/tests/scriptlets/set-popads-dummy.test.js index f80efdd0..2220c190 100644 --- a/tests/scriptlets/set-popads-dummy.test.js +++ b/tests/scriptlets/set-popads-dummy.test.js @@ -37,6 +37,24 @@ const fillPopAdsWithValues = () => { const isEmpty = (obj) => Object.keys(obj).length === 0 && obj.constructor === Object; +test('Checking if alias name works', (assert) => { + const adgParams = { + name, + engine: 'test', + verbose: true, + }; + const uboParams = { + name: 'ubo-popads-dummy.js', + engine: 'test', + verbose: true, + }; + + const codeByAdgParams = window.scriptlets.invoke(adgParams); + const codeByUboParams = window.scriptlets.invoke(uboParams); + + assert.strictEqual(codeByAdgParams, codeByUboParams, 'ubo name - ok'); +}); + test('works', (assert) => { fillPopAdsWithValues(); assert.strictEqual(window[popAdsProp], popAdsProp); @@ -47,14 +65,11 @@ test('works', (assert) => { assert.strictEqual(window.hit, 'FIRED'); }); -test('ag and ubo aliases work', (assert) => { +test('ag works', (assert) => { const stub = sinon.stub(Object, 'defineProperties').callsFake((obj, props) => props); runScriptlet(name); - assert.ok(stub.calledOnce, 'Object.defineProperties called once'); - assert.ok(stub.calledWith(window), 'Object.defineProperties called with window object'); - runScriptlet('ubo-popads-dummy.js'); - assert.ok(stub.calledTwice, 'Object.defineProperties called twice'); + assert.ok(stub.calledOnce, 'Object.defineProperties called once'); assert.ok(stub.calledWith(window), 'Object.defineProperties called with window object'); stub.restore();