Fixed: Unblock Google Fonts (#561)

This commit is contained in:
nobody 2021-07-08 06:46:12 +02:00
parent eb5fe4cc7f
commit 6ba26b7e36
No known key found for this signature in database
GPG Key ID: 8F6DE3D614FCFD7A
3 changed files with 3 additions and 11 deletions

View File

@ -48,11 +48,11 @@ interceptor.handleRequest = function (requestDetails, tabIdentifier, tab) {
if (Regex.GOOGLE_FONTS.test(requestDetails.url)) {
let initiatorDomain = helpers.extractDomainFromUrl(tab.url, true);
// Check if the website is allowed to load Google Fonts
if (interceptor.blockGoogleFonts === true && !requestAnalyzer.domainsGoogleFonts[initiatorDomain]) {
if (interceptor.blockGoogleFonts === true && !interceptor.allowedDomainsGoogleFonts[initiatorDomain]) {
return {
'cancel': true
};
} else if (interceptor.blockGoogleFonts === false || requestAnalyzer.domainsGoogleFonts[initiatorDomain]) {
} else if (interceptor.blockGoogleFonts === false || interceptor.allowedDomainsGoogleFonts[initiatorDomain]) {
return {
'cancel': false
};

View File

@ -221,11 +221,6 @@ requestAnalyzer._applyManipulateDOMDomains = function () {
requestAnalyzer.domainsManipulateDOM = items.domainsManipulateDOM || {};
});
};
requestAnalyzer._applyAllowedDomainsGoogleFonts = function () {
storageManager.type.get(Setting.ALLOWED_DOMAINS_GOOGLE_FONTS, function (items) {
requestAnalyzer.domainsGoogleFonts = items.allowedDomainsGoogleFonts || {};
});
};
/**
@ -238,9 +233,6 @@ requestAnalyzer._applyAllowlistedDomains();
requestAnalyzer.domainsManipulateDOM = {};
requestAnalyzer._applyManipulateDOMDomains();
requestAnalyzer.domainsGoogleFonts = {};
requestAnalyzer._applyAllowedDomainsGoogleFonts();
/**
* Event Handlers
@ -248,4 +240,3 @@ requestAnalyzer._applyAllowedDomainsGoogleFonts();
chrome.storage.onChanged.addListener(requestAnalyzer._applyAllowlistedDomains);
chrome.storage.onChanged.addListener(requestAnalyzer._applyManipulateDOMDomains);
chrome.storage.onChanged.addListener(requestAnalyzer._applyAllowedDomainsGoogleFonts);

View File

@ -58,6 +58,7 @@
<li>Added: clappr v0.4.5 (<a href="https://codeberg.org/nobody/LocalCDN/issues/558">#558</a>)</li>
<li>Mapping: video.js -> cdnjs.cloudflare.com (<a href="https://codeberg.org/nobody/LocalCDN/issues/559">#559</a>)</li>
<li>Update: dayjs v1.10.5 -> v1.10.6 (<a href="https://codeberg.org/nobody/LocalCDN/issues/560">#560</a>)</li>
<li>Fixed: Unblock Google Fonts (<a href="https://codeberg.org/nobody/LocalCDN/issues/561">#561</a>)</li>
<li><strong>Includes also the following changes, because the release of this version took a long time caused by a broken validation server of Mozilla (<a href="https://codeberg.org/nobody/LocalCDN/issues/490">More information</a>).</strong>
<ul>
<li>Ruleset generator for NoScript (<a href="https://codeberg.org/nobody/LocalCDN/issues/489">#489</a>)</li>