Commit 54f10a71 authored by Richard Pospesel's avatar Richard Pospesel Committed by jwilde
Browse files

TB 40597: Implement TorSettings module

- migrated in-page settings read/write implementation from about:preferences#tor
  to the TorSettings module
- TorSettings initially loads settings from the tor daemon, and saves them to
  firefox prefs
- TorSettings notifies observers when a setting has changed; currently only
  QuickStart notification is implemented for parity with previous preference
  notify logic in about:torconnect and about:preferences#tor
- about:preferences#tor, and about:torconnect now read and write settings
  thorugh the TorSettings module
- all tor settings live in the torbrowser.settings.* preference branch
- removed unused pref modify permission for about:torconnect content page from
  AsyncPrefs.jsm

Bug 40645: Migrate Moat APIs to Moat.jsm module
parent 13f8a2d1
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1810,3 +1810,5 @@ xpcom/idl-parser/xpidl/fixtures/xpctest.d.json
browser/app/profile/001-base-profile.js
browser/app/profile/000-tor-browser.js
mobile/android/app/000-tor-browser-android.js
toolkit/content/pt_config.json
toolkit/content/moat_countries_dev_build.json
+3 −0
Original line number Diff line number Diff line
@@ -134,3 +134,6 @@ pref("extensions.torlauncher.moat_service", "https://bridges.torproject.org/moat
pref("browser.tor_provider.log_level", "Warn");
pref("browser.tor_provider.cp_log_level", "Warn");
pref("lox.log_level", "Warn");
pref("torbrowser.bootstrap.log_level", "Info");
pref("browser.torsettings.log_level", "Warn");
pref("browser.torMoat.loglevel", "Warn");
+2 −0
Original line number Diff line number Diff line
@@ -318,4 +318,6 @@ export default [
  "browser/app/profile/001-base-profile.js",
  "browser/app/profile/000-tor-browser.js",
  "mobile/android/app/000-tor-browser-android.js",
  "toolkit/content/pt_config.json",
  "toolkit/content/moat_contries_dev_build.json",
];
+7 −0
Original line number Diff line number Diff line
@@ -3,8 +3,10 @@ const lazy = {};
// We will use the modules only when the profile is loaded, so prefer lazy
// loading
ChromeUtils.defineESModuleGetters(lazy, {
  TorConnect: "resource://gre/modules/TorConnect.sys.mjs",
  TorLauncherUtil: "resource://gre/modules/TorLauncherUtil.sys.mjs",
  TorProviderBuilder: "resource://gre/modules/TorProviderBuilder.sys.mjs",
  TorSettings: "resource://gre/modules/TorSettings.sys.mjs",
});

/* Browser observer topis */
@@ -33,11 +35,15 @@ export class TorStartupService {
  #init() {
    Services.obs.addObserver(this, BrowserTopics.QuitApplicationGranted);

    lazy.TorSettings.init();

    // Theoretically, build() is expected to await the initialization of the
    // provider, and anything needing the Tor Provider should be able to just
    // await on TorProviderBuilder.build().
    lazy.TorProviderBuilder.init();

    lazy.TorConnect.init();

    gInited = true;
  }

@@ -46,5 +52,6 @@ export class TorStartupService {

    lazy.TorProviderBuilder.uninit();
    lazy.TorLauncherUtil.cleanupTempDirectories();
    lazy.TorSettings.uninit();
  }
}
+7 −0
Original line number Diff line number Diff line
@@ -222,3 +222,10 @@ toolkit.jar:
   content/global/vendor/react-transition-group.js (vendor/react/react-transition-group.js)
   content/global/vendor/redux.js (vendor/react/redux.js)
   content/global/vendor/react-redux.js (vendor/react/react-redux.js)

   # The pt_config.json content should be replaced in the omni.ja in
   # tor-browser-build. See tor-browser#42343.
   content/global/pt_config.json               (pt_config.json)
   # The moat_countries.json content should be replaced in the omni.ja in
   # tor-browser-build. See tor-browser#43463.
   content/global/moat_countries.json          (moat_countries_dev_build.json)
Loading