1
0
mirror of https://codeberg.org/nobody/LocalCDN.git synced 2025-06-05 21:49:31 +02:00

Miscellaneous improvements

This commit is contained in:
nobody
2020-06-27 11:49:45 +02:00
parent 575fafbc01
commit 02e0dc4335
8 changed files with 12 additions and 120 deletions

View File

@ -29,8 +29,7 @@ var requestAnalyzer = {};
requestAnalyzer.isValidCandidate = function (requestDetails, tabDetails) {
let initiatorDomain, isWhitelisted;
let fontawesome = new RegExp('\(font-awesome|fontawesome)');
let initiatorDomain, isWhitelisted, fontawesome;
initiatorDomain = helpers.extractDomainFromUrl(tabDetails.url, true);
@ -45,6 +44,7 @@ requestAnalyzer.isValidCandidate = function (requestDetails, tabDetails) {
}
// Font Awesome injections in Chromium deactivated (https://gitlab.com/nobody42/localcdn/-/issues/67)
fontawesome = new RegExp('\(font-awesome|fontawesome)');
if(BrowserType.CHROMIUM && fontawesome.test(requestDetails.url)) {
console.warn('[ LocalCDN ] Font Awesome is not fully supported by your browser.');
return false;
@ -112,6 +112,9 @@ requestAnalyzer._findLocalTarget = function (resourceMappings, basePath, channel
shorthandResource = shorthands.specialFiles(channelHost, channelPath);
if (shorthandResource) {
if (requestAnalyzer.logging) {
console.log('[ LocalCDN ] Replaced resource: ' + shorthandResource.path);
}
return shorthandResource;
}