More docs updates
This commit is contained in:
parent
1a9b4b4671
commit
63ebc41778
8 changed files with 44 additions and 40 deletions
|
@ -14,7 +14,7 @@ See [ipcMain](ipc-main.md) for code examples.
|
|||
|
||||
## Methods
|
||||
|
||||
The `ipcRenderer` module has the following method to listen for events:
|
||||
The `ipcRenderer` module has the following method to listen for events and send messages:
|
||||
|
||||
### `ipcRenderer.on(channel, listener)`
|
||||
|
||||
|
@ -46,14 +46,10 @@ Removes the specified `listener` from the listener array for the specified
|
|||
|
||||
Removes all listeners, or those of the specified `channel`.
|
||||
|
||||
## Sending Messages
|
||||
|
||||
The `ipcRenderer` module has the following methods for sending messages:
|
||||
|
||||
### `ipcRenderer.send(channel[, arg1][, arg2][, ...])`
|
||||
|
||||
* `channel` String
|
||||
* `arg` (optional)
|
||||
* `...args` any[]
|
||||
|
||||
Send a message to the main process asynchronously via `channel`, you can also
|
||||
send arbitrary arguments. Arguments will be serialized in JSON internally and
|
||||
|
@ -64,7 +60,7 @@ The main process handles it by listening for `channel` with `ipcMain` module.
|
|||
### `ipcRenderer.sendSync(channel[, arg1][, arg2][, ...])`
|
||||
|
||||
* `channel` String
|
||||
* `arg` (optional)
|
||||
* `...args` any[]
|
||||
|
||||
Send a message to the main process synchronously via `channel`, you can also
|
||||
send arbitrary arguments. Arguments will be serialized in JSON internally and
|
||||
|
@ -79,7 +75,7 @@ unless you know what you are doing you should never use it.
|
|||
### `ipcRenderer.sendToHost(channel[, arg1][, arg2][, ...])`
|
||||
|
||||
* `channel` String
|
||||
* `arg` (optional)
|
||||
* `...args` any[]
|
||||
|
||||
Like `ipcRenderer.send` but the event will be sent to the `<webview>` element in
|
||||
the host page instead of the main process.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue