diff --git a/src/scriptlets/hide-in-shadow-dom.js b/src/scriptlets/hide-in-shadow-dom.js index bfc25588..dc0a68de 100644 --- a/src/scriptlets/hide-in-shadow-dom.js +++ b/src/scriptlets/hide-in-shadow-dom.js @@ -1,9 +1,12 @@ import { hit, observeDOMChanges, - flatten, findHostElements, pierceShadowDom, + // following helpers should be imported and injected + // because they are used by helpers above + flatten, + throttle, } from '../helpers/index'; /** @@ -85,7 +88,10 @@ hideInShadowDom.names = [ hideInShadowDom.injections = [ hit, observeDOMChanges, - flatten, findHostElements, pierceShadowDom, + // following helpers should be imported and injected + // because they are used by helpers above + flatten, + throttle, ]; diff --git a/src/scriptlets/prevent-xhr.js b/src/scriptlets/prevent-xhr.js index 30fa5c4e..f90061a8 100644 --- a/src/scriptlets/prevent-xhr.js +++ b/src/scriptlets/prevent-xhr.js @@ -1,8 +1,6 @@ import { hit, objectToString, - getRandomIntInclusive, - getRandomStrByLength, generateRandomResponse, matchRequestProps, logMessage, @@ -20,6 +18,8 @@ import { parseMatchProps, validateParsedData, getMatchPropsData, + getRandomIntInclusive, + getRandomStrByLength, } from '../helpers/index'; /* eslint-disable max-len */ @@ -191,8 +191,6 @@ preventXHR.injections = [ logVerbose, objectToString, matchRequestProps, - getRandomIntInclusive, - getRandomStrByLength, generateRandomResponse, toRegExp, isValidStrPattern, @@ -205,4 +203,6 @@ preventXHR.injections = [ parseMatchProps, validateParsedData, getMatchPropsData, + getRandomIntInclusive, + getRandomStrByLength, ]; diff --git a/src/scriptlets/remove-attr.js b/src/scriptlets/remove-attr.js index 4d72cfbe..c665db8d 100644 --- a/src/scriptlets/remove-attr.js +++ b/src/scriptlets/remove-attr.js @@ -3,6 +3,9 @@ import { observeDOMChanges, parseFlags, logVerbose, + // following helpers should be imported and injected + // because they are used by helpers above + throttle, } from '../helpers/index'; /* eslint-disable max-len */ @@ -144,4 +147,7 @@ removeAttr.injections = [ observeDOMChanges, parseFlags, logVerbose, + // following helpers should be imported and injected + // because they are used by helpers above + throttle, ]; diff --git a/src/scriptlets/remove-class.js b/src/scriptlets/remove-class.js index d5e71427..de83ed37 100644 --- a/src/scriptlets/remove-class.js +++ b/src/scriptlets/remove-class.js @@ -3,6 +3,9 @@ import { logVerbose, observeDOMChanges, parseFlags, + // following helpers should be imported and injected + // because they are used by helpers above + throttle, } from '../helpers/index'; /* eslint-disable max-len */ @@ -170,4 +173,7 @@ removeClass.injections = [ logVerbose, observeDOMChanges, parseFlags, + // following helpers should be imported and injected + // because they are used by helpers above + throttle, ]; diff --git a/src/scriptlets/remove-in-shadow-dom.js b/src/scriptlets/remove-in-shadow-dom.js index e263b1a4..94ef38aa 100644 --- a/src/scriptlets/remove-in-shadow-dom.js +++ b/src/scriptlets/remove-in-shadow-dom.js @@ -1,9 +1,12 @@ import { hit, observeDOMChanges, - flatten, findHostElements, pierceShadowDom, + // following helpers should be imported and injected + // because they are used by helpers above + flatten, + throttle, } from '../helpers/index'; /** @@ -84,7 +87,10 @@ removeInShadowDom.names = [ removeInShadowDom.injections = [ hit, observeDOMChanges, - flatten, findHostElements, pierceShadowDom, + // following helpers should be imported and injected + // because they are used by helpers above + flatten, + throttle, ]; diff --git a/src/scriptlets/set-attr.js b/src/scriptlets/set-attr.js index 8cef2dfb..fd4fd5b2 100644 --- a/src/scriptlets/set-attr.js +++ b/src/scriptlets/set-attr.js @@ -2,6 +2,9 @@ import { hit, observeDOMChanges, nativeIsNaN, + // following helpers should be imported and injected + // because they are used by helpers above + throttle, } from '../helpers/index'; /* eslint-disable max-len */ @@ -57,8 +60,8 @@ export function setAttr(source, selector, attr, value = '') { // Drop strings that cant be parsed into number, negative numbers and numbers below 32767 if (value.length !== 0 && (nativeIsNaN(parseInt(value, 10)) - || parseInt(value, 10) < 0 - || parseInt(value, 10) > 0x7FFF)) { + || parseInt(value, 10) < 0 + || parseInt(value, 10) > 0x7FFF)) { return; } @@ -82,4 +85,11 @@ setAttr.names = [ 'set-attr', ]; -setAttr.injections = [hit, observeDOMChanges, nativeIsNaN]; +setAttr.injections = [ + hit, + observeDOMChanges, + nativeIsNaN, + // following helpers should be imported and injected + // because they are used by helpers above + throttle, +]; diff --git a/src/scriptlets/set-popads-dummy.js b/src/scriptlets/set-popads-dummy.js index 6e191a62..1792e514 100644 --- a/src/scriptlets/set-popads-dummy.js +++ b/src/scriptlets/set-popads-dummy.js @@ -1,4 +1,4 @@ -/* eslint-disable no-console, func-names, no-multi-assign */ +/* eslint-disable func-names, no-multi-assign */ import { hit } from '../helpers/index'; /**