- From: ikram1201 <notifications@github.com>
- Date: Thu, 03 Dec 2026 19:05:21 -0800
- To: w3c/ServiceWorker <ServiceWorker@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <w3c/ServiceWorker/pull/1867@github.com>
Closes #1500
This follows the TPAC 2026 direction and @monica-ch's requirements in https://github.com/w3c/ServiceWorker/issues/1500#issuecomment-7392336185.
Changes to `WindowClient.navigate(url)`:
- Remove the step that rejected `about:blank` with a `TypeError`.
- Keep the existing rejections: URL parse failure, the active service worker check, a document that is not fully active, and exceptions thrown by navigate (sandboxing).
- After starting the navigation, wait for its outcome in parallel instead of reading the browsing context right away. If the navigation is abandoned (canceled, replaced by another navigation, or handed off to external software), resolve with `null`.
- Once the navigation has completed, resolve with `null` unless the resulting document is same origin with the service worker, by both its creation URL and its origin, and was not created via cross-origin redirects. HTML derives [was created via cross-origin redirects](https://html.spec.whatwg.org/multipage/dom.html#was-created-via-cross-origin-redirects) from the response's redirect taint, which looks at every URL in the redirect chain. So a navigation that redirects to another origin and then back to the service worker's origin resolves with `null` and does not reveal the redirect chain. A fragment navigation keeps the existing document, so this check does not apply to it.
- Add a note: navigations that end in a network error (mixed content, `file:`) produce an error document with an opaque origin, and `about:blank`'s creation URL has an opaque origin, so all of these resolve with `null` rather than rejecting.
The `null` value matches the existing `Promise<WindowClient?>` return type and the existing cross-origin case. Navigating uncontrolled clients (#1254) is not part of this change.
The following tasks have been completed:
- [x] Modified Web platform tests (WPT_PR_LINK_TBD)
Implementation commitment:
- [ ] WebKit (follow-up bug to be filed)
- [ ] Chromium (follow-up bug to be filed)
- [ ] Gecko (follow-up bug to be filed)
<!--
This comment and the below content is programmatically generated.
You may add a comma-separated list of anchors you'd like a
direct link to below (e.g. #idl-serializers, #idl-sequence):
Don't remove this comment or modify anything below this line.
If you don't want a preview generated for this pull request,
just replace the whole of this comment's content by "no preview"
and remove what's below.
-->
***
<a href="https://pr-preview.w3.org/ikram1201/ServiceWorker/pull/1867.html" title="Last updated on Dec 4, 2026, 3:04 AM UTC (1039a20)">Preview</a> | <a href="https://pr-preview.w3.org/w3c/ServiceWorker/1867/05701db...ikram1201:1039a20.html" title="Last updated on Dec 4, 2026, 3:04 AM UTC (1039a20)">Diff</a>
You can view, comment on, or merge this pull request online at:
https://github.com/w3c/ServiceWorker/pull/1867
-- Commit Summary --
* Resolve WindowClient.navigate() with null for failed or cross-origin-redirected navigations
-- File Changes --
M index.bs (29)
-- Patch Links --
https://github.com/w3c/ServiceWorker/pull/1867.patch
https://github.com/w3c/ServiceWorker/pull/1867.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/w3c/ServiceWorker/pull/1867
You are receiving this because you are subscribed to this thread.
Message ID: <w3c/ServiceWorker/pull/1867@github.com>
Received on Friday, 4 December 2026 03:05:26 UTC