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[] | undefined): void

Parameters:

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

Returns: void