JavaScript modules in service workersBaseline · Newly available
The navigator.serviceWorker.register() method accepts { type: "module" } to load scripts that use import and export. Also known as ECMAScript modules or ESM in service workers.
Works in the latest version of every major browser, but older devices may not support it yet. Baseline since Jan 13, 2026.
Browser support
DesktopChrome
1–90Not supported
91+Supportedsince May 25, 2021
Current: 155Edge
12–90Not supported
91+Supportedsince May 27, 2021
Current: 154Firefox
1–146Not supported
147+Supportedsince Jan 13, 2026
Current: 157Safari
1–14.1Not supported
15+Supportedsince Sep 20, 2021
Current: 27MobileChrome Android
18–90Not supported
91+Supportedsince May 25, 2021
Current: 155Firefox Android
4–146Not supported
147+Supportedsince Jan 13, 2026
Current: 157Safari iOS
1–14.5Not supported
15+Supportedsince Sep 20, 2021
Current: 27How to use
Every current browser supports this, but it only became Baseline on Jan 13, 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 ("ServiceWorker" in globalThis && "ecmascript_modules" in ServiceWorker.prototype) {
// ServiceWorker.ecmascript_modules is available
}Specification
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 |
|---|---|---|---|---|---|---|---|
| ServiceWorker.ecmascript_modules | 91 | 91 | 147 | 15 | 91 | 147 | 15 |
| import.service_worker_support | 91 | 91 | 147 | 15 | 91 | 147 | 15 |