1
0
mirror of https://github.com/bitwarden/browser.git synced 2025-01-30 22:41:33 +01:00

[PM-5189] Fixing issue where unlocking account can focus the wrong field

This commit is contained in:
Cesar Gonzalez 2024-04-08 05:28:27 -05:00
parent 4914636800
commit 4c165617f0
No known key found for this signature in database
GPG Key ID: 3381A5457F8CCECF
3 changed files with 16 additions and 9 deletions

View File

@ -607,11 +607,18 @@ class OverlayBackground implements OverlayBackgroundInterface {
private async openOverlay(isFocusingFieldElement = false, isOpeningFullOverlay = false) {
const currentTab = await BrowserApi.getTabFromCurrentWindowId();
await BrowserApi.tabSendMessageData(currentTab, "openAutofillOverlay", {
isFocusingFieldElement,
isOpeningFullOverlay,
authStatus: await this.getAuthStatus(),
});
await BrowserApi.tabSendMessage(
currentTab,
{
command: "openAutofillOverlay",
isFocusingFieldElement,
isOpeningFullOverlay,
authStatus: await this.getAuthStatus(),
},
{
frameId: this.focusedFieldData?.tabId === currentTab.id ? this.focusedFieldData.frameId : 0,
},
);
}
/**

View File

@ -14,12 +14,12 @@ export type AutofillExtensionMessage = {
ciphers?: any;
isInlineMenuHidden?: boolean;
overlayElement?: string;
isFocusingFieldElement?: boolean;
authStatus?: AuthenticationStatus;
isOpeningFullOverlay?: boolean;
data?: {
authStatus?: AuthenticationStatus;
isFocusingFieldElement?: boolean;
isOverlayCiphersPopulated?: boolean;
direction?: "previous" | "next" | "current";
isOpeningFullOverlay?: boolean;
forceCloseOverlay?: boolean;
autofillOverlayVisibility?: number;
};

View File

@ -39,7 +39,7 @@ class AutofillOverlayContentService implements AutofillOverlayContentServiceInte
private autofillFieldKeywordsMap: WeakMap<AutofillField, string> = new WeakMap();
private eventHandlersMemo: { [key: string]: EventListener } = {};
readonly extensionMessageHandlers: AutofillOverlayContentExtensionMessageHandlers = {
openAutofillOverlay: ({ message }) => this.openAutofillOverlay(message.data),
openAutofillOverlay: ({ message }) => this.openAutofillOverlay(message),
addNewVaultItemFromOverlay: () => this.addNewVaultItem(),
blurMostRecentOverlayField: () => this.blurMostRecentOverlayField(),
bgUnlockPopoutOpened: () => this.blurMostRecentOverlayField(true),