fix(ext): sw calling robust
This commit is contained in:
@@ -53,6 +53,10 @@ export function initPageController() {
|
||||
|
||||
chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
|
||||
if (message.type !== 'PAGE_CONTROL') {
|
||||
sendResponse({
|
||||
success: false,
|
||||
error: `[RemotePageController.ContentScript]: Invalid message type: ${message.type}`,
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -8,11 +8,6 @@ export function handleTabControlMessage(
|
||||
sender: chrome.runtime.MessageSender,
|
||||
sendResponse: (response: unknown) => void
|
||||
): boolean {
|
||||
if (message.type !== 'TAB_CONTROL') {
|
||||
sendResponse({ error: 'Invalid message type' })
|
||||
return false
|
||||
}
|
||||
|
||||
const { action, payload } = message
|
||||
|
||||
switch (action as TabAction) {
|
||||
|
||||
Reference in New Issue
Block a user