[tbb-commits] [torbutton/master] Bug 9387: Version 0.9 of the Security Slider

mikeperry at torproject.org mikeperry at torproject.org
Fri Mar 20 20:06:43 UTC 2015


commit 430ccaa1596e03e3ea0a36c51c4623fe8ff67d52
Author: Georg Koppen <gk at torproject.org>
Date:   Fri Mar 20 14:54:09 2015 +0000

    Bug 9387: Version 0.9 of the Security Slider
    
    Showing a notification to the user hinting at our new security slider
    to adjust the security settings.
---
 src/chrome/content/torbutton.js           |   28 ++++++++++++++++++++++++++++
 src/chrome/locale/en/torbutton.properties |    3 +++
 src/defaults/preferences/preferences.js   |    1 +
 3 files changed, 32 insertions(+)

diff --git a/src/chrome/content/torbutton.js b/src/chrome/content/torbutton.js
index d3afef8..77dc871 100644
--- a/src/chrome/content/torbutton.js
+++ b/src/chrome/content/torbutton.js
@@ -1044,6 +1044,34 @@ function torbutton_on_abouttor_load(aDoc) {
 
   if (m_tb_orig_BrowserOnAboutPageLoad)
     m_tb_orig_BrowserOnAboutPageLoad(aDoc);
+
+  // Show the notification about the new security slider.
+  if (m_tb_prefs.
+      getBoolPref("extensions.torbutton.show_slider_notification")) {
+    let sb = torbutton_get_stringbundle();
+    let button_label =
+      torbutton_get_property_string("torbutton.slider_notification_button");
+    let box = gBrowser.getNotificationBox();
+
+    let buttons = [{
+      label: button_label,
+      accessKey: 'S',
+      popup: null,
+      callback: function() {
+        window.openDialog("chrome://torbutton/content/preferences.xul",
+        "torbutton-preferences","chrome");}
+    }];
+
+    let priority = box.PRIORITY_INFO_LOW;
+    let message =
+      torbutton_get_property_string("torbutton.slider_notification");
+
+    box.appendNotification(message, 'new-menu-notification',
+                           "chrome://torbutton/skin/tor-enabled-16.png",
+                           priority, buttons);
+    m_tb_prefs.
+      setBoolPref("extensions.torbutton.show_slider_notification", false);
+  }
 }
 
 function torbutton_is_abouttor_doc(aDoc) {
diff --git a/src/chrome/locale/en/torbutton.properties b/src/chrome/locale/en/torbutton.properties
index 7998437..8fc4600 100644
--- a/src/chrome/locale/en/torbutton.properties
+++ b/src/chrome/locale/en/torbutton.properties
@@ -55,6 +55,9 @@ torbutton.popup.confirm_plugins = Plugins such as Flash can harm your privacy an
 torbutton.popup.never_ask_again = Never ask me again
 torbutton.popup.confirm_newnym = Tor Browser will close all windows and tabs. All website sessions will be lost.\n\nRestart Tor Browser now to reset your identity?\n\n
 
+torbutton.slider_notification = The green onion menu has now a security slider which lets you adjust your security level. Check it out!
+torbutton.slider_notification_button = Open security settings
+
 # Canvas permission prompt. Strings are kept here for ease of translation.
 canvas.siteprompt=This website (%S) attempted to extract HTML5 canvas image data, which may be used to uniquely identify your computer.\n\nShould Tor Browser allow this website to extract HTML5 canvas image data?
 canvas.notNow=Not Now
diff --git a/src/defaults/preferences/preferences.js b/src/defaults/preferences/preferences.js
index 677447b..9a5df09 100644
--- a/src/defaults/preferences/preferences.js
+++ b/src/defaults/preferences/preferences.js
@@ -178,6 +178,7 @@ pref("extensions.torbutton.restrict_thirdparty", true);
 // Security Slider
 pref("extensions.torbutton.security_slider", 4);
 pref("extensions.torbutton.security_custom", false);
+pref("extensions.torbutton.show_slider_notification", true);
 
 // Google Captcha prefs
 // FIXME: NID cookie?



More information about the tbb-commits mailing list