W3cubDocs

/DOM

ServiceWorkerState

This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The ServiceWorkerState is associated with its ServiceWorker's state.

Values

installing
The service worker in this state is considered an installing worker. During this state, ExtendableEvent.waitUntil() can be called inside the install event handler to extend the life of the installing worker until the passed promise resolves successfully. This is primarily used to ensure that the service worker is not active until all of the core caches are populated.
installed
The service worker in this state is considered a waiting worker.
activating
The service worker in this state is considered an active worker. During this state, ExtendableEvent.waitUntil() can be called inside the onactivate event handler to extend the life of the active worker until the passed promise resolves successfully. No functional events are dispatched until the state becomes activated.
activated
The service worker in this state is considered an active worker ready to handle functional events.
redundant
A new service worker is replacing the current service worker, or the current service worker is being discarded due to an install failure.

Specifications

Specification Status Comment
Service Workers
The definition of 'ServiceWorkerState' in that specification.
Working Draft Initial definition.

See also

© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerState