Skip to content

ElectronWebFrameMain.postMessage method

ElectronWebFrameMain › postMessage

Unofficial

Sends a message to the renderer process, optionally transferring ownership of MessagePortMain objects.

Signature:

postMessage(channel: string, message: unknown, transfer?: ElectronMessagePortMain[]): void

Parameters:

ParameterTypeDescription
channelstringThe channel name.
messageunknownThe message to send.
transfer?ElectronMessagePortMain[]Message ports whose ownership is transferred with the message.

Returns: void