ServiceWorkerState - Web APIs 编辑
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 theinstall
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 theonactivate
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论