Allow Fork-Awesome in Chromium (#1296)
This commit is contained in:
parent
5312bbc8aa
commit
44cf42d839
|
@ -439,7 +439,7 @@ const BadResources = {
|
||||||
|
|
||||||
const LogString = {
|
const LogString = {
|
||||||
'PREFIX': '[ LocalCDN ]',
|
'PREFIX': '[ LocalCDN ]',
|
||||||
'FONT_AWESOME': 'Font Awesome is not fully supported by your browser.',
|
'NOT_SUPPORTED': 'is not fully supported by your browser.',
|
||||||
'GOOGLE_MATERIAL_ICONS': 'Google Material Icons are not fully supported by your browser.',
|
'GOOGLE_MATERIAL_ICONS': 'Google Material Icons are not fully supported by your browser.',
|
||||||
'YANDEX': 'Workaround. Disable LocalCDN if website and CDN are the same',
|
'YANDEX': 'Workaround. Disable LocalCDN if website and CDN are the same',
|
||||||
'REPLACED_RESOURCE': 'Replaced resource:',
|
'REPLACED_RESOURCE': 'Replaced resource:',
|
||||||
|
|
|
@ -52,9 +52,10 @@ 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.FIREFOX) {
|
if (!BrowserType.FIREFOX) {
|
||||||
if (requestDetails.url.includes('font-awesome') || requestDetails.url.includes('fontawesome')) {
|
let requestType = requestAnalyzer.chromeSupport(requestDetails.url);
|
||||||
console.warn(`${LogString.PREFIX} ${LogString.FONT_AWESOME}`);
|
if (requestType !== '') {
|
||||||
log.append(tabDetails.url, requestDetails.url, LogString.FONT_AWESOME, true);
|
console.warn(`${LogString.PREFIX} ${requestType} ${LogString.NOT_SUPPORTED}`);
|
||||||
|
log.append(tabDetails.url, requestDetails.url, `${requestType} ${LogString.NOT_SUPPORTED}`, true);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -69,6 +70,20 @@ requestAnalyzer.isValidCandidate = function (requestDetails, tabDetails) {
|
||||||
return requestDetails.method === WebRequest.GET;
|
return requestDetails.method === WebRequest.GET;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
requestAnalyzer.chromeSupport = function (url) {
|
||||||
|
let value = '';
|
||||||
|
|
||||||
|
if (url.includes('font-awesome')) {
|
||||||
|
value = 'font-awesome';
|
||||||
|
} else if (url.includes('fontawesome')) {
|
||||||
|
value = 'font-awesome';
|
||||||
|
} else if (url.includes('fork-awesome')) {
|
||||||
|
value = 'fork-awesome';
|
||||||
|
}
|
||||||
|
|
||||||
|
return value;
|
||||||
|
};
|
||||||
|
|
||||||
requestAnalyzer.isGoogleMaterialIcons = function (url) {
|
requestAnalyzer.isGoogleMaterialIcons = function (url) {
|
||||||
return url.includes('Material+Icons') || url.includes('materialicons');
|
return url.includes('Material+Icons') || url.includes('materialicons');
|
||||||
};
|
};
|
||||||
|
|
|
@ -45,6 +45,10 @@
|
||||||
<ul>
|
<ul>
|
||||||
<li>Direct call of Google Material Icons (<a href="https://codeberg.org/nobody/LocalCDN/issues/1295">#1295</a>)</li>
|
<li>Direct call of Google Material Icons (<a href="https://codeberg.org/nobody/LocalCDN/issues/1295">#1295</a>)</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
<p>Improved</p>
|
||||||
|
<ul>
|
||||||
|
<li>Allow Fork-Awesome in Chromium (<a href="https://codeberg.org/nobody/LocalCDN/issues/1296">#1296</a>)</li>
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div id="generator-section">
|
<div id="generator-section">
|
||||||
<div class="topic-label">
|
<div class="topic-label">
|
||||||
|
|
Loading…
Reference in New Issue