This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The Navigator.serviceWorker
read-only property returns the ServiceWorkerContainer
object for the associated document, which provides access to registration, removal, upgrade, and communication with the ServiceWorker
.
Syntax
var workerContainerInstance = navigator.serviceWorker;
Value
Examples
This code checks if the browser supports service workers.
if ('serviceWorker' in navigator) { // Supported! }
Specifications
Specification | Status | Comment |
---|---|---|
Service Workers The definition of 'navigator.serviceWorker' in that specification. |
Working Draft | Initial definition. |
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Update compatibility data on GitHub
Desktop | Mobile | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Basic support | Chrome Full support 40 | Edge
Full support
17
| Firefox
Full support
44
| IE No support No | Opera Full support 27 | Safari Full support 11.1 | WebView Android Full support 40 | Chrome Android Full support 40 | Edge Mobile ? | Firefox Android Full support 44 | Opera Android Full support 27 | Safari iOS Full support 11.1 | Samsung Internet Android ? |
Legend
- Full support
- Full support
- No support
- No support
- Compatibility unknown
- Compatibility unknown
- See implementation notes.
- See implementation notes.
- User must explicitly enable this feature.
- User must explicitly enable this feature.
See also
Document Tags and Contributors
Tags:
Contributors to this page:
duduindo,
ExE-Boss,
jpmedley,
rowan_m,
chrisdavidmills,
Ehsan,
Sebastianz,
teoli,
kscarfone
Last updated by:
duduindo,