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 @@