Skip to content

Commit 040ee66

Browse files
authored
docs: note about structured clone and DOM types (electron#26516)
1 parent c78ac24 commit 040ee66

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

docs/api/ipc-renderer.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,15 @@ Algorithm][SCA], just like [`window.postMessage`][], so prototype chains will no
6161
included. Sending Functions, Promises, Symbols, WeakMaps, or WeakSets will
6262
throw an exception.
6363

64-
> **NOTE**: Sending non-standard JavaScript types such as DOM objects or
64+
> **NOTE:** Sending non-standard JavaScript types such as DOM objects or
6565
> special Electron objects is deprecated, and will begin throwing an exception
6666
> starting with Electron 9.
6767
68+
> **NOTE:** Since the main process does not have support for DOM objects such as
69+
> `ImageBitmap`, `File`, `DOMMatrix` and so on, such objects cannot be sent over
70+
> Electron's IPC to the main process, as the main process would have no way to decode
71+
> them. Attempting to send such objects over IPC will result in an error.
72+
6873
The main process handles it by listening for `channel` with the
6974
[`ipcMain`](ipc-main.md) module.
7075

@@ -89,6 +94,11 @@ throw an exception.
8994
> special Electron objects is deprecated, and will begin throwing an exception
9095
> starting with Electron 9.
9196
97+
> **NOTE:** Since the main process does not have support for DOM objects such as
98+
> `ImageBitmap`, `File`, `DOMMatrix` and so on, such objects cannot be sent over
99+
> Electron's IPC to the main process, as the main process would have no way to decode
100+
> them. Attempting to send such objects over IPC will result in an error.
101+
92102
The main process should listen for `channel` with
93103
[`ipcMain.handle()`](ipc-main.md#ipcmainhandlechannel-listener).
94104

@@ -128,6 +138,11 @@ throw an exception.
128138
> special Electron objects is deprecated, and will begin throwing an exception
129139
> starting with Electron 9.
130140
141+
> **NOTE:** Since the main process does not have support for DOM objects such as
142+
> `ImageBitmap`, `File`, `DOMMatrix` and so on, such objects cannot be sent over
143+
> Electron's IPC to the main process, as the main process would have no way to decode
144+
> them. Attempting to send such objects over IPC will result in an error.
145+
131146
The main process handles it by listening for `channel` with [`ipcMain`](ipc-main.md) module,
132147
and replies by setting `event.returnValue`.
133148

0 commit comments

Comments
 (0)