JavaScript modules in service workers
Limited availability
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.
Compatibility
- Chrome 91 Released on 2021-05-25
- Chrome Android 91 Released on 2021-05-25
- Edge 91 Released on 2021-05-27
- Firefox ❌ See bugzil.la/1360870
- Firefox for Android ❌ See bugzil.la/1360870
- Safari 15 Released on 2021-09-20
- Safari on iOS 15 Released on 2021-09-20
Baseline availability blocked since September 2021 by Firefox (38 months)