ServiceWorkerRegistration: scope property
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since April 2018.
Secure context: This feature is available only insecure contexts (HTTPS), in some or allsupporting browsers.
Note: This feature is available inWeb Workers.
Thescope read-only property of theServiceWorkerRegistration interface returns a string representing a URL that defines a service worker's registration scope; that is, the range of URLs a service worker can control. This is set using thescope parameter specified in the call toServiceWorkerContainer.register() which registered the service worker.
In this article
Value
Returns a string representing a URL that defines a service worker's registration scope.
Specifications
| Specification |
|---|
| Service Workers Nightly> # service-worker-registration-scope> |