[w3c/ServiceWorker] Edge case in https://w3c.github.io/ServiceWorker/#clients-openwindow (Issue #1639)

https://w3c.github.io/ServiceWorker/#clients-openwindow step 7 .1 reads as:
`Let newContext be a new top-level browsing context.`

In some edge cases, newContext might be null, and it is not clear what should happen.
With the current spec wording, it seems openWindow promise would never resolve, which is not great.

I see two possibilities:
1. Resolve the promise with null. This somehow aligns with window.open which returns null in that case. The web app will not be able to differentiate the case where a tab is opened vs. a tab is not opened
2. Reject the promise. This allows the web app to differentiate the case where a tab is opened vs. no tab is opened. That leaves a chance for the web app to do alternative things (focus an existing tab if any and navigate it for instance).

Thoughts?

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

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

Received on Thursday, 31 March 2022 06:43:50 UTC