The Broadcast Channel API allows simple communication between browsing contexts (that is windows, tabs, frames, or iframes) with the same origin (usually pages from the same site).
By creating a BroadcastChannel
object, which is listening to the underlying channel, you are able to receive any message that has been posted to it. An interesting point is that you no longer have to maintain a reference to iframes
or workers
that you wish to communicate with. They can simply “subscribe” to particular channels by constructing a BroadcastChannel
, and have full-duplex (bi-directional) communication between all of them.
See MDN Web API Reference - Broadcast Channel