Channel Messaging API
Checking compatibility...
Enable direct communication between different browsing contexts (like iframes and workers) using two-way channels with a port at each end. Perfect for secure cross-context messaging.
The Channel Messaging API requires multiple browsing contexts (windows, tabs, or iframes) to be open for communication. Messages are only received by contexts that are actively listening on the same channel name.
Basic Channel Communication
This example shows how to set up a direct messaging connection between your main page and an embedded iframe, allowing them to exchange information privately.
=
=
=
=
=
=
Output
Click Run to see output...
Interactive Messaging
This example creates a complete chat interface between your main page and an iframe, demonstrating how to build interactive communication systems within your app.
=
=
=
=
=
=
Output
Click Run to see output...