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:
@@ -53,12 +53,12 @@ export function initPageController() {
|
||||
}
|
||||
}, 1_000)
|
||||
|
||||
chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
|
||||
chrome.runtime.onMessage.addListener((message, sender, sendResponse): true | undefined => {
|
||||
if (message.type !== 'PAGE_CONTROL') {
|
||||
sendResponse({
|
||||
success: false,
|
||||
error: `[RemotePageController.ContentScript]: Invalid message type: ${message.type}`,
|
||||
})
|
||||
// sendResponse({
|
||||
// success: false,
|
||||
// error: `[RemotePageController.ContentScript]: Invalid message type: ${message.type}`,
|
||||
// })
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user