ServiceWorkerState
is associated with its
ServiceWorker
的状态。
installing
ExtendableEvent.waitUntil()
can be called inside the
安装
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
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.
| 规范 | 状态 | 注释 |
|---|---|---|
|
服务工作者
The definition of 'ServiceWorkerState' in that specification. |
工作草案 | 初始定义。 |
ServiceWorkerState
缓存
CacheStorage
Client
Clients
ExtendableEvent
FetchEvent
InstallEvent
Navigator.serviceWorker
NotificationEvent
PeriodicSyncEvent
PeriodicSyncManager
PeriodicSyncRegistration
ServiceWorker
ServiceWorkerContainer
ServiceWorkerGlobalScope
ServiceWorkerRegistration
SyncEvent
SyncManager
SyncRegistration
WindowClient