diff --git a/apps/browser/src/autofill/background/overlay.background.ts b/apps/browser/src/autofill/background/overlay.background.ts index abbb870df66..c88e25b5aa7 100644 --- a/apps/browser/src/autofill/background/overlay.background.ts +++ b/apps/browser/src/autofill/background/overlay.background.ts @@ -440,7 +440,7 @@ export class OverlayBackground implements OverlayBackgroundInterface { return; } - if (this.isFieldCurrentlyFocused) { + if (sender.frameId === this.focusedFieldData?.frameId && this.isFieldCurrentlyFocused) { return; } @@ -984,6 +984,7 @@ export class OverlayBackground implements OverlayBackgroundInterface { } this.storeOverlayPort(port); + port.onDisconnect.addListener(this.handlePortOnDisconnect); port.onMessage.addListener(this.handleOverlayElementPortMessage); port.postMessage({ command: `initAutofillInlineMenu${isInlineMenuListPort ? "List" : "Button"}`,