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