ElectronIpcRenderer.postMessage method
ElectronIpcRenderer › postMessage
Unofficial
Sends a message to the main process, optionally transferring ownership of zero or moreMessagePort objects. The transferred ports are available in the main process as MessagePortMain objects via the ports property of the emitted event. Signature:
postMessage(channel: string, message: unknown, transfer?: MessagePort[] | undefined): voidParameters:
| Parameter | Type | Description |
|---|---|---|
| channel | string | The IPC channel name. |
| message | unknown | The message to send. |
| transfer? | MessagePort[] | undefined | Optional transferable MessagePort objects. |
Returns: void