[w3c/ServiceWorker] OpenWindow lacks either sourceDocument or userInvolvement argument when running Navigate algorithm (Issue #1776)

saschanaz created an issue (w3c/ServiceWorker#1776)

[In the step 7.2.1 of openWindow](https://w3c.github.io/ServiceWorker/#dom-clients-openwindow):

> HandleNavigate: [Navigate](https://html.spec.whatwg.org/multipage/browsing-the-web.html#navigate) newContext to url with [exceptionsEnabled](https://html.spec.whatwg.org/multipage/browsing-the-web.html#exceptions-enabled) true, and [historyHandling](https://html.spec.whatwg.org/multipage/browsing-the-web.html#navigation-hh) "replace".

It doesn't pass source document here so it becomes the default value null, nor the user involvement argument which becomes "none". And the step 5 of the navigate algorithm:

>5. If sourceDocument is null:
>    1. [Assert](https://infra.spec.whatwg.org/#assert): userInvolvement is "[browser UI](https://html.spec.whatwg.org/multipage/browsing-the-web.html#uni-browser-ui)".

Which ends up with an assertion failure.

There's no document to pass (as this is a service worker function), so it seems the only way to make it happy is to pass the user involvement argument, but not sure "browser UI" fits here because the caller is certainly the script here. Thoughts?

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

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

Received on Tuesday, 3 June 2025 15:47:36 UTC