mirror of
https://codeberg.org/nobody/LocalCDN.git
synced 2025-02-08 16:18:37 +01:00
Code style: wrap regex
This commit is contained in:
parent
8405504be6
commit
05ea59029f
@ -65,7 +65,7 @@ manipulateDOM._removeCrossOriginAndIntegrityAttr = function (details) {
|
|||||||
charset = (/charset\s*=/).test(header.value) && header.value.replace(/^.*?charset\s*=\s*/, '').replace(/["']?/g, '');
|
charset = (/charset\s*=/).test(header.value) && header.value.replace(/^.*?charset\s*=\s*/, '').replace(/["']?/g, '');
|
||||||
|
|
||||||
// Check if charset is supported by TextDecoder()
|
// 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}`);
|
console.error(`[ LocalCDN ] Unsupported charset: ${charset}`);
|
||||||
log.append(details.url, '-', `Unsupported charset: ${charset}`, true);
|
log.append(details.url, '-', `Unsupported charset: ${charset}`, true);
|
||||||
return;
|
return;
|
||||||
|
@ -46,7 +46,7 @@ requestAnalyzer.isValidCandidate = function (requestDetails, tabDetails) {
|
|||||||
|
|
||||||
// Font Awesome injections in Chromium deactivated (https://gitlab.com/nobody42/localcdn/-/issues/67)
|
// Font Awesome injections in Chromium deactivated (https://gitlab.com/nobody42/localcdn/-/issues/67)
|
||||||
if (BrowserType.CHROMIUM) {
|
if (BrowserType.CHROMIUM) {
|
||||||
if (/(font-awesome|fontawesome)/.test(requestDetails.url)) {
|
if ((/(font-awesome|fontawesome)/).test(requestDetails.url)) {
|
||||||
console.warn(`${LogString.PREFIX} ${LogString.FONT_AWESOME}`);
|
console.warn(`${LogString.PREFIX} ${LogString.FONT_AWESOME}`);
|
||||||
log.append(tabDetails.url, requestDetails.url, LogString.FONT_AWESOME, true);
|
log.append(tabDetails.url, requestDetails.url, LogString.FONT_AWESOME, true);
|
||||||
return false;
|
return false;
|
||||||
|
@ -168,7 +168,7 @@ shorthands.specialFiles = function (channelHost, channelPath, searchString) {
|
|||||||
'path': `resources/twitter-bootstrap/fonts/${helpers.extractFilenameFromPath(channelPath)}`,
|
'path': `resources/twitter-bootstrap/fonts/${helpers.extractFilenameFromPath(channelPath)}`,
|
||||||
'bundle': 'Bootstrap (Fonts)'
|
'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')) {
|
if (channelPath.endsWith('js')) {
|
||||||
channelPath += 'm';
|
channelPath += 'm';
|
||||||
}
|
}
|
||||||
@ -201,7 +201,7 @@ shorthands.specialFiles = function (channelHost, channelPath, searchString) {
|
|||||||
'path': `resources/materialize/1.0.0/${channelPath}`,
|
'path': `resources/materialize/1.0.0/${channelPath}`,
|
||||||
'bundle': 'Materialize'
|
'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);
|
let version = CompleteURL.match(Resource.VERSION_EXPRESSION);
|
||||||
lastVersion = targets.setLastVersion(`/vue/${version}.`);
|
lastVersion = targets.setLastVersion(`/vue/${version}.`);
|
||||||
if (lastVersion === false) {
|
if (lastVersion === false) {
|
||||||
|
@ -139,7 +139,7 @@ helpers.normalizeDomain = function (domain) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
helpers.extractDomainFromUrl = function (url, normalize) {
|
helpers.extractDomainFromUrl = function (url, normalize) {
|
||||||
if (/^(?!(http[s]?|file):\/\/).*/.test(url)) {
|
if ((/^(?!(http[s]?|file):\/\/).*/).test(url)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -173,7 +173,7 @@ optionsOther._onChangedHexColor = function ({target}) {
|
|||||||
return;
|
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');
|
target.classList.remove('color-error');
|
||||||
if (target.id === element.BADGED_TEXT_COLOR) {
|
if (target.id === element.BADGED_TEXT_COLOR) {
|
||||||
let txtColor = target.value;
|
let txtColor = target.value;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user