coderef

BroadcastChannelBaseline · Widely available

The BroadcastChannel API allows you to send messages between same-origin browsing contexts, such as between the same page loaded in multiple tabs.

Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Mar 14, 2022. Widely available since Sep 14, 2024.

Browser support

DesktopChrome
1–53Not supported
54+Supportedsince Oct 12, 2016
Current: 155
Edge
12–18Not supported
79+Supportedsince Jan 15, 2020
Current: 154
Firefox
1–37Not supported
38+Supportedsince May 12, 2015
Current: 157
Safari
1–15.3Not supported
15.4+Supportedsince Mar 14, 2022
Current: 27
MobileChrome Android
18–53Not supported
54+Supportedsince Oct 19, 2016
Current: 155
Firefox Android
4–37Not supported
38+Supportedsince May 12, 2015
Current: 157
Safari iOS
1–15.3Not supported
15.4+Supportedsince Mar 14, 2022
Current: 27

How to use

This feature is Baseline widely available — use it freely, no fallback needed.

Example

JS
// Every tab on the same origin that opens this channel gets the message
const channel = new BroadcastChannel("auth");

channel.postMessage({ type: "logout" });
channel.onmessage = (e) => {
  if (e.data.type === "logout") location.assign("/login");
};

Feature detection

JS · check before using
if ("BroadcastChannel" in globalThis) {
  // BroadcastChannel is available
} else {
  // load a polyfill or use a fallback
}

Sub-features

Support for each part of the feature (7). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
BroadcastChannel54793815.4543815.4
BroadcastChannel.BroadcastChannel54793815.4543815.4
BroadcastChannel.close54793815.4543815.4
BroadcastChannel.message_event54793815.4543815.4
BroadcastChannel.messageerror_event60795715.4605715.4
BroadcastChannel.name54793815.4543815.4
BroadcastChannel.postMessage54793815.4543815.4