feat: add event.senderId property to IPCs sent via ipcRenderer.sendTo (#14395)
This commit is contained in:
parent
b89848d683
commit
c17a1b37ea
11 changed files with 90 additions and 31 deletions
|
@ -89,3 +89,17 @@ Sends a message to a window with `windowid` via `channel`.
|
|||
|
||||
Like `ipcRenderer.send` but the event will be sent to the `<webview>` element in
|
||||
the host page instead of the main process.
|
||||
|
||||
## Event object
|
||||
|
||||
The `event` object passed to the `callback` has the following methods:
|
||||
|
||||
### `event.senderId`
|
||||
|
||||
Returns the `webContents.id` that sent the message, you can call
|
||||
`event.sender.sendTo(event.senderId, ...)` to reply to the message, see
|
||||
[ipcRenderer.sendTo][ipc-renderer-sendto] for more information.
|
||||
This only applies to messages sent from a different renderer.
|
||||
Messages sent directly from the main process set `event.senderId` to `0`.
|
||||
|
||||
[ipc-renderer-sendto]: #ipcrenderersendtowindowid-channel--arg1-arg2-
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue