Browse Source

Add whitelist type selection

Fixes #538
pull/562/head
kkapsner 4 months ago
parent
commit
43ea01c178
  1. 4
      _locales/en/messages.json
  2. 17
      pageAction/pageAction.js
  3. 1
      releaseNotes.txt

4
_locales/en/messages.json

@ -849,6 +849,10 @@
"message": "What is the scope of the whitelisting?",
"description": ""
},
"selectWhitelistType": {
"message": "What is the type of the whitelisting?",
"description": ""
},
"whitelistOnlyAPI": {
"message": "Whitelist only the {api}",
"description": ""

17
pageAction/pageAction.js

@ -71,7 +71,7 @@
isIcon: true,
callback: async function({domain, urls, api}){
const whitelistingSettings = {
all: {name: "blockMode", value: "allowEverything"},
all: {name: "blockMode", value: "allowEverything", fakeValue: "fake"},
canvas: {name: "protectedCanvasPart", value: "nothing"},
audio: {name: "protectAudio", value: false},
domRect: {name: "protectDOMRect", value: false},
@ -110,6 +110,21 @@
)];
}
if (choice){
if (setting === whitelistingSettings.all && settings.get(setting.name, choice).startsWith("block")){
setting.value = await modalChoice(
extension.getTranslation("selectWhitelistType"),
[
{
text: extension.getTranslation("blockMode_options." + setting.value),
value: setting.value
},
{
text: extension.getTranslation("blockMode_options." + setting.fakeValue),
value: setting.fakeValue
}
]
);
}
await settings.set(setting.name, setting.value, choice);
}

1
releaseNotes.txt

@ -10,6 +10,7 @@ Version 1.6:
- try to not break tabs when updating
- setting to postpone updates until browser restart or extension is reloaded
- added status button in browser action to see and set the whitelist status
- if the current block mode is set to blocking you can chose between faking and allowing if you whitelist an URL
fixes:
- fix message canvasBlocker-unload

Loading…
Cancel
Save