The scope read-only property of the ServiceWorkerRegistration interface returns a unique identifier for a service worker registration. The service worker must be on the same origin as the document that registers the ServiceWorker.

Note: This feature is available in Web Workers.


var swScope = serviceWorkerRegistration.scope;


Specification Status Comment
Service Workers
The definition of 'ServiceWorkerRegistration.scope' in that specification.
Working Draft Initial definition.

Browser compatibility

BCD tables only load in the browser

See also