This feature adds an `id` attribute to ServiceWorkerRegistration which acts as a unique key identifying the registration. Previously the registration's scope was used as the unique key. By moving to a separate `id` value the scope can now be changed atomically without unregistering and re-registering the existing registration.

Motivation

This change adds a `ServiceWorkerRegistration.id` attribute which can be used to uniquely identify registrations. This allows us to make the registration's scope mutable. Previously if you wanted to change the scope you would have to unregister and re-register the service worker which could lose state like push subscriptions, etc.

Specification

Specification link


Specification currently under development in a Working Group

Status in Chromium

Blink>ServiceWorker


No active development (tracking bug)

Consensus & Standardization

After a feature ships in Chrome, the values listed here are not guaranteed to be up to date.

  • No signal
  • No signal
  • No signals

Owner

Intent to Prototype url

Intent to Prototype thread

Last updated on 2022-01-11