[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [torbutton/master] Try to make the security slider less eager to switch to "custom".



commit 7975b2023d5dc9bc0437cb5d5fbfe539448900e4
Author: Mike Perry <mikeperry-git@xxxxxxxxxxxxxx>
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/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.

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits