[tor-commits] [torbutton/master] Bug 40007: Move SecurityPrefs initialization to the StartupObserver component.

gk at torproject.org gk at torproject.org
Wed Sep 9 08:04:48 UTC 2020


commit d8e068679001c3c3fe0d08d8ad1c9193e7fa95df
Author: Alex Catarineu <acat at torproject.org>
Date:   Tue Sep 1 13:26:08 2020 +0200

    Bug 40007: Move SecurityPrefs initialization to the StartupObserver component.
    
    With this change this will be properly initialized both in desktop and mobile,
    and we will not need additional tor-browser changes to load torbutton.js
    for GeckoView.
---
 chrome/content/torbutton.js    | 3 ---
 components/startup-observer.js | 5 ++++-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/chrome/content/torbutton.js b/chrome/content/torbutton.js
index a9d4ccd1..d795f642 100644
--- a/chrome/content/torbutton.js
+++ b/chrome/content/torbutton.js
@@ -28,7 +28,6 @@ let {
   torbutton_log,
   torbutton_get_property_string,
 } = ChromeUtils.import("resource://torbutton/modules/utils.js", {});
-let SecurityPrefs = ChromeUtils.import("resource://torbutton/modules/security-prefs.js", {});
 let { configureControlPortModule } = Cu.import("resource://torbutton/modules/tor-control-port.js", {});
 
 const k_tb_last_browser_version_pref = "extensions.torbutton.lastBrowserVersion";
@@ -238,8 +237,6 @@ function torbutton_is_mobile() {
 torbutton_init = function() {
     torbutton_log(3, 'called init()');
 
-    SecurityPrefs.initialize();
-
     if (m_tb_wasinited) {
         return;
     }
diff --git a/components/startup-observer.js b/components/startup-observer.js
index 368d05f9..f9697987 100644
--- a/components/startup-observer.js
+++ b/components/startup-observer.js
@@ -26,6 +26,7 @@ XPCOMUtils.defineLazyModuleGetters(this, {
 });
 
 let NoScriptControl = ChromeUtils.import("resource://torbutton/modules/noscript-control.js", {});
+let SecurityPrefs = ChromeUtils.import("resource://torbutton/modules/security-prefs.js", {});
 
 // Module specific constants
 const kMODULE_NAME = "Startup";
@@ -192,9 +193,11 @@ StartupObserver.prototype = {
         // but only for hackish reasons.
         this._prefs.setBoolPref("extensions.torbutton.startup", true);
 
-	// We need to listen for NoScript before it starts.
+        // We need to listen for NoScript before it starts.
         NoScriptControl.initialize();
 
+        SecurityPrefs.initialize();
+
         this.setProxySettings();
       }
 



More information about the tor-commits mailing list