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:
@@ -7,12 +7,12 @@ export function handlePageControlMessage(
|
||||
message: { type: 'PAGE_CONTROL'; action: string; payload: any; targetTabId: number },
|
||||
sender: chrome.runtime.MessageSender,
|
||||
sendResponse: (response: unknown) => void
|
||||
): boolean {
|
||||
): true | undefined {
|
||||
const { action, payload, targetTabId } = message
|
||||
|
||||
if (action === 'get_my_tab_id') {
|
||||
sendResponse({ tabId: sender.tab?.id || null })
|
||||
return false
|
||||
return
|
||||
}
|
||||
|
||||
chrome.tabs
|
||||
|
||||
Reference in New Issue
Block a user