|
@@ -86,8 +86,8 @@ exports.injectTo = function (extensionId, context) {
|
|
|
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 = {
|
|
@@ -148,8 +148,10 @@ exports.injectTo = function (extensionId, context) {
|
|
|
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 = {
|