From 6ba26b7e3606ea43b8902abcd5a76b082c6ad26c Mon Sep 17 00:00:00 2001 From: nobody Date: Thu, 8 Jul 2021 06:46:12 +0200 Subject: [PATCH] Fixed: Unblock Google Fonts (#561) --- core/interceptor.js | 4 ++-- core/request-analyzer.js | 9 --------- pages/updates/updates.html | 1 + 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/core/interceptor.js b/core/interceptor.js index 6fc0d4b3..9d6a756c 100644 --- a/core/interceptor.js +++ b/core/interceptor.js @@ -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 }; diff --git a/core/request-analyzer.js b/core/request-analyzer.js index 2ede6574..ee5145c6 100644 --- a/core/request-analyzer.js +++ b/core/request-analyzer.js @@ -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); diff --git a/pages/updates/updates.html b/pages/updates/updates.html index 74f086af..643bf9fb 100644 --- a/pages/updates/updates.html +++ b/pages/updates/updates.html @@ -58,6 +58,7 @@
  • Added: clappr v0.4.5 (#558)
  • Mapping: video.js -> cdnjs.cloudflare.com (#559)
  • Update: dayjs v1.10.5 -> v1.10.6 (#560)
  • +
  • Fixed: Unblock Google Fonts (#561)
  • Includes also the following changes, because the release of this version took a long time caused by a broken validation server of Mozilla (More information).