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

[tor-commits] [torbutton/master] Bug #3686: Fix loading of localized system homepage



commit 90cbb9f0a744d5070c5ddfef7672714b72e085c7
Author: Jérémy Bobbio <lunar@xxxxxxxxxx>
Date:   Sat Oct 1 17:55:28 2011 +0200

    Bug #3686: Fix loading of localized system homepage
    
    On Debian and Tails, default homepage is more than just a string preference as
    it is internationalized using nsIPrefLocalizedString.
---
 src/chrome/content/torbutton.js |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/chrome/content/torbutton.js b/src/chrome/content/torbutton.js
index 3f9a64d..8511fc0 100644
--- a/src/chrome/content/torbutton.js
+++ b/src/chrome/content/torbutton.js
@@ -2831,6 +2831,12 @@ function torbutton_tag_new_browser(browser, tor_tag, no_plugins) {
     }
 }
 
+function torbutton_reload_homepage() {
+    var homepage = m_tb_prefs.getComplexValue("browser.startup.homepage",
+                       Components.interfaces.nsIPrefLocalizedString).data;
+    gBrowser.loadURI(homepage, null, null);
+}
+
 function torbutton_set_launch_state(state, session_restore) {
     if (!m_tb_wasinited) torbutton_init();
     var no_plugins = m_tb_prefs.getBoolPref("extensions.torbutton.no_tor_plugins");
@@ -2906,8 +2912,7 @@ function torbutton_set_launch_state(state, session_restore) {
               }
             }
           }
-          var homepage = m_tb_prefs.getCharPref("browser.startup.homepage");
-          gBrowser.loadURI(homepage, null, null);
+          torbutton_reload_homepage();
         }
       } else {
         torbutton_log(3, "Leaving tor disabled");
@@ -2920,8 +2925,7 @@ function torbutton_set_launch_state(state, session_restore) {
 
         // Load our homepage again. We just killed it via the toggle.
         if (!session_restore) {
-            var homepage = m_tb_prefs.getCharPref("browser.startup.homepage");
-            gBrowser.loadURI(homepage, null, null);
+            torbutton_reload_homepage();
         }
     }
 }

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