Added option to forget temporary settings immediately whenever NoScript gets updated.

This commit is contained in:
hackademix 2020-08-18 17:30:45 +02:00
parent 2905a6a543
commit 8e694a603c
5 changed files with 18 additions and 0 deletions

View File

@ -228,6 +228,10 @@
"OptIncognitoPerm": {
"message": "Enable setting permanent permissions in incognito/private tabs.\nBEWARE: doing this can leak site information!"
},
"OptAmnesticUpdates": {
"message": "Always forget temporary permissions across NoScript updates immediately, even if the browsers is not restarted"
},
"KeepLocked": {
"message": "Keep this element locked (recommended)"
},

View File

@ -8,6 +8,7 @@ var Defaults = {
showCtxMenuItem: true,
showCountBadge: true,
showFullAddresses: false,
amnesticUpdates: false,
},
sync: {
global: false,

View File

@ -194,6 +194,10 @@ var LifeCycle = (() => {
async onUpdateAvailable(details) {
try {
if (ns.local.amnesticUpdates) {
// user doesn't want us to remember temporary settings across updates: bail out
return;
}
await include("/lib/Ver.js");
if (Ver.is(details.version, "<", browser.runtime.getManifest().version)) {
// downgrade: temporary survival might not be supported, and we don't care

View File

@ -124,6 +124,13 @@
</span>
</div>
<div id="update-options" class="opt-group">
<span id="amnesticUpdates-opt">
<input type="checkbox" id="opt-amnesticUpdates">
<label for="opt-amnesticUpdates" id="lbl-opt-amnesticUpdates">__MSG_OptAmnesticUpdates__</label>
</span>
</div>
<section id="debug" class="browser-style">
<div class="opt-group">
<span><input type="checkbox" id="opt-debug"><label id="label-debug" for="opt-debug">Debug</label></span>

View File

@ -38,6 +38,8 @@
opt("overrideTorBrowserPolicy");
opt("amnesticUpdates", "local");
{
document.querySelector("#btn-reset").addEventListener("click", async () => {
if (confirm(_("reset_warning"))) {