From 1430b89d556faf4423993498705ef8bf11603fb1 Mon Sep 17 00:00:00 2001 From: kkapsner Date: Fri, 8 Nov 2019 08:44:20 +0100 Subject: [PATCH] settings sanitation: added missing APIs --- options/sanitationRules.js | 6 ++++-- releaseNotes.txt | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/options/sanitationRules.js b/options/sanitationRules.js index cc90a7c..3d0b275 100644 --- a/options/sanitationRules.js +++ b/options/sanitationRules.js @@ -76,11 +76,13 @@ }); } [ + {mainFlag: "protectedCanvasPart", mainFlagDisabledValue: "nothing", section: "Canvas-API"}, {mainFlag: "protectAudio", section: "Audio-API"}, {mainFlag: "protectWindow", section: "Window-API"}, {mainFlag: "protectDOMRect", section: "DOMRect-API"}, + {mainFlag: "protectNavigator", section: "Navigator-API"}, ].forEach(function(api){ - if (settings.get(api.mainFlag)){ + if (settings.get(api.mainFlag) !== (api.mainFlagDisabledValue || false)){ let inSection = false; let anyActive = false; if (getSectionKeys(api.section).every(function(key){ @@ -104,7 +106,7 @@ { label: extension.getTranslation("sanitation_resolution.disableMainFlag"), callback: function(){ - settings.set(api.mainFlag, false); + settings.set(api.mainFlag, api.mainFlagDisabledValue || false); } }, ] diff --git a/releaseNotes.txt b/releaseNotes.txt index a2f01ab..fe0f657 100644 --- a/releaseNotes.txt +++ b/releaseNotes.txt @@ -7,6 +7,7 @@ Version 0.5.15: fixes: - background color of the textarea in the settings export was not readable in the dark theme when the value was invalid + - settings sanitation: added missing APIs known issues: - if a data URL is blocked the page action button does not appear