diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js index b04b127388bdd..a5fe5136876d3 100644 --- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js @@ -322,6 +322,9 @@ pref("browser.startup.couldRestoreSession.count", 0); // users as it is not implemented anywhere else. #if defined(XP_WIN) pref("browser.startup.preXulSkeletonUI", true); + +// Whether the checkbox to enable Windows launch on login is shown +pref("browser.startup.windowsLaunchOnLogin.enabled", false); #endif // Show an upgrade dialog on major upgrades. diff --git a/browser/components/preferences/main.inc.xhtml b/browser/components/preferences/main.inc.xhtml index 243182def221a..8485423b384ad 100644 --- a/browser/components/preferences/main.inc.xhtml +++ b/browser/components/preferences/main.inc.xhtml @@ -30,7 +30,7 @@ #ifdef XP_WIN - + diff --git a/browser/components/preferences/main.js b/browser/components/preferences/main.js index fd74f6c1863e8..ed03b96581c8e 100644 --- a/browser/components/preferences/main.js +++ b/browser/components/preferences/main.js @@ -13,6 +13,7 @@ ChromeUtils.defineESModuleGetters(this, { MigrationUtils: "resource:///modules/MigrationUtils.sys.mjs", TranslationsParent: "resource://gre/actors/TranslationsParent.sys.mjs", WindowsLaunchOnLogin: "resource://gre/modules/WindowsLaunchOnLogin.sys.mjs", + NimbusFeatures: "resource://nimbus/ExperimentAPI.sys.mjs", }); // Constants & Enumeration Values @@ -418,6 +419,12 @@ var gMainPane = { "command", gMainPane.onWindowsLaunchOnLoginChange ); + NimbusFeatures.windowsLaunchOnLogin.recordExposureEvent({ + once: true, + }); + if (NimbusFeatures.windowsLaunchOnLogin.getVariable("enabled")) { + document.getElementById("windowsLaunchOnLoginBox").hidden = false; + } } gMainPane.updateBrowserStartupUI = gMainPane.updateBrowserStartupUI.bind(gMainPane); diff --git a/browser/components/preferences/tests/browser_windows_launch_on_login.js b/browser/components/preferences/tests/browser_windows_launch_on_login.js index 13476a2e35047..fb13cb4de4c36 100644 --- a/browser/components/preferences/tests/browser_windows_launch_on_login.js +++ b/browser/components/preferences/tests/browser_windows_launch_on_login.js @@ -10,6 +10,13 @@ ChromeUtils.defineESModuleGetters(this, { WindowsLaunchOnLogin: "resource://gre/modules/WindowsLaunchOnLogin.sys.mjs", }); +add_setup(async function () { + // Ensure checkbox is enabled before running tests + await SpecialPowers.pushPrefEnv({ + set: [["browser.startup.windowsLaunchOnLogin.enabled", true]], + }); +}); + add_task(async function test_check_checkbox() { await WindowsLaunchOnLogin.withLaunchOnLoginRegistryKey(async wrk => { // Open preferences to general pane @@ -104,6 +111,7 @@ add_task(async function delete_external_regkey() { }); registerCleanupFunction(async function () { + await SpecialPowers.popPrefEnv(); await WindowsLaunchOnLogin.withLaunchOnLoginRegistryKey(async wrk => { let registryName = WindowsLaunchOnLogin.getLaunchOnLoginRegistryName(); if (wrk.hasValue(registryName)) { diff --git a/toolkit/components/nimbus/FeatureManifest.yaml b/toolkit/components/nimbus/FeatureManifest.yaml index 30798d2ad8ef2..d7d5d1e51f653 100644 --- a/toolkit/components/nimbus/FeatureManifest.yaml +++ b/toolkit/components/nimbus/FeatureManifest.yaml @@ -518,6 +518,19 @@ moreFromMozilla: fallbackPref: browser.preferences.moreFromMozilla.template description: UI template used to display Mozilla products. Possible values simple, advanced. Default is simple. +windowsLaunchOnLogin: + description: "New checkbox in about:preferences startup section to start Firefox on Windows login" + owner: omc@mozilla.com + hasExposure: true + exposureDescription: >- + Exposure is sent once per browsing session when the about:preferences URL is + first accessed. + variables: + enabled: + type: boolean + fallbackPref: browser.startup.windowsLaunchOnLogin.enabled + description: Should users see the Windows launch on login checkbox. + abouthomecache: description: "The startup about:home cache." owner: omc@mozilla.com