[tbb-commits] [torbutton/master] Bug 21091: Hide the "Check for Tor Browser Update..." menu entry when running under the sandbox.

gk at torproject.org gk at torproject.org
Tue Jan 10 14:40:56 UTC 2017


commit dd927687ed22a2e8a8e880e92c6f5b8273c737c9
Author: Kathy Brade <brade at pearlcrescent.com>
Date:   Mon Jan 9 11:53:31 2017 -0500

    Bug 21091: Hide the "Check for Tor Browser Update..." menu entry when running under the sandbox.
    
    If the `TOR_HIDE_UPDATE_CHECK_UI` env var is set, hide the "Check for
    Tor Browser Update..." menu item and the separator that sits right above it.
---
 src/chrome/content/popup.xul    |  2 +-
 src/chrome/content/torbutton.js | 11 +++++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/src/chrome/content/popup.xul b/src/chrome/content/popup.xul
index d015766..9447b70 100644
--- a/src/chrome/content/popup.xul
+++ b/src/chrome/content/popup.xul
@@ -44,7 +44,7 @@
                   label="&torbutton.context_menu.networksettings;"
                   accesskey="&torbutton.context_menu.networksettings.key;"
                   oncommand="torbutton_open_network_settings()"/>
-        <menuseparator/>
+        <menuseparator id="torbutton-checkForUpdateSeparator"/>
         <menuitem id="torbutton-checkForUpdate"
                   label="&torbutton.context_menu.downloadUpdate;"
                   accesskey="&torbutton.context_menu.downloadUpdate.key;"
diff --git a/src/chrome/content/torbutton.js b/src/chrome/content/torbutton.js
index c0fe710..dacc43e 100644
--- a/src/chrome/content/torbutton.js
+++ b/src/chrome/content/torbutton.js
@@ -1822,6 +1822,17 @@ function torbutton_check_protections()
   else
     document.getElementById("torbutton-networksettings").hidden = false;
 
+  // Bug 21091: check for the existence of an environment variable
+  // in order to toggle the visibility of the torbutton-checkForUpdate
+  // menuitem and its separator.
+  if (env.exists("TOR_HIDE_UPDATE_CHECK_UI")) {
+    document.getElementById("torbutton-checkForUpdateSeparator").hidden = true;
+    document.getElementById("torbutton-checkForUpdate").hidden = true;
+  } else {
+    document.getElementById("torbutton-checkForUpdateSeparator").hidden = false;
+    document.getElementById("torbutton-checkForUpdate").hidden = false;
+  }
+
   var cookie_pref = m_tb_prefs.getBoolPref("extensions.torbutton.cookie_protections");
   document.getElementById("torbutton-cookie-protector").disabled = !cookie_pref;
 



More information about the tbb-commits mailing list