JavaScript modules in shared workersBaseline · Newly available
The SharedWorker() constructor accepts { type: "module" } to load scripts that use import and export. Also known as ECMAScript modules or ESM in shared workers.
Works in the latest version of every major browser, but older devices may not support it yet. Baseline since May 5, 2026.
Browser support
DesktopChrome
1–79Not supported
80+Supportedsince Feb 4, 2020
Current: 155Edge
12–79Not supported
80+Supportedsince Feb 7, 2020
Current: 154Firefox
1–113Not supported
114+Supportedsince Jun 6, 2023
Current: 157Safari
1–15.6Not supported
16+Supportedsince Sep 12, 2022
Current: 27MobileChrome Android
18–147Not supported
148+Supportedsince May 5, 2026
Current: 155Firefox Android
4–113Not supported
114+Supportedsince Jun 6, 2023
Current: 157Safari iOS
1–15.6Not supported
16+Supportedsince Sep 12, 2022
Current: 27How to use
Every current browser supports this, but it only became Baseline on May 5, 2026. Use it as a progressive enhancement, or keep a fallback if you support older devices.
Example
Full syntax and examples are on MDN — see the links below.
Feature detection
JS · check before using
if ("SharedWorker" in globalThis && "SharedWorker" in SharedWorker.prototype) {
// SharedWorker.SharedWorker is available
}Sub-features
Support for each part of the feature (2). The overall table above shows when the whole feature works.
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| SharedWorker.SharedWorker.ecmascript_modules | 80 | 80 | 114 | 16 | 148 | 114 | 16 |
| SharedWorker.SharedWorker.options_type_parameter | 80 | 80 | 114 | 16 | 148 | 114 | 16 |