[tbb-commits] [torbutton/master] Add a extensions.torbutton.test_enabled boolean pref.

mikeperry at torproject.org mikeperry at torproject.org
Tue Mar 17 20:03:07 UTC 2015


commit bc8f182fa3a5b13dbccc08ee1a21a3f8398d7851
Author: intrigeri <intrigeri at boum.org>
Date:   Fri Nov 22 14:01:08 2013 +0000

    Add a extensions.torbutton.test_enabled boolean pref.
    
    Defaults to true. When disabled, no attempt is made to test if Tor is enabled.
---
 src/chrome/content/torbutton.js         |    3 ++-
 src/defaults/preferences/preferences.js |    1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/chrome/content/torbutton.js b/src/chrome/content/torbutton.js
index 69891c8..a14a097 100644
--- a/src/chrome/content/torbutton.js
+++ b/src/chrome/content/torbutton.js
@@ -1912,7 +1912,8 @@ function torbutton_do_tor_check()
 {
   let checkSvc = Cc["@torproject.org/torbutton-torCheckService;1"]
                    .getService(Ci.nsISupports).wrappedJSObject;
-  if (checkSvc.kCheckNotInitiated != checkSvc.statusOfTorCheck)
+  if (checkSvc.kCheckNotInitiated != checkSvc.statusOfTorCheck ||
+      !m.tb_prefs.getBoolPref("extensions.torbutton.test_enabled"))
     return; // Only do the check once.
 
   // If we have a tor control port and transparent torification is off,
diff --git a/src/defaults/preferences/preferences.js b/src/defaults/preferences/preferences.js
index 3584581..fb1a702 100644
--- a/src/defaults/preferences/preferences.js
+++ b/src/defaults/preferences/preferences.js
@@ -25,6 +25,7 @@ pref("extensions.torbutton.socks_host","");
 pref("extensions.torbutton.socks_port",0);
 pref("extensions.torbutton.socks_version",5);
 pref("extensions.torbutton.locked_mode",true);
+pref("extensions.torbutton.test_enabled",true);
 pref("extensions.torbutton.test_url","https://check.torproject.org/?TorButton=true");
 pref("extensions.torbutton.test_url_interactive", "https://check.torproject.org/?lang=__LANG__");
 pref("extensions.torbutton.local_tor_check",true);



More information about the tbb-commits mailing list