JavaScripture
Contribute via GitHub Feedback

MessageChannel : Object

A message channel allows sending messages between contexts, such as two Workers, by transferring the MessageChannel's MessagePorts to the workers. See also Window.postMessage and BroadcastChannel.

Constructors

new MessageChannel() : MessageChannel

Example:

Run

Results:

 

Instance Properties

port1 : MessagePort  

The first port the channel.

port2 : MessagePort  

The second port the channel.