Skip to content

ElectronMessagePortMain.postMessage method

ElectronMessagePortMain › postMessage

Unofficial

Sends a message from the port, and optionally, transfers ownership of objects to other browsing contexts.

Signature:

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

Parameters:

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

Returns: void