mirror of
https://codeberg.org/nobody/LocalCDN.git
synced 2025-02-02 12:27:27 +01:00
Chromium: Attach Google Material Icons to Google Fonts (#857)
This commit is contained in:
parent
30a604c789
commit
b61a032db1
@ -31,7 +31,7 @@ var interceptor = {};
|
||||
*/
|
||||
|
||||
interceptor.handleRequest = function (requestDetails, tabIdentifier, tab) {
|
||||
let validCandidate, targetDetails, targetDomain;
|
||||
let validCandidate, targetDetails, targetDomain, isGoogleFont, isGoogleMaterialIcons, initiatorDomain, isListed;
|
||||
|
||||
validCandidate = requestAnalyzer.isValidCandidate(requestDetails, tab);
|
||||
if (!validCandidate) {
|
||||
@ -49,9 +49,10 @@ interceptor.handleRequest = function (requestDetails, tabIdentifier, tab) {
|
||||
}
|
||||
|
||||
targetDomain = helpers.extractDomainFromUrl(requestDetails.url, true);
|
||||
isGoogleFont = requestAnalyzer.isGoogleFont(targetDomain);
|
||||
isGoogleMaterialIcons = requestAnalyzer.isGoogleMaterialIcons(requestDetails.url);
|
||||
|
||||
if (requestAnalyzer.isGoogleFont(targetDomain) && !requestAnalyzer.isGoogleMaterialIcons(requestDetails.url)) {
|
||||
let initiatorDomain, isListed;
|
||||
if (BrowserType.FIREFOX && (isGoogleFont || !isGoogleMaterialIcons)) {
|
||||
initiatorDomain = helpers.extractDomainFromUrl(tab.url, true);
|
||||
isListed = helpers.checkAllowlisted(initiatorDomain, interceptor.allowedDomainsGoogleFonts);
|
||||
// Check if the website is allowed to load Google Fonts
|
||||
@ -64,6 +65,13 @@ interceptor.handleRequest = function (requestDetails, tabIdentifier, tab) {
|
||||
'cancel': false
|
||||
};
|
||||
}
|
||||
} else if (!BrowserType.FIREFOX && (isGoogleFont || isGoogleMaterialIcons)) {
|
||||
initiatorDomain = helpers.extractDomainFromUrl(tab.url, true);
|
||||
isListed = helpers.checkAllowlisted(initiatorDomain, interceptor.allowedDomainsGoogleFonts);
|
||||
// Check if the website is allowed to load Google Fonts
|
||||
return {
|
||||
'cancel': interceptor.blockGoogleFonts === true && isListed === false
|
||||
};
|
||||
}
|
||||
|
||||
targetDetails = requestAnalyzer.getLocalTarget(requestDetails, tab.url);
|
||||
|
@ -58,6 +58,10 @@
|
||||
<li>search-insights v1.8.0, v2.2.1 (<a href="https://codeberg.org/nobody/LocalCDN/issues/843">#843</a>)</li>
|
||||
<li>ngx-bootstrap v8.0.0 (<a href="https://codeberg.org/nobody/LocalCDN/issues/847">#847</a>)</li>
|
||||
</ul>
|
||||
<p>Improved</p>
|
||||
<ul>
|
||||
<li>Chromium: Attach Google Material Icons to Google Fonts (<a href="https://codeberg.org/nobody/LocalCDN/issues/857">#857</a>)</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="generator-section">
|
||||
<div class="topic-label">
|
||||
|
Loading…
x
Reference in New Issue
Block a user