return
}
- page.webContents.sendToAll(`CHROME_RUNTIME_ONMESSAGE_${extensionId}`, message)
+ page.webContents.sendToAll(`CHROME_RUNTIME_ONMESSAGE_${extensionId}`, event.sender.id, message)
})
ipcMain.on('CHROME_TABS_EXECUTESCRIPT', function (event, requestId, webContentsId, extensionId, details) {
chrome.runtime.onConnect.emit(new Port(webContentsId, portId, extensionId, connectInfo.name))
})
- ipcRenderer.on(`CHROME_RUNTIME_ONMESSAGE_${extensionId}`, (event, message) => {
- chrome.runtime.onMessage.emit(message)
+ ipcRenderer.on(`CHROME_RUNTIME_ONMESSAGE_${extensionId}`, (event, tabId, message) => {
+ chrome.runtime.onMessage.emit(message, new MessageSender(tabId, extensionId))
})
chrome.runtime = {
if (responseCallback) {
console.error('responseCallback is not supported')
}
- ipcRenderer.sendToAll(tabId, `CHROME_RUNTIME_ONMESSAGE_${extensionId}`, message)
- }
+ ipcRenderer.send('CHROME_RUNTIME_SENDMESSAGE', extensionId, message)
+ },
+
+ onUpdated: new Event()
}
chrome.extension = {