feat: add <webview>.sendToFrame() / frameId to 'ipc-message' event (#30451)

This commit is contained in:
Milan Burda 2021-08-25 09:46:46 +02:00 committed by GitHub
parent be43996d35
commit 501ac15b1d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 43 additions and 3 deletions

View file

@ -606,6 +606,21 @@ listening to the `channel` event with the [`ipcRenderer`](ipc-renderer.md) modul
See [webContents.send](web-contents.md#contentssendchannel-args) for
examples.
### `<webview>.sendToFrame(frameId, channel, ...args)`
* `frameId` [number, number] - `[processId, frameId]`
* `channel` String
* `...args` any[]
Returns `Promise<void>`
Send an asynchronous message to renderer process via `channel`, you can also
send arbitrary arguments. The renderer process can handle the message by
listening to the `channel` event with the [`ipcRenderer`](ipc-renderer.md) module.
See [webContents.sendToFrame](web-contents.md#contentssendtoframeframeid-channel-args) for
examples.
### `<webview>.sendInputEvent(event)`
* `event` [MouseInputEvent](structures/mouse-input-event.md) | [MouseWheelInputEvent](structures/mouse-wheel-input-event.md) | [KeyboardInputEvent](structures/keyboard-input-event.md)
@ -920,6 +935,7 @@ webview.addEventListener('close', () => {
Returns:
* `frameId` [number, number] - pair of `[processId, frameId]`.
* `channel` String
* `args` any[]