Verified Commit 251b3892 authored by Richard Pospesel's avatar Richard Pospesel Committed by ma1
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 0d927b70
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -303,3 +303,5 @@ dom/base/test/jsmodules/import_circular_1.mjs
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
+2 −0
Original line number Diff line number Diff line
@@ -1532,3 +1532,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
@@ -131,3 +131,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");
+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
@@ -157,3 +157,10 @@ toolkit.jar:
# Third party files
   content/global/third_party/d3/d3.js                (/third_party/js/d3/d3.js)
   content/global/third_party/cfworker/json-schema.js (/third_party/js/cfworker/json-schema.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