Chromium: Remove option to block Google Fonts (#1085)
This commit is contained in:
parent
61957fb94f
commit
f1fb6c9a17
|
@ -76,13 +76,6 @@ 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
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (targetDetails['result'] === false) {
|
if (targetDetails['result'] === false) {
|
||||||
|
|
|
@ -57,12 +57,6 @@ requestAnalyzer.isValidCandidate = function (requestDetails, tabDetails) {
|
||||||
log.append(tabDetails.url, requestDetails.url, LogString.FONT_AWESOME, true);
|
log.append(tabDetails.url, requestDetails.url, LogString.FONT_AWESOME, true);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (requestAnalyzer.isGoogleMaterialIcons(requestedDomain, requestDetails.url)) {
|
|
||||||
// also valid for Google Material icons
|
|
||||||
console.warn(`${LogString.PREFIX} ${LogString.GOOGLE_MATERIAL_ICONS}`);
|
|
||||||
log.append(tabDetails.url, requestDetails.url, LogString.GOOGLE_MATERIAL_ICONS, true);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ignore requests if website is 'yandex.com' and CDN is 'yastatic.net', because website and CDN are the same.
|
// Ignore requests if website is 'yandex.com' and CDN is 'yastatic.net', because website and CDN are the same.
|
||||||
|
|
|
@ -294,6 +294,9 @@ stateManager.logging = false;
|
||||||
|
|
||||||
for (let mapping in mappings.cdn) {
|
for (let mapping in mappings.cdn) {
|
||||||
let supportedHost = Address.ANY_PROTOCOL + mapping + Address.ANY_PATH;
|
let supportedHost = Address.ANY_PROTOCOL + mapping + Address.ANY_PATH;
|
||||||
|
if (!BrowserType.FIREFOX && (mapping === 'fonts.gstatic.com' || mapping === 'fonts.googleapis.com')) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
stateManager.validHosts.push(supportedHost);
|
stateManager.validHosts.push(supportedHost);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,6 +38,11 @@ ruleGenerator.openRuleSet = function ({target}) {
|
||||||
textArea.style.display = 'block';
|
textArea.style.display = 'block';
|
||||||
btnCopy.style.display = 'block';
|
btnCopy.style.display = 'block';
|
||||||
|
|
||||||
|
if (!BrowserType.FIREFOX) {
|
||||||
|
delete urls['fonts.googleapis.com'];
|
||||||
|
delete urls['fonts.gstatic.com'];
|
||||||
|
}
|
||||||
|
|
||||||
for (const domain in urls) {
|
for (const domain in urls) {
|
||||||
if (key === 'uMatrix') {
|
if (key === 'uMatrix') {
|
||||||
content += `* ${domain} script allow\n`;
|
content += `* ${domain} script allow\n`;
|
||||||
|
|
|
@ -59,6 +59,7 @@ optionsAdvanced.init = function (opt) {
|
||||||
|
|
||||||
if (BrowserType.CHROMIUM) {
|
if (BrowserType.CHROMIUM) {
|
||||||
document.getElementById('html-filter-div').style.display = 'none';
|
document.getElementById('html-filter-div').style.display = 'none';
|
||||||
|
document.getElementById('block-google-fonts').style.display = 'none';
|
||||||
}
|
}
|
||||||
|
|
||||||
document.getElementById('last-mapping-update').textContent += ` ${mappings.lastMappingUpdate}`;
|
document.getElementById('last-mapping-update').textContent += ` ${mappings.lastMappingUpdate}`;
|
||||||
|
|
|
@ -49,6 +49,7 @@ popup._renderContents = function () {
|
||||||
|
|
||||||
if (BrowserType.CHROMIUM) {
|
if (BrowserType.CHROMIUM) {
|
||||||
document.getElementById('div-manipulateDOM').hidden = true;
|
document.getElementById('div-manipulateDOM').hidden = true;
|
||||||
|
document.getElementById('div-google-fonts').hidden = true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,7 @@
|
||||||
<p>Improved</p>
|
<p>Improved</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Chromium: Remove option to change badge color for HTML filter (<a href="https://codeberg.org/nobody/LocalCDN/issues/1082">#1082</a>)</li>
|
<li>Chromium: Remove option to change badge color for HTML filter (<a href="https://codeberg.org/nobody/LocalCDN/issues/1082">#1082</a>)</li>
|
||||||
|
<li>Chromium: Remove option to block Google Fonts (<a href="https://codeberg.org/nobody/LocalCDN/issues/1085">#1085</a>)</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div id="generator-section">
|
<div id="generator-section">
|
||||||
|
|
Loading…
Reference in New Issue