fix(ext): update message handlers

> If multiple listeners are registered for onMessage,
> only the first listener to respond, reject, or throw
> an error will affect the sender; all other listeners
> will run, but their results will be ignored.
This commit is contained in:
Simon
2026-01-29 18:37:42 +08:00
parent 5d77990187
commit 4e87940127
6 changed files with 18 additions and 16 deletions

View File

@@ -7,7 +7,7 @@ export function handleTabControlMessage(
message: { type: 'TAB_CONTROL'; action: TabAction; payload: any },
sender: chrome.runtime.MessageSender,
sendResponse: (response: unknown) => void
): boolean {
): true | undefined {
const { action, payload } = message
switch (action as TabAction) {
@@ -102,6 +102,6 @@ export function handleTabControlMessage(
default:
sendResponse({ error: `Unknown action: ${action}` })
return false
return
}
}