--- title: BroadcastChannel slug: Web/API/BroadcastChannel tags: - API - Broadcast Channel API - Experimental - HTML API - Interface - Reference translation_of: Web/API/BroadcastChannel ---
{{APIRef("Broadcast Channel API")}}
The BroadcastChannel
interface represents a named channel that any {{glossary("browsing context")}} of a given {{glossary("origin")}} can subscribe to. It allows communication between different documents (in different windows, tabs, frames or iframes) of the same origin. Messages are broadcasted via a {{event("message")}} event fired at all BroadcastChannel
objects listening to the channel.
{{AvailableInWorkers}}
This interface also inherits properties from its parent, {{domxref("EventTarget")}}.
This interface also inherits methods from its parent, {{domxref("EventTarget")}}.
BroadcastChannel
object listening to the same channel.message
onmessage
property.messageerror
onmessageerror
property.Specification | Status | Comment |
---|---|---|
{{SpecName('HTML WHATWG', "comms.html#broadcastchannel", "BroadcastChannel")}} | {{Spec2('HTML WHATWG')}} | Initial definition. |
{{Compat("api.BroadcastChannel")}}