commit d82dd0a2608c44b6808e39cbb47fbbccd91105d0 parent d2f1901743bfbb1c45f3acbdb010f7d232c1da99 Author: niklasbaumgardner <niklasbaumgardner@gmail.com> Date: Wed, 29 Oct 2025 16:47:42 +0000 Bug 1992203 - Don't show backup welcome messaging for copied profiles. r=profiles-reviewers,omc-reviewers,kpatenio,jhirsch,emcminn Differential Revision: https://phabricator.services.mozilla.com/D269459 Diffstat:
3 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/browser/components/asrouter/modules/OnboardingMessageProvider.sys.mjs b/browser/components/asrouter/modules/OnboardingMessageProvider.sys.mjs @@ -2028,7 +2028,7 @@ const BASE_MESSAGES = () => [ ], }, targeting: - "source == 'startup' && !doesAppNeedPin && (!'browser.shell.checkDefaultBrowser'|preferenceValue || isDefaultBrowser) && !willShowDefaultPrompt && 'browser.backup.profile-restoration-date'|preferenceValue", + "source == 'startup' && !doesAppNeedPin && (!'browser.shell.checkDefaultBrowser'|preferenceValue || isDefaultBrowser) && !willShowDefaultPrompt && 'browser.backup.profile-restoration-date'|preferenceValue && !'browser.profiles.profile-copied'|preferenceValue", trigger: { id: "defaultBrowserCheck", }, @@ -2133,7 +2133,7 @@ const BASE_MESSAGES = () => [ ], }, targeting: - "source == 'startup' && doesAppNeedPin && 'browser.shell.checkDefaultBrowser'|preferenceValue && !isDefaultBrowser && !willShowDefaultPrompt && 'browser.backup.profile-restoration-date'|preferenceValue", + "source == 'startup' && doesAppNeedPin && 'browser.shell.checkDefaultBrowser'|preferenceValue && !isDefaultBrowser && !willShowDefaultPrompt && 'browser.backup.profile-restoration-date'|preferenceValue && !'browser.profiles.profile-copied'|preferenceValue", trigger: { id: "defaultBrowserCheck", }, @@ -2216,7 +2216,7 @@ const BASE_MESSAGES = () => [ ], }, targeting: - "source == 'startup' && !doesAppNeedPin && 'browser.shell.checkDefaultBrowser'|preferenceValue && !isDefaultBrowser && !willShowDefaultPrompt && 'browser.backup.profile-restoration-date'|preferenceValue", + "source == 'startup' && !doesAppNeedPin && 'browser.shell.checkDefaultBrowser'|preferenceValue && !isDefaultBrowser && !willShowDefaultPrompt && 'browser.backup.profile-restoration-date'|preferenceValue && !'browser.profiles.profile-copied'|preferenceValue", trigger: { id: "defaultBrowserCheck", }, @@ -2310,7 +2310,7 @@ const BASE_MESSAGES = () => [ ], }, targeting: - "source == 'startup' && doesAppNeedPin && !willShowDefaultPrompt &&(!'browser.shell.checkDefaultBrowser'|preferenceValue || isDefaultBrowser) && 'browser.backup.profile-restoration-date'|preferenceValue", + "source == 'startup' && doesAppNeedPin && !willShowDefaultPrompt &&(!'browser.shell.checkDefaultBrowser'|preferenceValue || isDefaultBrowser) && 'browser.backup.profile-restoration-date'|preferenceValue && !'browser.profiles.profile-copied'|preferenceValue", trigger: { id: "defaultBrowserCheck", }, diff --git a/browser/components/backup/BackupService.sys.mjs b/browser/components/backup/BackupService.sys.mjs @@ -1497,6 +1497,8 @@ export class BackupService extends EventTarget { // reset the error state prefs Services.prefs.clearUserPref(BACKUP_DEBUG_INFO_PREF_NAME); Services.prefs.setIntPref(BACKUP_ERROR_CODE_PREF_NAME, ERRORS.NONE); + // reset profile copied pref so the backup welcome messaging will show + Services.prefs.clearUserPref("browser.profiles.profile-copied"); try { lazy.logConsole.debug( diff --git a/browser/components/profiles/SelectableProfile.sys.mjs b/browser/components/profiles/SelectableProfile.sys.mjs @@ -474,11 +474,19 @@ export class SelectableProfile { } async copyProfile() { + // This pref is used to control targeting for the backup welcome messaging. + // If this pref is set, the backup welcome messaging will not show. + // We set the pref here so the copied profile will inherit this pref and + // the copied profile will not show the backup welcome messaging. + Services.prefs.setBoolPref("browser.profiles.profile-copied", true); const backupServiceInstance = BackupService.init(); let result = await backupServiceInstance.createAndPopulateStagingFolder( this.path ); + // Clear the pref now that the copied profile has inherited it. + Services.prefs.clearUserPref("browser.profiles.profile-copied"); + if (result.error) { throw result.error; }