From 8c9d5837ad7b51d35f500921b404d46191497aa5 Mon Sep 17 00:00:00 2001 From: nobody Date: Fri, 3 Jul 2020 08:37:00 +0200 Subject: [PATCH] Implemented an option to block unhandled Google Fonts requests --- _locales/ar/messages.json | 8 ++++++++ _locales/bg/messages.json | 8 ++++++++ _locales/cs/messages.json | 8 ++++++++ _locales/da/messages.json | 8 ++++++++ _locales/de/messages.json | 8 ++++++++ _locales/el/messages.json | 8 ++++++++ _locales/en_GB/messages.json | 8 ++++++++ _locales/en_US/messages.json | 8 ++++++++ _locales/eo/messages.json | 8 ++++++++ _locales/es/messages.json | 8 ++++++++ _locales/et/messages.json | 8 ++++++++ _locales/fi/messages.json | 8 ++++++++ _locales/fr/messages.json | 8 ++++++++ _locales/he/messages.json | 8 ++++++++ _locales/hu/messages.json | 8 ++++++++ _locales/id/messages.json | 8 ++++++++ _locales/is/messages.json | 8 ++++++++ _locales/it/messages.json | 8 ++++++++ _locales/ja/messages.json | 8 ++++++++ _locales/ko/messages.json | 8 ++++++++ _locales/lb/messages.json | 8 ++++++++ _locales/nb/messages.json | 8 ++++++++ _locales/nl/messages.json | 8 ++++++++ _locales/pl/messages.json | 8 ++++++++ _locales/pt_BR/messages.json | 8 ++++++++ _locales/pt_PT/messages.json | 8 ++++++++ _locales/ro/messages.json | 8 ++++++++ _locales/ru/messages.json | 8 ++++++++ _locales/sr/messages.json | 8 ++++++++ _locales/sv/messages.json | 8 ++++++++ _locales/tl/messages.json | 8 ++++++++ _locales/tr/messages.json | 8 ++++++++ _locales/zh_CN/messages.json | 8 ++++++++ _locales/zh_TW/messages.json | 8 ++++++++ core/constants.js | 3 ++- core/interceptor.js | 18 ++++++++++++++++++ core/main.js | 3 ++- pages/options/options.html | 10 ++++++++++ pages/options/options.js | 16 +++++++++++++++- pages/updates/updates.html | 1 + 40 files changed, 320 insertions(+), 3 deletions(-) diff --git a/_locales/ar/messages.json b/_locales/ar/messages.json index 9a99279c..a55ab4cd 100644 --- a/_locales/ar/messages.json +++ b/_locales/ar/messages.json @@ -134,5 +134,13 @@ "htmlFilterDomainsTitleInclude": { "message": "", "description": "Apply HTML filter for these domains:" + }, + "blockGoogleFontsTitle": { + "message": "", + "description": "Block Google Fonts" + }, + "blockGoogleFontsDescription": { + "message": "", + "description": "If requests for missing resources are allowed, connections to \"fonts.googleapis.com\" are not blocked. Enable this option to block these requests." } } diff --git a/_locales/bg/messages.json b/_locales/bg/messages.json index 8410d932..0513d570 100644 --- a/_locales/bg/messages.json +++ b/_locales/bg/messages.json @@ -134,5 +134,13 @@ "htmlFilterDomainsTitleInclude": { "message": "", "description": "Apply HTML filter for these domains:" + }, + "blockGoogleFontsTitle": { + "message": "", + "description": "Block Google Fonts" + }, + "blockGoogleFontsDescription": { + "message": "", + "description": "If requests for missing resources are allowed, connections to \"fonts.googleapis.com\" are not blocked. Enable this option to block these requests." } } diff --git a/_locales/cs/messages.json b/_locales/cs/messages.json index 29f777b3..3cc3f494 100644 --- a/_locales/cs/messages.json +++ b/_locales/cs/messages.json @@ -134,5 +134,13 @@ "htmlFilterDomainsTitleInclude": { "message": "", "description": "Apply HTML filter for these domains:" + }, + "blockGoogleFontsTitle": { + "message": "", + "description": "Block Google Fonts" + }, + "blockGoogleFontsDescription": { + "message": "", + "description": "If requests for missing resources are allowed, connections to \"fonts.googleapis.com\" are not blocked. Enable this option to block these requests." } } diff --git a/_locales/da/messages.json b/_locales/da/messages.json index cc2d9046..3593bdb6 100644 --- a/_locales/da/messages.json +++ b/_locales/da/messages.json @@ -134,5 +134,13 @@ "htmlFilterDomainsTitleInclude": { "message": "", "description": "Apply HTML filter for these domains:" + }, + "blockGoogleFontsTitle": { + "message": "", + "description": "Block Google Fonts" + }, + "blockGoogleFontsDescription": { + "message": "", + "description": "If requests for missing resources are allowed, connections to \"fonts.googleapis.com\" are not blocked. Enable this option to block these requests." } } diff --git a/_locales/de/messages.json b/_locales/de/messages.json index 4657fea3..d1f849cc 100644 --- a/_locales/de/messages.json +++ b/_locales/de/messages.json @@ -134,5 +134,13 @@ "htmlFilterDomainsTitleInclude": { "message": "HTML-Filter für diese Domains anwenden:", "description": "Apply HTML filter for these domains:" + }, + "blockGoogleFontsTitle": { + "message": "Blockiere Google Fonts", + "description": "Block Google Fonts" + }, + "blockGoogleFontsDescription": { + "message": "Blockiere alle Anfragen an \"fonts.googleapis.com\".", + "description": "If requests for missing resources are allowed, connections to \"fonts.googleapis.com\" are not blocked. Enable this option to block these requests." } } diff --git a/_locales/el/messages.json b/_locales/el/messages.json index 94a1a508..12cec06d 100644 --- a/_locales/el/messages.json +++ b/_locales/el/messages.json @@ -134,5 +134,13 @@ "htmlFilterDomainsTitleInclude": { "message": "", "description": "Apply HTML filter for these domains:" + }, + "blockGoogleFontsTitle": { + "message": "", + "description": "Block Google Fonts" + }, + "blockGoogleFontsDescription": { + "message": "", + "description": "If requests for missing resources are allowed, connections to \"fonts.googleapis.com\" are not blocked. Enable this option to block these requests." } } diff --git a/_locales/en_GB/messages.json b/_locales/en_GB/messages.json index b66b224d..7b2e6b24 100644 --- a/_locales/en_GB/messages.json +++ b/_locales/en_GB/messages.json @@ -134,5 +134,13 @@ "htmlFilterDomainsTitleInclude": { "message": "Apply HTML filter for these domains:", "description": "Apply HTML filter for these domains:" + }, + "blockGoogleFontsTitle": { + "message": "Block Google Fonts", + "description": "Block Google Fonts" + }, + "blockGoogleFontsDescription": { + "message": "Block all requests to \"fonts.googleapis.com\".", + "description": "If requests for missing resources are allowed, connections to \"fonts.googleapis.com\" are not blocked. Enable this option to block these requests." } } diff --git a/_locales/en_US/messages.json b/_locales/en_US/messages.json index 2464aced..2573a5e5 100644 --- a/_locales/en_US/messages.json +++ b/_locales/en_US/messages.json @@ -134,5 +134,13 @@ "htmlFilterDomainsTitleInclude": { "message": "Apply HTML filter for these domains:", "description": "Apply HTML filter for these domains:" + }, + "blockGoogleFontsTitle": { + "message": "", + "description": "Block Google Fonts" + }, + "blockGoogleFontsDescription": { + "message": "", + "description": "If requests for missing resources are allowed, connections to \"fonts.googleapis.com\" are not blocked. Enable this option to block these requests." } } diff --git a/_locales/eo/messages.json b/_locales/eo/messages.json index 8e08ed48..f9c9e302 100644 --- a/_locales/eo/messages.json +++ b/_locales/eo/messages.json @@ -134,5 +134,13 @@ "htmlFilterDomainsTitleInclude": { "message": "", "description": "Apply HTML filter for these domains:" + }, + "blockGoogleFontsTitle": { + "message": "", + "description": "Block Google Fonts" + }, + "blockGoogleFontsDescription": { + "message": "", + "description": "If requests for missing resources are allowed, connections to \"fonts.googleapis.com\" are not blocked. Enable this option to block these requests." } } diff --git a/_locales/es/messages.json b/_locales/es/messages.json index 03466b64..f4638cce 100644 --- a/_locales/es/messages.json +++ b/_locales/es/messages.json @@ -134,5 +134,13 @@ "htmlFilterDomainsTitleInclude": { "message": "", "description": "Apply HTML filter for these domains:" + }, + "blockGoogleFontsTitle": { + "message": "", + "description": "Block Google Fonts" + }, + "blockGoogleFontsDescription": { + "message": "", + "description": "If requests for missing resources are allowed, connections to \"fonts.googleapis.com\" are not blocked. Enable this option to block these requests." } } diff --git a/_locales/et/messages.json b/_locales/et/messages.json index f1e91f8d..77ac4e1a 100644 --- a/_locales/et/messages.json +++ b/_locales/et/messages.json @@ -134,5 +134,13 @@ "htmlFilterDomainsTitleInclude": { "message": "", "description": "Apply HTML filter for these domains:" + }, + "blockGoogleFontsTitle": { + "message": "", + "description": "Block Google Fonts" + }, + "blockGoogleFontsDescription": { + "message": "", + "description": "If requests for missing resources are allowed, connections to \"fonts.googleapis.com\" are not blocked. Enable this option to block these requests." } } diff --git a/_locales/fi/messages.json b/_locales/fi/messages.json index 4e03aefd..be23956c 100644 --- a/_locales/fi/messages.json +++ b/_locales/fi/messages.json @@ -134,5 +134,13 @@ "htmlFilterDomainsTitleInclude": { "message": "", "description": "Apply HTML filter for these domains:" + }, + "blockGoogleFontsTitle": { + "message": "", + "description": "Block Google Fonts" + }, + "blockGoogleFontsDescription": { + "message": "", + "description": "If requests for missing resources are allowed, connections to \"fonts.googleapis.com\" are not blocked. Enable this option to block these requests." } } diff --git a/_locales/fr/messages.json b/_locales/fr/messages.json index b8ce77d7..a6d409fd 100644 --- a/_locales/fr/messages.json +++ b/_locales/fr/messages.json @@ -134,5 +134,13 @@ "htmlFilterDomainsTitleInclude": { "message": "", "description": "Apply HTML filter for these domains:" + }, + "blockGoogleFontsTitle": { + "message": "", + "description": "Block Google Fonts" + }, + "blockGoogleFontsDescription": { + "message": "", + "description": "If requests for missing resources are allowed, connections to \"fonts.googleapis.com\" are not blocked. Enable this option to block these requests." } } diff --git a/_locales/he/messages.json b/_locales/he/messages.json index af0be7f3..edfd34d5 100644 --- a/_locales/he/messages.json +++ b/_locales/he/messages.json @@ -134,5 +134,13 @@ "htmlFilterDomainsTitleInclude": { "message": "", "description": "Apply HTML filter for these domains:" + }, + "blockGoogleFontsTitle": { + "message": "", + "description": "Block Google Fonts" + }, + "blockGoogleFontsDescription": { + "message": "", + "description": "If requests for missing resources are allowed, connections to \"fonts.googleapis.com\" are not blocked. Enable this option to block these requests." } } diff --git a/_locales/hu/messages.json b/_locales/hu/messages.json index 87a4764f..bce03df5 100644 --- a/_locales/hu/messages.json +++ b/_locales/hu/messages.json @@ -134,5 +134,13 @@ "htmlFilterDomainsTitleInclude": { "message": "", "description": "Apply HTML filter for these domains:" + }, + "blockGoogleFontsTitle": { + "message": "", + "description": "Block Google Fonts" + }, + "blockGoogleFontsDescription": { + "message": "", + "description": "If requests for missing resources are allowed, connections to \"fonts.googleapis.com\" are not blocked. Enable this option to block these requests." } } diff --git a/_locales/id/messages.json b/_locales/id/messages.json index 87d88d97..e93e0c05 100644 --- a/_locales/id/messages.json +++ b/_locales/id/messages.json @@ -134,5 +134,13 @@ "htmlFilterDomainsTitleInclude": { "message": "", "description": "Apply HTML filter for these domains:" + }, + "blockGoogleFontsTitle": { + "message": "", + "description": "Block Google Fonts" + }, + "blockGoogleFontsDescription": { + "message": "", + "description": "If requests for missing resources are allowed, connections to \"fonts.googleapis.com\" are not blocked. Enable this option to block these requests." } } diff --git a/_locales/is/messages.json b/_locales/is/messages.json index b491c5cf..59a6c4a8 100644 --- a/_locales/is/messages.json +++ b/_locales/is/messages.json @@ -134,5 +134,13 @@ "htmlFilterDomainsTitleInclude": { "message": "", "description": "Apply HTML filter for these domains:" + }, + "blockGoogleFontsTitle": { + "message": "", + "description": "Block Google Fonts" + }, + "blockGoogleFontsDescription": { + "message": "", + "description": "If requests for missing resources are allowed, connections to \"fonts.googleapis.com\" are not blocked. Enable this option to block these requests." } } diff --git a/_locales/it/messages.json b/_locales/it/messages.json index ad722d1f..d53c81e0 100644 --- a/_locales/it/messages.json +++ b/_locales/it/messages.json @@ -134,5 +134,13 @@ "htmlFilterDomainsTitleInclude": { "message": "", "description": "Apply HTML filter for these domains:" + }, + "blockGoogleFontsTitle": { + "message": "", + "description": "Block Google Fonts" + }, + "blockGoogleFontsDescription": { + "message": "", + "description": "If requests for missing resources are allowed, connections to \"fonts.googleapis.com\" are not blocked. Enable this option to block these requests." } } diff --git a/_locales/ja/messages.json b/_locales/ja/messages.json index 2427854c..332f7cf8 100644 --- a/_locales/ja/messages.json +++ b/_locales/ja/messages.json @@ -134,5 +134,13 @@ "htmlFilterDomainsTitleInclude": { "message": "", "description": "Apply HTML filter for these domains:" + }, + "blockGoogleFontsTitle": { + "message": "", + "description": "Block Google Fonts" + }, + "blockGoogleFontsDescription": { + "message": "", + "description": "If requests for missing resources are allowed, connections to \"fonts.googleapis.com\" are not blocked. Enable this option to block these requests." } } diff --git a/_locales/ko/messages.json b/_locales/ko/messages.json index ebda9b6d..2c38a712 100644 --- a/_locales/ko/messages.json +++ b/_locales/ko/messages.json @@ -134,5 +134,13 @@ "htmlFilterDomainsTitleInclude": { "message": "", "description": "Apply HTML filter for these domains:" + }, + "blockGoogleFontsTitle": { + "message": "", + "description": "Block Google Fonts" + }, + "blockGoogleFontsDescription": { + "message": "", + "description": "If requests for missing resources are allowed, connections to \"fonts.googleapis.com\" are not blocked. Enable this option to block these requests." } } diff --git a/_locales/lb/messages.json b/_locales/lb/messages.json index 8be7bc21..53189d8c 100644 --- a/_locales/lb/messages.json +++ b/_locales/lb/messages.json @@ -134,5 +134,13 @@ "htmlFilterDomainsTitleInclude": { "message": "", "description": "Apply HTML filter for these domains:" + }, + "blockGoogleFontsTitle": { + "message": "", + "description": "Block Google Fonts" + }, + "blockGoogleFontsDescription": { + "message": "", + "description": "If requests for missing resources are allowed, connections to \"fonts.googleapis.com\" are not blocked. Enable this option to block these requests." } } diff --git a/_locales/nb/messages.json b/_locales/nb/messages.json index e41b931a..79d5df69 100644 --- a/_locales/nb/messages.json +++ b/_locales/nb/messages.json @@ -134,5 +134,13 @@ "htmlFilterDomainsTitleInclude": { "message": "Bruk HTML-filter på disse domenene:", "description": "Apply HTML filter for these domains:" + }, + "blockGoogleFontsTitle": { + "message": "", + "description": "Block Google Fonts" + }, + "blockGoogleFontsDescription": { + "message": "", + "description": "If requests for missing resources are allowed, connections to \"fonts.googleapis.com\" are not blocked. Enable this option to block these requests." } } diff --git a/_locales/nl/messages.json b/_locales/nl/messages.json index ac22150f..4f539bb8 100644 --- a/_locales/nl/messages.json +++ b/_locales/nl/messages.json @@ -134,5 +134,13 @@ "htmlFilterDomainsTitleInclude": { "message": "", "description": "Apply HTML filter for these domains:" + }, + "blockGoogleFontsTitle": { + "message": "", + "description": "Block Google Fonts" + }, + "blockGoogleFontsDescription": { + "message": "", + "description": "If requests for missing resources are allowed, connections to \"fonts.googleapis.com\" are not blocked. Enable this option to block these requests." } } diff --git a/_locales/pl/messages.json b/_locales/pl/messages.json index afd64030..0971e55f 100644 --- a/_locales/pl/messages.json +++ b/_locales/pl/messages.json @@ -134,5 +134,13 @@ "htmlFilterDomainsTitleInclude": { "message": "Zastosuj filtr HTML dla tych domen:", "description": "Apply HTML filter for these domains:" + }, + "blockGoogleFontsTitle": { + "message": "", + "description": "Block Google Fonts" + }, + "blockGoogleFontsDescription": { + "message": "", + "description": "If requests for missing resources are allowed, connections to \"fonts.googleapis.com\" are not blocked. Enable this option to block these requests." } } diff --git a/_locales/pt_BR/messages.json b/_locales/pt_BR/messages.json index 3addaa16..dfbe1d5d 100644 --- a/_locales/pt_BR/messages.json +++ b/_locales/pt_BR/messages.json @@ -134,5 +134,13 @@ "htmlFilterDomainsTitleInclude": { "message": "", "description": "Apply HTML filter for these domains:" + }, + "blockGoogleFontsTitle": { + "message": "", + "description": "Block Google Fonts" + }, + "blockGoogleFontsDescription": { + "message": "", + "description": "If requests for missing resources are allowed, connections to \"fonts.googleapis.com\" are not blocked. Enable this option to block these requests." } } diff --git a/_locales/pt_PT/messages.json b/_locales/pt_PT/messages.json index bf7944d6..b9b78817 100644 --- a/_locales/pt_PT/messages.json +++ b/_locales/pt_PT/messages.json @@ -134,5 +134,13 @@ "htmlFilterDomainsTitleInclude": { "message": "", "description": "Apply HTML filter for these domains:" + }, + "blockGoogleFontsTitle": { + "message": "", + "description": "Block Google Fonts" + }, + "blockGoogleFontsDescription": { + "message": "", + "description": "If requests for missing resources are allowed, connections to \"fonts.googleapis.com\" are not blocked. Enable this option to block these requests." } } diff --git a/_locales/ro/messages.json b/_locales/ro/messages.json index 592c61ee..6399a7f5 100644 --- a/_locales/ro/messages.json +++ b/_locales/ro/messages.json @@ -134,5 +134,13 @@ "htmlFilterDomainsTitleInclude": { "message": "", "description": "Apply HTML filter for these domains:" + }, + "blockGoogleFontsTitle": { + "message": "", + "description": "Block Google Fonts" + }, + "blockGoogleFontsDescription": { + "message": "", + "description": "If requests for missing resources are allowed, connections to \"fonts.googleapis.com\" are not blocked. Enable this option to block these requests." } } diff --git a/_locales/ru/messages.json b/_locales/ru/messages.json index d3baefd8..c8b3bb15 100644 --- a/_locales/ru/messages.json +++ b/_locales/ru/messages.json @@ -134,5 +134,13 @@ "htmlFilterDomainsTitleInclude": { "message": "", "description": "Apply HTML filter for these domains:" + }, + "blockGoogleFontsTitle": { + "message": "", + "description": "Block Google Fonts" + }, + "blockGoogleFontsDescription": { + "message": "", + "description": "If requests for missing resources are allowed, connections to \"fonts.googleapis.com\" are not blocked. Enable this option to block these requests." } } diff --git a/_locales/sr/messages.json b/_locales/sr/messages.json index cdbca0ee..55ceadd3 100644 --- a/_locales/sr/messages.json +++ b/_locales/sr/messages.json @@ -134,5 +134,13 @@ "htmlFilterDomainsTitleInclude": { "message": "", "description": "Apply HTML filter for these domains:" + }, + "blockGoogleFontsTitle": { + "message": "", + "description": "Block Google Fonts" + }, + "blockGoogleFontsDescription": { + "message": "", + "description": "If requests for missing resources are allowed, connections to \"fonts.googleapis.com\" are not blocked. Enable this option to block these requests." } } diff --git a/_locales/sv/messages.json b/_locales/sv/messages.json index 4c841f73..62d94bdc 100644 --- a/_locales/sv/messages.json +++ b/_locales/sv/messages.json @@ -134,5 +134,13 @@ "htmlFilterDomainsTitleInclude": { "message": "", "description": "Apply HTML filter for these domains:" + }, + "blockGoogleFontsTitle": { + "message": "", + "description": "Block Google Fonts" + }, + "blockGoogleFontsDescription": { + "message": "", + "description": "If requests for missing resources are allowed, connections to \"fonts.googleapis.com\" are not blocked. Enable this option to block these requests." } } diff --git a/_locales/tl/messages.json b/_locales/tl/messages.json index 92c95827..ea308cb4 100644 --- a/_locales/tl/messages.json +++ b/_locales/tl/messages.json @@ -134,5 +134,13 @@ "htmlFilterDomainsTitleInclude": { "message": "", "description": "Apply HTML filter for these domains:" + }, + "blockGoogleFontsTitle": { + "message": "", + "description": "Block Google Fonts" + }, + "blockGoogleFontsDescription": { + "message": "", + "description": "If requests for missing resources are allowed, connections to \"fonts.googleapis.com\" are not blocked. Enable this option to block these requests." } } diff --git a/_locales/tr/messages.json b/_locales/tr/messages.json index 49bc3ac1..234695dd 100644 --- a/_locales/tr/messages.json +++ b/_locales/tr/messages.json @@ -134,5 +134,13 @@ "htmlFilterDomainsTitleInclude": { "message": "Bu etki alanları için HTML filtresini uygula:", "description": "Apply HTML filter for these domains:" + }, + "blockGoogleFontsTitle": { + "message": "", + "description": "Block Google Fonts" + }, + "blockGoogleFontsDescription": { + "message": "", + "description": "If requests for missing resources are allowed, connections to \"fonts.googleapis.com\" are not blocked. Enable this option to block these requests." } } diff --git a/_locales/zh_CN/messages.json b/_locales/zh_CN/messages.json index bcd19255..817b0997 100644 --- a/_locales/zh_CN/messages.json +++ b/_locales/zh_CN/messages.json @@ -134,5 +134,13 @@ "htmlFilterDomainsTitleInclude": { "message": "", "description": "Apply HTML filter for these domains:" + }, + "blockGoogleFontsTitle": { + "message": "", + "description": "Block Google Fonts" + }, + "blockGoogleFontsDescription": { + "message": "", + "description": "If requests for missing resources are allowed, connections to \"fonts.googleapis.com\" are not blocked. Enable this option to block these requests." } } diff --git a/_locales/zh_TW/messages.json b/_locales/zh_TW/messages.json index 211783f0..bf2e9793 100644 --- a/_locales/zh_TW/messages.json +++ b/_locales/zh_TW/messages.json @@ -134,5 +134,13 @@ "htmlFilterDomainsTitleInclude": { "message": "", "description": "Apply HTML filter for these domains:" + }, + "blockGoogleFontsTitle": { + "message": "", + "description": "Block Google Fonts" + }, + "blockGoogleFontsDescription": { + "message": "", + "description": "If requests for missing resources are allowed, connections to \"fonts.googleapis.com\" are not blocked. Enable this option to block these requests." } } diff --git a/core/constants.js b/core/constants.js index 6d79c53f..1021a5a9 100644 --- a/core/constants.js +++ b/core/constants.js @@ -73,7 +73,8 @@ const Setting = { 'LOGGING': 'enableLogging', 'DOMAINS_MANIPULATE_DOM': 'domainsManipulateDOM', 'STATISTIC_DATA': 'statisticData', - 'NEGATE_HTML_FILTER_LIST': 'negateHtmlFilterList' + 'NEGATE_HTML_FILTER_LIST': 'negateHtmlFilterList', + 'BLOCK_GOOGLE_FONTS': 'blockGoogleFonts' }; const WebRequest = { diff --git a/core/interceptor.js b/core/interceptor.js index a4bba45c..956c7fa5 100644 --- a/core/interceptor.js +++ b/core/interceptor.js @@ -34,6 +34,18 @@ interceptor.handleRequest = function (requestDetails, tabIdentifier, tab) { validCandidate = requestAnalyzer.isValidCandidate(requestDetails, tab); + if (requestDetails.url.startsWith('https://fonts.googleapis.com/css?family')) { + if(interceptor.blockGoogleFonts) { + return { + 'cancel': true + }; + } else { + return { + 'cancel': false + }; + } + } + if (!validCandidate) { return { @@ -119,6 +131,10 @@ interceptor._handleStorageChanged = function (changes) { if (Setting.BLOCK_MISSING in changes) { interceptor.blockMissing = changes.blockMissing.newValue; } + + if (Setting.BLOCK_GOOGLE_FONTS in changes) { + interceptor.blockGoogleFonts = changes.blockGoogleFonts.newValue; + } }; /** @@ -131,6 +147,7 @@ interceptor.taintedDomains = {}; interceptor.amountInjected = 0; interceptor.xhrTestDomain = Address.DECENTRALEYES; interceptor.blockMissing = false; +interceptor.blockGoogleFonts = true; interceptor.relatedSettings = []; @@ -143,6 +160,7 @@ chrome.storage.sync.get(interceptor.relatedSettings, function (items) { interceptor.amountInjected = items.amountInjected || 0; interceptor.xhrTestDomain = items.xhrTestDomain || Address.DECENTRALEYES; interceptor.blockMissing = items.blockMissing || false; + interceptor.blockGoogleFonts = items.blockGoogleFonts || true; }); /** diff --git a/core/main.js b/core/main.js index 5226948c..1b279fb8 100644 --- a/core/main.js +++ b/core/main.js @@ -41,7 +41,8 @@ main._initializeSettings = function () { [Setting.WHITELISTED_DOMAINS]: {}, [Setting.LOGGING]: false, [Setting.DOMAINS_MANIPULATE_DOM]: {}, - [Setting.NEGATE_HTML_FILTER_LIST]: false + [Setting.NEGATE_HTML_FILTER_LIST]: false, + [Setting.BLOCK_GOOGLE_FONTS]: true }; chrome.storage.sync.get(settingDefaults, function (items) { diff --git a/pages/options/options.html b/pages/options/options.html index e3b14795..895100d0 100644 --- a/pages/options/options.html +++ b/pages/options/options.html @@ -48,6 +48,16 @@
+
+
+ +
+
If you use the rules of the rule generator, requests to "fonts.googleapis.com" are allowed to substitute "Google Material Icons" automatically. If you want to block the other requests, enable this option.
+