Add ipcRenderer.sendTo
This commit is contained in:
parent
d55b96fdf5
commit
ae1f442b02
3 changed files with 39 additions and 2 deletions
|
@ -18,4 +18,12 @@ ipcRenderer.sendToHost = function (...args) {
|
|||
return binding.send('ipc-message-host', args)
|
||||
}
|
||||
|
||||
ipcRenderer.sendTo = function (webContentsId, channel, ...args) {
|
||||
if (typeof webContentsId !== 'number') {
|
||||
throw new TypeError(`First argument has to be webContentsId`)
|
||||
}
|
||||
|
||||
ipcRenderer.send('ELECTRON_BROWSER_SEND_TO', webContentsId, channel, ...args)
|
||||
}
|
||||
|
||||
module.exports = ipcRenderer
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue