From 3c5fcfc7ef5f16a88259c8169992987ae017510d Mon Sep 17 00:00:00 2001 From: Nick Krantz <125900171+nick-livefront@users.noreply.github.com> Date: Mon, 11 Aug 2025 09:44:51 -0500 Subject: [PATCH] Navigate the user from the autofill nudge to the proper destination based on their browser (#15876) --- .../autofill/popup/settings/autofill.component.html | 2 +- .../autofill/popup/settings/autofill.component.ts | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/apps/browser/src/autofill/popup/settings/autofill.component.html b/apps/browser/src/autofill/popup/settings/autofill.component.html index 543c7482bf7..985a0962c95 100644 --- a/apps/browser/src/autofill/popup/settings/autofill.component.html +++ b/apps/browser/src/autofill/popup/settings/autofill.component.html @@ -12,7 +12,7 @@ [subtitle]="'autofillSpotlightDesc' | i18n" [buttonText]="spotlightButtonText" (onDismiss)="dismissSpotlight()" - (onButtonClick)="openURI($event, disablePasswordManagerURI)" + (onButtonClick)="disableBrowserAutofillSettingsFromNudge($event)" [buttonIcon]="spotlightButtonIcon" > diff --git a/apps/browser/src/autofill/popup/settings/autofill.component.ts b/apps/browser/src/autofill/popup/settings/autofill.component.ts index 19afb903cb8..dcce3f37368 100644 --- a/apps/browser/src/autofill/popup/settings/autofill.component.ts +++ b/apps/browser/src/autofill/popup/settings/autofill.component.ts @@ -585,4 +585,16 @@ export class AutofillComponent implements OnInit { } return hints; } + + /** Navigates the user from the Autofill Nudge to the proper destination based on their browser. */ + async disableBrowserAutofillSettingsFromNudge(event: Event) { + // When we can programmatically disable the autofill setting, do that first + // otherwise open the appropriate URI for the browser + if (this.canOverrideBrowserAutofillSetting) { + this.defaultBrowserAutofillDisabled = true; + await this.updateDefaultBrowserAutofillDisabled(); + } else { + await this.openURI(event, this.disablePasswordManagerURI); + } + } }