commit 915ec73bb2b556aa937a827fbe746b21dacec1f3
Author: Georg Koppen <gk(a)torproject.org>
Date: Mon Jan 12 13:03:34 2015 +0000
Bug 13998: Adapt code to fixed globalHttpsWhitelist
---
src/chrome/content/torbutton.js | 29 ++++++++++++++++++-----------
1 file changed, 18 insertions(+), 11 deletions(-)
diff --git a/src/chrome/content/torbutton.js b/src/chrome/content/torbutton.js
index 4715fb6..8adef28 100644
--- a/src/chrome/content/torbutton.js
+++ b/src/chrome/content/…
[View More]torbutton.js
@@ -2166,6 +2166,7 @@ var torbutton_sec_ml_bool_prefs = {
var torbutton_sec_mh_bool_prefs = {
"javascript.options.baselinejit.content" : false,
+ "noscript.global" : false,
"noscript.globalHttpsWhitelist" : true,
// XXX: pref for disableing SVG is missing
};
@@ -2198,7 +2199,10 @@ function torbutton_update_security_slider() {
for (p in torbutton_sec_h_bool_prefs) {
m_tb_prefs.setBoolPref(p, !torbutton_sec_h_bool_prefs[p])
}
- // XXX: Adding and removing "https:" is needed due to a bug in Noscript.
+ // Removing "https:" is needed due to a bug in older Noscript versions.
+ // We leave that in for a while as there may be users that were affected
+ // by this bug. Removing it immediately and having the auto-updater might
+ // leave users exposed to the problem.
if (capValue.indexOf(" https:") >= 0) {
m_tb_prefs.setCharPref("capability.policy.maonoscript.sites",
capValue.replace(" https:", ""));
@@ -2224,7 +2228,10 @@ function torbutton_update_security_slider() {
for (p in torbutton_sec_h_bool_prefs) {
m_tb_prefs.setBoolPref(p, !torbutton_sec_h_bool_prefs[p])
}
- // XXX: Adding and removing "https:" is needed due to a bug in Noscript.
+ // Removing "https:" is needed due to a bug in older Noscript versions.
+ // We leave that in for a while as there may be users that were affected
+ // by this bug. Removing it immediately and having the auto-updater might
+ // leave users exposed to the problem.
if (capValue.indexOf(" https:") >= 0) {
m_tb_prefs.setCharPref("capability.policy.maonoscript.sites",
capValue.replace(" https:", ""));
@@ -2244,17 +2251,14 @@ function torbutton_update_security_slider() {
for (p in torbutton_sec_ml_bool_prefs) {
m_tb_prefs.setBoolPref(p, torbutton_sec_ml_bool_prefs[p])
}
- for (p in torbutton_sec_mh_bool_prefs) {
- m_tb_prefs.setBoolPref(p, torbutton_sec_mh_bool_prefs[p])
- }
+ // Order matters here as both the high mode and the medium-high mode
+ // share some preferences/values. So, let's revert the high mode
+ // preferences first and set the medium-high mode ones afterwards.
for (p in torbutton_sec_h_bool_prefs) {
m_tb_prefs.setBoolPref(p, !torbutton_sec_h_bool_prefs[p])
}
- // XXX: Adding and removing "https:" is needed due to a bug in Noscript.
- // missing.
- if (capValue.indexOf(" https:") < 0) {
- m_tb_prefs.setCharPref("capability.policy.maonoscript.sites", capValue +
- " https:");
+ for (p in torbutton_sec_mh_bool_prefs) {
+ m_tb_prefs.setBoolPref(p, torbutton_sec_mh_bool_prefs[p])
}
m_tb_prefs.setBoolPref("gfx.font_rendering.graphite.enabled", false);
break;
@@ -2276,7 +2280,10 @@ function torbutton_update_security_slider() {
for (p in torbutton_sec_h_bool_prefs) {
m_tb_prefs.setBoolPref(p, torbutton_sec_h_bool_prefs[p])
}
- // XXX: Adding and removing "https:" is needed due to a bug in Noscript.
+ // Removing "https:" is needed due to a bug in older Noscript versions.
+ // We leave that in for a while as there may be users that were affected
+ // by this bug. Removing it immediately and having the auto-updater might
+ // leave users exposed to the problem.
if (capValue.indexOf(" https:") >= 0) {
m_tb_prefs.setCharPref("capability.policy.maonoscript.sites",
capValue.replace(" https:", ""));
[View Less]
commit eb343e2cdcbd35ae6140543f248969a7e3b9aa8d
Author: Georg Koppen <gk(a)torproject.org>
Date: Tue Jan 13 10:57:00 2015 +0000
Bug 13998: Bind volatilePrivatePermissions to disk
We set `noscript.volatilePrivatePermissions` to `true` if disk records
are disabled and otherwise to `false`. All this in the assumption
NoScript is enabled at all.
---
src/chrome/content/preferences.js | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/src/chrome/…
[View More]content/preferences.js b/src/chrome/content/preferences.js
index 75937eb..f67906c 100644
--- a/src/chrome/content/preferences.js
+++ b/src/chrome/content/preferences.js
@@ -286,6 +286,20 @@ function torbutton_prefs_save(doc) {
// Privacy and Security Settings
o_torprefs.setBoolPref('block_disk', doc.getElementById('torbutton_blockDisk').checked);
+ // If we have NoScript enabled we set `noscript.volatilePrivatePermissions`
+ // to `true` if we are blocking disk records and to `false` if we are
+ // enabling them.
+ try {
+ if ("@maone.net/noscript-service;1" in Components.classes) {
+ let o_noscriptprefs = torbutton_get_prefbranch('noscript.');
+ if (o_torprefs.getBoolPref('block_disk')) {
+ o_noscriptprefs.setBoolPref('volatilePrivatePermissions', true);
+ } else {
+ o_noscriptprefs.setBoolPref('volatilePrivatePermissions', false);
+ }
+ }
+ } catch (e) {}
+
o_torprefs.setBoolPref('resist_fingerprinting', doc.getElementById('torbutton_resistFingerprinting').checked);
o_torprefs.setBoolPref('no_tor_plugins', doc.getElementById('torbutton_blockPlugins').checked);
o_torprefs.setBoolPref('restrict_thirdparty', doc.getElementById('torbutton_restrictThirdParty').checked);
[View Less]
commit 7975b2023d5dc9bc0437cb5d5fbfe539448900e4
Author: Mike Perry <mikeperry-git(a)torproject.org>
Date: Tue Jan 13 08:35:00 2015 -0800
Try to make the security slider less eager to switch to "custom".
We actually need to rewrite the entire check for the custom settings here, but
this quick hack will make it flap a bit less I think.
---
src/chrome/content/torbutton.js | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/src/chrome/content/…
[View More]torbutton.js b/src/chrome/content/torbutton.js
index 8adef28..9cdb792 100644
--- a/src/chrome/content/torbutton.js
+++ b/src/chrome/content/torbutton.js
@@ -124,8 +124,6 @@ var torbutton_unique_pref_observer =
this._branch.addObserver("gfx", this, false);
this._branch.addObserver("noscript", this, false);
this._branch.addObserver("media", this, false);
- this._branch.addObserver("capability.policy.maonoscript.sites", this,
- false);
// We observe xpcom-category-entry-added for plugins w/ Gecko-Content-Viewers
var observerService = Cc["@mozilla.org/observer-service;1"].
@@ -144,7 +142,6 @@ var torbutton_unique_pref_observer =
this._branch.removeObserver("gfx", this);
this._branch.removeObserver("noscript", this);
this._branch.removeObserver("media", this);
- this._branch.removeObserver("capability.policy.maonoscript.sites", this);
var observerService = Cc["@mozilla.org/observer-service;1"].
getService(Ci.nsIObserverService);
@@ -246,7 +243,9 @@ var torbutton_unique_pref_observer =
case "media.opus.enabled":
case "media.wave.enabled":
case "media.apple.mp3.enabled":
- case "capability.policy.maonoscript.sites":
+ // XXX: This logic is bad.. Instead, we need a check here
+ // that only sets custom if the prefs differ from the current
+ // security slider level (and also can set it back if they are the same).
if (!m_tb_sliderUpdate) {
// Do we already have custom settings?
let customSlider = m_tb_prefs.
[View Less]