[w3c/ServiceWorker] Editorial: add exported Unregister Service Workers algorithm (PR #1849)

Part of #1846.

Adds a new exported [`Unregister Service Workers`](https://w3c.github.io/ServiceWorker/#unregister-service-workers-algorithm) algorithm so other specifications (FedCM, Payment Handler) can bulk-unregister all [=/service worker registrations=] for a given storage key (for example, on behalf of a browser feature whose associated declaration has been removed).

## Algorithm

**Input:** `storage key`
**Output:** None

Steps:
1. Iterate [`registration map`](https://w3c.github.io/ServiceWorker/#dfn-scope-to-registration-map)'s keys.
2. For each entry whose storage key matches, parse the serialized scope URL and collect it.
3. For each collected scope URL, [`Create Job`](https://w3c.github.io/ServiceWorker/#create-job-algorithm) with *unregister* and [`Schedule Job`](https://w3c.github.io/ServiceWorker/#schedule-job-algorithm).

## Design notes

- **URL parsing is explicit.** The `registration map`'s keys hold *serialized* scope URLs (strings), while `Create Job` expects a URL. The algorithm parses each serialized scope and skips entries whose scope fails to parse.
- **Fire-and-forget.** No completion or failure signal is delivered; a Note documents this in the spec text.
- **Job-queue ordering preserved.** Unregister jobs go through the normal job queue, so job-equivalence and ordering guarantees against concurrent register/update jobs still hold.

## Placement

New section inserted immediately after [`Unregister`](https://w3c.github.io/ServiceWorker/#unregister-algorithm) and before [`Set Registration`](https://w3c.github.io/ServiceWorker/#set-registration-algorithm).

## Diff

**+23 / −0** in `index.bs`. No existing algorithm text is modified.

## Related

- #1846 — umbrella issue
- w3c-fedid/FedCM#842 — motivating PR
- #1847 — sibling PR (`Soft Update` export)
- #1848 — sibling PR (`Register a Service Worker`)

You can view, comment on, or merge this pull request online at:

  https://github.com/w3c/ServiceWorker/pull/1849

-- Commit Summary --

  * Editorial: add exported Unregister Service Workers algorithm

-- File Changes --

    M index.bs (23)

-- Patch Links --

https://github.com/w3c/ServiceWorker/pull/1849.patch
https://github.com/w3c/ServiceWorker/pull/1849.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/ServiceWorker/pull/1849
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/ServiceWorker/pull/1849@github.com>

Received on Wednesday, 2 September 2026 17:46:29 UTC