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) {
|
interceptor.handleRequest = function (requestDetails, tabIdentifier, tab) {
|
||||||
let validCandidate, targetDetails, targetDomain;
|
let validCandidate, targetDetails, targetDomain, isGoogleFont, isGoogleMaterialIcons, initiatorDomain, isListed;
|
||||||
|
|
||||||
validCandidate = requestAnalyzer.isValidCandidate(requestDetails, tab);
|
validCandidate = requestAnalyzer.isValidCandidate(requestDetails, tab);
|
||||||
if (!validCandidate) {
|
if (!validCandidate) {
|
||||||
|
@ -49,9 +49,10 @@ interceptor.handleRequest = function (requestDetails, tabIdentifier, tab) {
|
||||||
}
|
}
|
||||||
|
|
||||||
targetDomain = helpers.extractDomainFromUrl(requestDetails.url, true);
|
targetDomain = helpers.extractDomainFromUrl(requestDetails.url, true);
|
||||||
|
isGoogleFont = requestAnalyzer.isGoogleFont(targetDomain);
|
||||||
|
isGoogleMaterialIcons = requestAnalyzer.isGoogleMaterialIcons(requestDetails.url);
|
||||||
|
|
||||||
if (requestAnalyzer.isGoogleFont(targetDomain) && !requestAnalyzer.isGoogleMaterialIcons(requestDetails.url)) {
|
if (BrowserType.FIREFOX && (isGoogleFont || !isGoogleMaterialIcons)) {
|
||||||
let initiatorDomain, isListed;
|
|
||||||
initiatorDomain = helpers.extractDomainFromUrl(tab.url, true);
|
initiatorDomain = helpers.extractDomainFromUrl(tab.url, true);
|
||||||
isListed = helpers.checkAllowlisted(initiatorDomain, interceptor.allowedDomainsGoogleFonts);
|
isListed = helpers.checkAllowlisted(initiatorDomain, interceptor.allowedDomainsGoogleFonts);
|
||||||
// Check if the website is allowed to load Google Fonts
|
// Check if the website is allowed to load Google Fonts
|
||||||
|
@ -64,6 +65,13 @@ interceptor.handleRequest = function (requestDetails, tabIdentifier, tab) {
|
||||||
'cancel': false
|
'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);
|
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>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>
|
<li>ngx-bootstrap v8.0.0 (<a href="https://codeberg.org/nobody/LocalCDN/issues/847">#847</a>)</li>
|
||||||
</ul>
|
</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>
|
||||||
<div id="generator-section">
|
<div id="generator-section">
|
||||||
<div class="topic-label">
|
<div class="topic-label">
|
||||||
|
|
Loading…
Reference in New Issue