diff --git a/src/_locales/en/messages.json b/src/_locales/en/messages.json index 3286941..1e8bf1a 100644 --- a/src/_locales/en/messages.json +++ b/src/_locales/en/messages.json @@ -720,6 +720,15 @@ "TabGuard_optEnabled": { "message": "Enabled everywhere" }, + "TabGuard_optPromptNever": { + "message": "Never prompt before anonymization" + }, + "TabGuard_optPromptPost": { + "message": "Prompt before anonymizing POST submissions" + }, + "TabGuard_optPromptAlways": { + "message": "Prompt before anonymizing any request" + }, "TabGuard_optIncognito": { "message": "Enabled in Private Browsing only" }, diff --git a/src/_locales/it/messages.json b/src/_locales/it/messages.json index c90d4b7..b9d4072 100644 --- a/src/_locales/it/messages.json +++ b/src/_locales/it/messages.json @@ -959,6 +959,15 @@ "message": "Disabilitata", "description": "" }, + "TabGuard_optPromptNever": { + "message": "Se necessario anonimizza le richieste senza avvisare" + }, + "TabGuard_optPromptPost": { + "message": "Avvisa prima di anonimizzare le richieste con invio di dati (POST)" + }, + "TabGuard_optPromptAlways": { + "message": "Avvisa prima di anonimizzare qualunque richiesta" + }, "TabGuard_forget": { "message": "Dimentica le eccezioni", "description": "" diff --git a/src/bg/Defaults.js b/src/bg/Defaults.js index 820c963..e419653 100644 --- a/src/bg/Defaults.js +++ b/src/bg/Defaults.js @@ -34,6 +34,7 @@ var Defaults = { global: false, xss: true, TabGuardMode: "incognito", + TabGuardPrompt: "post", cascadeRestrictions : false, overrideTorBrowserPolicy: false, // note: Settings.update() on reset will flip this to true } diff --git a/src/bg/TabGuard.js b/src/bg/TabGuard.js index 41f801d..40ea8ad 100644 --- a/src/bg/TabGuard.js +++ b/src/bg/TabGuard.js @@ -158,7 +158,12 @@ var TabGuard = (() => { let quietDomains = filteredGroups[tabDomain]; if (mainFrame) { - let mustPrompt = (!quietDomains || [...otherDomains].some(d => !quietDomains.has(d))); + const promptOption = ns.sync.TabGuardPrompt; + + const mustPrompt = promptOption !== "never" && + (promptOption !== "post" || request.method === "POST") && + (!quietDomains || [...otherDomains].some(d => !quietDomains.has(d))); + if (mustPrompt) { return (async () => { let options = [ @@ -169,7 +174,9 @@ var TabGuard = (() => { title: _("TabGuard_title"), message: _("TabGuard_message", [tabDomain, [...otherDomains].join(", ")]), options}); - if (ret.button !== 0) return {cancel: true}; + if (ret.button !== 0) { + return {cancel: true}; + } let list = ret.option === 0 ? filteredGroups : allowedGroups; otherDomains.add(tabDomain); for (let d of otherDomains) list[d] = otherDomains; diff --git a/src/ui/options.html b/src/ui/options.html index 9797378..d43301d 100644 --- a/src/ui/options.html +++ b/src/ui/options.html @@ -177,6 +177,13 @@ SPDX-License-Identifier: GPL-3.0-or-later +