ServiceWorkerRegistration:scope 属性
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2018年4月.
备注: 此特性在 Web Worker 中可用。
ServiceWorkerRegistration 接口的只读属性 scope 返回一个字符串,该字符串表示定义了 service worker 注册作用域的 URL;即 service worker 可以控制的 URL 范围。此值通过调用 ServiceWorkerContainer.register()(用于注册 service worker)时指定的 scope 参数进行设置。
值
返回一个表示定义 service worker 注册作用域的 URL 的字符串。
规范
| Specification |
|---|
| Service Workers Nightly> # service-worker-registration-scope> |