fix: retire extension iframe event listeners with native frame (#35011)

Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
This commit is contained in:
OrcaWin
2026-10-28 08:42:02 -07:00
committed by GitHub
co-authored by OrcaWin
parent 2657567db0
commit bc80bc59fb
9 changed files with 384 additions and 54 deletions
+3
View File
@@ -12,6 +12,9 @@ export const BROWSER_EXTENSION_INVOKE_CHANNEL = 'browserExtension:invoke'
/** Main → extension context, only for events that context registered. Payload: BrowserExtensionEventPayload. */
export const BROWSER_EXTENSION_EVENT_CHANNEL = 'browserExtension:event'
/** Main → listening frame. The transferred port owns the frame's listener registrations. */
export const BROWSER_EXTENSION_FRAME_LIFETIME_CHANNEL = 'browserExtension:frameLifetime'
export type BrowserExtensionInvokeRequest =
| { type: 'call'; namespace: string; method: string; args: unknown[] }
// Why: lets main skip contexts with no listener and restart a stopped worker only when it listens.