Interface

MessagePort

MessagePort

This Channel Messaging API interface represents one of the two ports of a MessageChannel, allowing messages to be sent from one port and listening out for them arriving at the other.

View Source js/lib.dom.d.ts, line 4977

Members

void

# close

Disconnects the port, so that it is no longer active.

View Source js/lib.dom.d.ts, line 4980

void

# postMessage

Posts a message through the channel. Objects listed in transfer are transferred, not just cloned, meaning that they are no longer usable on the sending side.

Throws a "DataCloneError" DOMException if transfer contains duplicate objects or port, or if message could not be cloned.

View Source js/lib.dom.d.ts, line 4985

void

# start

Begins dispatching messages received on the port.

View Source js/lib.dom.d.ts, line 4992