From 91cc837be9f3b905e13ee4b2f813394b0372d9c1 Mon Sep 17 00:00:00 2001 From: Cesar Gonzalez Date: Wed, 21 Feb 2024 12:44:44 -0600 Subject: [PATCH] [PM-5839] [PM-5847] Set Bitwarden as Browser Default Autofill Bug Fixes (#8007) --- apps/browser/src/_locales/en/messages.json | 4 ---- .../src/autofill/popup/settings/autofill.component.ts | 6 +----- apps/browser/src/background/nativeMessaging.background.ts | 4 +++- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/apps/browser/src/_locales/en/messages.json b/apps/browser/src/_locales/en/messages.json index f0e3bbf3c9..b25acf8ce3 100644 --- a/apps/browser/src/_locales/en/messages.json +++ b/apps/browser/src/_locales/en/messages.json @@ -2974,10 +2974,6 @@ "message": "Ignoring this option may cause conflicts between the Bitwarden auto-fill menu and your browser's.", "description": "Dialog message facilitating the ability to override a chrome browser's default autofill behavior" }, - "overrideDefaultBrowserAutofillPrivacyRequiredDescription": { - "message": "This action will restart the Bitwarden extension. Ignoring this option may cause conflicts between the Bitwarden auto-fill menu and your browser's.", - "description": "Dialog message facilitating the ability to override a chrome browser's default autofill behavior" - }, "overrideDefaultBrowserAutoFillSettings": { "message": "Make Bitwarden your default password manager", "description": "Label for the setting that allows overriding the default browser autofill settings" diff --git a/apps/browser/src/autofill/popup/settings/autofill.component.ts b/apps/browser/src/autofill/popup/settings/autofill.component.ts index 20f44100a0..9e951e280d 100644 --- a/apps/browser/src/autofill/popup/settings/autofill.component.ts +++ b/apps/browser/src/autofill/popup/settings/autofill.component.ts @@ -210,13 +210,9 @@ export class AutofillComponent implements OnInit { return; } - const permissionGranted = await this.privacyPermissionGranted(); - const contentKey = permissionGranted - ? "overrideDefaultBrowserAutofillDescription" - : "overrideDefaultBrowserAutofillPrivacyRequiredDescription"; await this.dialogService.openSimpleDialog({ title: { key: "overrideDefaultBrowserAutofillTitle" }, - content: { key: contentKey }, + content: { key: "overrideDefaultBrowserAutofillDescription" }, acceptButtonText: { key: "makeDefault" }, acceptAction: async () => await this.handleOverrideDialogAccept(), cancelButtonText: { key: "ignore" }, diff --git a/apps/browser/src/background/nativeMessaging.background.ts b/apps/browser/src/background/nativeMessaging.background.ts index ece5536c56..3123b32372 100644 --- a/apps/browser/src/background/nativeMessaging.background.ts +++ b/apps/browser/src/background/nativeMessaging.background.ts @@ -87,7 +87,9 @@ export class NativeMessagingBackground { if (chrome?.permissions?.onAdded) { // Reload extension to activate nativeMessaging chrome.permissions.onAdded.addListener((permissions) => { - BrowserApi.reloadExtension(null); + if (permissions.permissions?.includes("nativeMessaging")) { + BrowserApi.reloadExtension(null); + } }); } }