v148 · web workers · android · shipped
SharedWorker on Android
SharedWorker — long available on desktop — now ships on Android in Chrome 148. Shared workers allow multiple browsing contexts (tabs, iframes, workers) in the same origin to share a single background worker instance and communicate through its port interface. Ships in Chrome 148 on Android and WebView.
this API is documented on MDN
SharedWorker — Web APIs | MDN Web DocsMDN's SharedWorker page covers the full API. Chrome 148 browser-compat data for Android will be reflected once MDN is updated.
at a glance
| Shipped in | Chrome 148 (Android, WebView) |
|---|---|
| Desktop support | Chrome 4+ (long-standing) |
| Status | Enabled by default |
| ChromeStatus | 6265472244514816 — SharedWorker on Android |
why it was disabled on Android
SharedWorkers were removed from Android in Chrome 40 (around 2015) due to memory and stability concerns on mobile hardware of that era. As Android devices have improved significantly, the Chromium team re-evaluated and ran an origin trial (Chrome 145–147) to validate stability before shipping to all Android users in Chrome 148.
Source: blink-dev Intent to Ship msg16196, Chrome 148.basic usage
// main.js (multiple tabs can connect to the same worker)
const worker = new SharedWorker('/shared-worker.js');
worker.port.start();
worker.port.addEventListener('message', (e) => {
console.log('From shared worker:', e.data);
});
worker.port.postMessage({ type: 'hello', from: location.href });
// shared-worker.js
const ports = new Set();
self.addEventListener('connect', (e) => {
const port = e.ports[0];
ports.add(port);
port.start();
port.addEventListener('message', (e) => {
// Broadcast to all connected tabs
for (const p of ports) {
p.postMessage({ echo: e.data });
}
});
});
browser support
| Chrome desktop | 4+ (long-standing) |
|---|---|
| Chrome Android | 148 (new in Chrome 148) |
| WebView Android | 148 |
| Firefox | Shipped |
| Safari | Shipped (Safari 16+) |