summaryrefslogtreecommitdiff
path: root/src/bg/Settings.js
diff options
context:
space:
mode:
authorhackademix2019-03-15 23:55:18 +0100
committerhackademix2019-03-15 23:55:50 +0100
commit921a7910f078ebdb963c047fd6a1b5a6d0231c31 (patch)
tree9fe330b14f60becd800670c55419b82c15a1c80f /src/bg/Settings.js
parentc3c3a6a76921594d130d1cd638c5111cea820145 (diff)
downloadnoscript-921a7910f078ebdb963c047fd6a1b5a6d0231c31.tar.gz
noscript-921a7910f078ebdb963c047fd6a1b5a6d0231c31.tar.xz
noscript-921a7910f078ebdb963c047fd6a1b5a6d0231c31.zip
"General/Cascade top document's restrictions to subdocuments" option (default true on the Tor Browser).
Diffstat (limited to 'src/bg/Settings.js')
-rw-r--r--src/bg/Settings.js20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/bg/Settings.js b/src/bg/Settings.js
index 3efc4ad..c0af149 100644
--- a/src/bg/Settings.js
+++ b/src/bg/Settings.js
@@ -91,6 +91,7 @@ var Settings = {
if (isTorBrowser) {
// Tor Browser-specific settings
ns.defaults.local.isTorBrowser = true; // prevents reset from forgetting
+ ns.defaults.sync.cascadeRestrictions = true; // we want this to be the default even on reset
if (!this.gotTorBrowserInit) {
// First initialization message from the Tor Browser
this.gotTorBrowserInit = true;
@@ -105,11 +106,20 @@ var Settings = {
} else {
reloadOptionsUI = true;
}
- if (!settings.local) settings.local = {};
- settings.local.isTorBrowser = true;
- if (!settings.sync) settings.sync = {};
- settings.sync.xssScanRequestBody = false;
- settings.sync.xssBlockUnscannedPOST = true;
+
+ let torBrowserSettings = {
+ local: {
+ isTorBrowser: true,
+ },
+ sync: {
+ cascadeRestrictions: true,
+ xssScanRequestBody: false,
+ xssBlockUnscannedPOST: true,
+ }
+ }
+ for (let [storage, prefs] of Object.entries(torBrowserSettings)) {
+ settings[storage] = Object.assign(settings[storage] || {}, prefs);
+ }
}
if (settings.sync === null) {