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); + } + } }