MDN wants to learn about developers like you: https://qsurvey.mozilla.com/s3/MDN-dev-survey

Navigator.serviceWorker 只读属性,返回 关联文件 的 ServiceWorkerContainer 对象,它提供对ServiceWorker 的注册,删除,升级和通信的访问。。

语法

letworkerContainerInstance = navigator.serviceWorker;

ServiceWorkerContainer.

规范

Specification Status Comment
Service Workers
navigator.serviceWorker
Working Draft Initial definition.

浏览器兼容性

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support 40.0 44.0 (44.0)[1] 未实现 24 未实现
Feature Android Firefox Mobile (Gecko) Firefox OS IE Mobile Opera Mobile Safari Mobile Chrome for Android
Basic support ? 44.0 (44.0) (Yes) 未实现 ? 未实现 ?

[1] Service workers (and Push) have been disabled in the Firefox 45 Extended Support Release (ESR.)

也可以看看

文档标签和贡献者

 此页面的贡献者: xgqfrms-GitHub, wenshin
 最后编辑者: xgqfrms-GitHub,