Navigator.serviceWorker

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

语法

let workerContainerInstance = navigator.serviceWorker;

规范

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

浏览器兼容性

BCD tables only load in the browser

也可以看看