Results 1 - 20 of 20

MessageChannel.port1

The port1 read-only property of the MessageChannel interface returns the first port of the message channel, the port attached to the context that originated the channel.
API Channel messaging HTML5 Message Channel API MessageChannel Property Reference

Channel Messaging API

The Channel Messaging API allows two separate scripts running in different browsing contexts attached to the same document (e.g., two IFrames, or the main document and an IFrame, two documents via a SharedWorker, or two workers) to communicate directly, passing messages between one another through two-way channels (or pipes) with a port at each end.
API Channel messaging HTML API Overview Reference

Using channel messaging

The Channel Messaging API allows two separate scripts running in different browsing contexts attached to the same document (e.g., two IFrames, or the main document and an IFrame, or two documents via a SharedWorker) to communicate directly, passing messages between one another through two-way channels (or pipes) with a port at each end. In this article we'll explore the basics of using this technology.
API Channel messaging HTML5 MessageChannel MessagePort Tutorial

MessageChannel()

The MessageChannel() constructor of the MessageChannel interface returns a new MessageChannel object with two new MessagePort objects.
API Channel messaging Constructor MessageChannel Reference

MessagePort

The MessagePort interface of the Channel Messaging API represents one of the two ports of a MessageChannel, allowing sending of messages from one port and listening out for them arriving at the other.
API Channel messaging HTML5 Interface MessagePort Reference

MessagePort.close()

The close() method of the MessagePort interface disconnects the port, so it is no longer active. This stops the flow of messages to that port.
API Channel messaging close MessagePort Method Reference

MessagePort.onmessage

The onmessage event handler of the MessagePort interface is an EventListener, called whenever an MessageEvent of type message is fired on the port — that is, when the port receives a message.
API Channel messaging MessagePort onmessage Property Reference

MessagePort.postMessage()

The postMessage() method of the MessagePort interface sends a message from the port, and optionally, transfers ownership of objects to other browsing contexts.
API Channel messaging MessagePort Method postMessage Reference

MessagePort.start()

The start() method of the MessagePort interface starts the sending of messages queued on the port. This method is only needed when using EventTarget.addEventListener; it is implied when using MessageChannel.onmessage.
API Channel messaging MessagePort Method Reference start

MessageChannel

The MessageChannel interface of the Channel Messaging API allows us to create a new message channel and send data through it via its two MessagePort properties.
API Channel Messaging API Interface MessageChannel Reference web messaging

MessageChannel.port2

The port2 read-only property of the MessageChannel interface returns second port of the message channel, the port attached to the context at the other end of the channel, which the message is initially sent to.
API Channel messaging HTML5 MessageChannel port2 Property Reference