Skip to content

Commit

Permalink
chore: update ref to docs (🤖)
Browse files Browse the repository at this point in the history
  • Loading branch information
1 parent 3d93811 commit 6f78111
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/latest/.sha
Original file line number Diff line number Diff line change
@@ -1 +1 @@
600551766d0de3afe880c566dfce21ae03db6cd6
1472c5b090a58c9169ed11cdbd794dabd4fb7d64
12 changes: 12 additions & 0 deletions docs/latest/api/ipc-renderer.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,18 @@ The `ipcRenderer` module has the following method to listen for events and send
Listens to `channel`, when a new message arrives `listener` would be called with
`listener(event, args...)`.

:::warning

Do not expose the `event` argument to the renderer for security reasons! Wrap any
callback that you receive from the renderer in another function like this:
`ipcRenderer.on('my-channel', (event, ...args) => callback(...args))`.
Not wrapping the callback in such a function would expose dangerous Electron APIs
to the renderer process. See the
[security guide](../tutorial/security.md#20-do-not-expose-electron-apis-to-untrusted-web-content)
for more info.

:::

### `ipcRenderer.off(channel, listener)`

* `channel` string
Expand Down

0 comments on commit 6f78111

Please sign in to comment.