Fixed: Unblock Google Fonts (#561)
This commit is contained in:
parent
eb5fe4cc7f
commit
6ba26b7e36
|
@ -48,11 +48,11 @@ interceptor.handleRequest = function (requestDetails, tabIdentifier, tab) {
|
||||||
if (Regex.GOOGLE_FONTS.test(requestDetails.url)) {
|
if (Regex.GOOGLE_FONTS.test(requestDetails.url)) {
|
||||||
let initiatorDomain = helpers.extractDomainFromUrl(tab.url, true);
|
let initiatorDomain = helpers.extractDomainFromUrl(tab.url, true);
|
||||||
// Check if the website is allowed to load Google Fonts
|
// 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 {
|
return {
|
||||||
'cancel': true
|
'cancel': true
|
||||||
};
|
};
|
||||||
} else if (interceptor.blockGoogleFonts === false || requestAnalyzer.domainsGoogleFonts[initiatorDomain]) {
|
} else if (interceptor.blockGoogleFonts === false || interceptor.allowedDomainsGoogleFonts[initiatorDomain]) {
|
||||||
return {
|
return {
|
||||||
'cancel': false
|
'cancel': false
|
||||||
};
|
};
|
||||||
|
|
|
@ -221,11 +221,6 @@ requestAnalyzer._applyManipulateDOMDomains = function () {
|
||||||
requestAnalyzer.domainsManipulateDOM = items.domainsManipulateDOM || {};
|
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.domainsManipulateDOM = {};
|
||||||
requestAnalyzer._applyManipulateDOMDomains();
|
requestAnalyzer._applyManipulateDOMDomains();
|
||||||
|
|
||||||
requestAnalyzer.domainsGoogleFonts = {};
|
|
||||||
requestAnalyzer._applyAllowedDomainsGoogleFonts();
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Event Handlers
|
* Event Handlers
|
||||||
|
@ -248,4 +240,3 @@ requestAnalyzer._applyAllowedDomainsGoogleFonts();
|
||||||
|
|
||||||
chrome.storage.onChanged.addListener(requestAnalyzer._applyAllowlistedDomains);
|
chrome.storage.onChanged.addListener(requestAnalyzer._applyAllowlistedDomains);
|
||||||
chrome.storage.onChanged.addListener(requestAnalyzer._applyManipulateDOMDomains);
|
chrome.storage.onChanged.addListener(requestAnalyzer._applyManipulateDOMDomains);
|
||||||
chrome.storage.onChanged.addListener(requestAnalyzer._applyAllowedDomainsGoogleFonts);
|
|
||||||
|
|
|
@ -58,6 +58,7 @@
|
||||||
<li>Added: clappr v0.4.5 (<a href="https://codeberg.org/nobody/LocalCDN/issues/558">#558</a>)</li>
|
<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>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>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>
|
<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>
|
<ul>
|
||||||
<li>Ruleset generator for NoScript (<a href="https://codeberg.org/nobody/LocalCDN/issues/489">#489</a>)</li>
|
<li>Ruleset generator for NoScript (<a href="https://codeberg.org/nobody/LocalCDN/issues/489">#489</a>)</li>
|
||||||
|
|
Loading…
Reference in New Issue