Implement port.sender

This commit is contained in:
Cheng Zhao 2016-05-28 16:01:16 +09:00
parent f5b430d9e1
commit db94121360
2 changed files with 23 additions and 18 deletions

View file

@ -93,7 +93,7 @@ ipcMain.on('CHROME_RUNTIME_CONNECT', function (event, hostname, connectInfo) {
event.sender.once('render-view-deleted', () => {
page.webContents.sendToAll(`CHROME_PORT_ONDISCONNECT_${portId}`)
})
page.webContents.sendToAll('CHROME_RUNTIME_ONCONNECT', event.sender.id, portId, connectInfo)
page.webContents.sendToAll('CHROME_RUNTIME_ONCONNECT', event.sender.id, portId, hostname, connectInfo)
})
ipcMain.on('CHROME_PORT_DISCONNECT', function (event, webContentsId, portId) {