commit d210619ba68c1dd463e6b8f7305e56b937477bea
parent 238c28a469049199a54e92fcf5b9a55a379c5867
Author: Andrea Marchesini <amarchesini@mozilla.com>
Date: Tue, 14 Oct 2025 18:44:40 +0000
Bug 1990007 - IPProtectionService early startup, r=Gijs,ip-protection-reviewers,fchasen
Differential Revision: https://phabricator.services.mozilla.com/D268324
Diffstat:
2 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/browser/components/BrowserComponents.manifest b/browser/components/BrowserComponents.manifest
@@ -19,6 +19,7 @@ category browser-before-ui-startup moz-src:///browser/components/privatebrowsing
category browser-before-ui-startup resource:///modules/AboutHomeStartupCache.sys.mjs AboutHomeStartupCache.init
category browser-before-ui-startup resource:///modules/AccountsGlue.sys.mjs AccountsGlue.init
category browser-before-ui-startup moz-src:///browser/modules/ObserverForwarder.sys.mjs ObserverForwarder.init
+category browser-before-ui-startup resource:///modules/ipprotection/IPProtectionService.sys.mjs IPProtectionService.maybeEarlyInit
# Browser window lifecycle consumers
category browser-window-domcontentloaded-before-tabbrowser resource:///modules/BrowserDOMWindow.sys.mjs BrowserDOMWindow.setupInWindow
diff --git a/browser/components/ipprotection/IPProtectionService.sys.mjs b/browser/components/ipprotection/IPProtectionService.sys.mjs
@@ -138,6 +138,19 @@ class IPProtectionServiceSingleton extends EventTarget {
}
/**
+ * Setups the IPProtectionService if enabled early during the firefox startup
+ * phases.
+ */
+ async maybeEarlyInit() {
+ if (
+ this.featureEnabled &&
+ Services.prefs.getBoolPref("browser.ipProtection.autoStartEnabled")
+ ) {
+ await this.init();
+ }
+ }
+
+ /**
* Setups the IPProtectionService if enabled.
*/
async init() {