Channel messagingBaseline · Widely available
Channel messaging communicates one-to-one between browsing contexts on the same origin, such as between <iframe> elements or two documents using a shared worker.
Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Sep 22, 2015. Widely available since Mar 22, 2018.
Browser support
DesktopChrome
1–3Not supported
4+Supportedsince Jan 25, 2010
Current: 155Edge
12+Supportedsince Jul 29, 2015
Current: 154Firefox
1–40Not supported
41+Supportedsince Sep 22, 2015
Current: 157Safari
1–4Not supported
5+Supportedsince Jun 7, 2010
Current: 27MobileChrome Android
18+Supportedsince Jun 27, 2012
Current: 155Firefox Android
4–40Not supported
41+Supportedsince Sep 22, 2015
Current: 157Safari iOS
1–4Not supported
4.2+Supportedsince Nov 22, 2010
Current: 27How to use
This feature is Baseline widely available — use it freely, no fallback needed.
Example
Full syntax and examples are on MDN: MessageChannel.
Feature detection
JS · check before using
if ("MessageChannel" in globalThis) {
// MessageChannel is available
} else {
// load a polyfill or use a fallback
}Documentation (MDN)
Specification
Usage share
Sub-features
Support for each part of the feature (11). The overall table above shows when the whole feature works.
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| MessageChannel | 2 | 12 | 41 | 5 | 18 | 41 | 4.2 |
| MessageChannel.MessageChannel | 2 | 12 | 41 | 5 | 18 | 41 | 4.2 |
| MessageChannel.port1 | 2 | 12 | 41 | 5 | 18 | 41 | 4.2 |
| MessageChannel.port2 | 2 | 12 | 41 | 5 | 18 | 41 | 4.2 |
| MessageEvent.ports | 4 | 12 | 3 | 4 | 18 | 4 | 3.2 |
| MessagePort | 2 | 12 | 41 | 5 | 18 | 41 | 4.2 |
| MessagePort.close | 2 | 12 | 41 | 5 | 18 | 41 | 4.2 |
| MessagePort.message_event | 2 | 12 | 41 | 5 | 18 | 41 | 4.2 |
| MessagePort.postMessage | 2 | 12 | 41 | 5 | 18 | 41 | 4.2 |
| MessagePort.start | 2 | 12 | 41 | 5 | 18 | 41 | 4.2 |
| MessagePort.worker_support | 4 | 12 | 41 | 5 | 18 | 41 | 4.2 |