diff --git a/core/manipulate-dom.js b/core/manipulate-dom.js index c994eda4..a00bebb1 100644 --- a/core/manipulate-dom.js +++ b/core/manipulate-dom.js @@ -65,7 +65,7 @@ manipulateDOM._removeCrossOriginAndIntegrityAttr = function (details) { charset = (/charset\s*=/).test(header.value) && header.value.replace(/^.*?charset\s*=\s*/, '').replace(/["']?/g, ''); // Check if charset is supported by TextDecoder() - if (/charset\s*=/.test(header.value) && !EncodingTypes[charset.toString().toLowerCase()]) { + if ((/charset\s*=/).test(header.value) && !EncodingTypes[charset.toString().toLowerCase()]) { console.error(`[ LocalCDN ] Unsupported charset: ${charset}`); log.append(details.url, '-', `Unsupported charset: ${charset}`, true); return; diff --git a/core/request-analyzer.js b/core/request-analyzer.js index 42eb77c6..f96bae0e 100644 --- a/core/request-analyzer.js +++ b/core/request-analyzer.js @@ -46,7 +46,7 @@ requestAnalyzer.isValidCandidate = function (requestDetails, tabDetails) { // Font Awesome injections in Chromium deactivated (https://gitlab.com/nobody42/localcdn/-/issues/67) if (BrowserType.CHROMIUM) { - if (/(font-awesome|fontawesome)/.test(requestDetails.url)) { + if ((/(font-awesome|fontawesome)/).test(requestDetails.url)) { console.warn(`${LogString.PREFIX} ${LogString.FONT_AWESOME}`); log.append(tabDetails.url, requestDetails.url, LogString.FONT_AWESOME, true); return false; diff --git a/core/shorthands.js b/core/shorthands.js index 91b4a8b6..96676a1b 100644 --- a/core/shorthands.js +++ b/core/shorthands.js @@ -168,7 +168,7 @@ shorthands.specialFiles = function (channelHost, channelPath, searchString) { 'path': `resources/twitter-bootstrap/fonts/${helpers.extractFilenameFromPath(channelPath)}`, 'bundle': 'Bootstrap (Fonts)' }; - } else if (/cdnjs\.cloudflare\.com\/ajax\/libs\/jquery\.cycle2\/[\d.]+\//.test(CompleteURL)) { + } else if ((/cdnjs\.cloudflare\.com\/ajax\/libs\/jquery\.cycle2\/[\d.]+\//).test(CompleteURL)) { if (channelPath.endsWith('js')) { channelPath += 'm'; } @@ -201,7 +201,7 @@ shorthands.specialFiles = function (channelHost, channelPath, searchString) { 'path': `resources/materialize/1.0.0/${channelPath}`, 'bundle': 'Materialize' }; - } else if (/cdn\.jsdelivr\.net\/npm\/vue@(2|3)/.test(CompleteURL)) { + } else if ((/cdn\.jsdelivr\.net\/npm\/vue@(2|3)/).test(CompleteURL)) { let version = CompleteURL.match(Resource.VERSION_EXPRESSION); lastVersion = targets.setLastVersion(`/vue/${version}.`); if (lastVersion === false) { diff --git a/modules/internal/helpers.js b/modules/internal/helpers.js index eaa09422..ec1e05ec 100644 --- a/modules/internal/helpers.js +++ b/modules/internal/helpers.js @@ -139,7 +139,7 @@ helpers.normalizeDomain = function (domain) { }; helpers.extractDomainFromUrl = function (url, normalize) { - if (/^(?!(http[s]?|file):\/\/).*/.test(url)) { + if ((/^(?!(http[s]?|file):\/\/).*/).test(url)) { return null; } diff --git a/pages/options/options-other.js b/pages/options/options-other.js index a4fb02c7..51fa3fd5 100644 --- a/pages/options/options-other.js +++ b/pages/options/options-other.js @@ -173,7 +173,7 @@ optionsOther._onChangedHexColor = function ({target}) { return; } - if (/#([a-f0-9]{3}){1,2}\b/i.test(target.value)) { + if ((/#([a-f0-9]{3}){1,2}\b/i).test(target.value)) { target.classList.remove('color-error'); if (target.id === element.BADGED_TEXT_COLOR) { let txtColor = target.value;