[w3c/ServiceWorker] active service worker should be reset for same-origin redirects during navigation (Issue #1735)

During navigation requests, the active service worker is set in https://w3c.github.io/ServiceWorker/#handle-fetch when there is a ServiceWorker to control the Document, but it is not changed when there are no such ServiceWorker, leaving the obsolete active service worker set in previous redirect legs.

Example scenario: a navigation to `https://example.com/redirect.html` (controlled by a SW `sw.js`) is redirected to `index.html` (not controlled by SWs).
Current spec: the `active service worker` is set to `sw.js` during HandleFetch for `redirect.html`, and remains the same even after redirected to `index.html`, causing the `index.html` Document subresources controlled by `sw.js`.
Expected behavior: the `active service worker` is null after redirected to `index.html`.

- This affects same-origin redirects only, as the reserved client itself is re-created for cross-origin redirects around Step 19.1 of https://html.spec.whatwg.org/multipage/browsing-the-web.html#create-navigation-params-by-fetching.
- At least Chromium implementation is not affected, as it already resets active service worker on every redirect.


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

Message ID: <w3c/ServiceWorker/issues/1735@github.com>

Received on Monday, 4 November 2024 18:06:39 UTC