[Webkit-unassigned] [Bug 252544] Initial ServiceWorkerWindowClient in a Home Screen web app launched to handle notificationclick handler is inert for a short period

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Mar 8 09:39:08 PST 2023


--- Comment #15 from Brady Eidson <beidson at apple.com> ---
With ServiceWorkerClient and ServiceWorkerWindowClient combined, there are 3 APIs we need to handle in this case:
postMessage(), focus(), and navigate()

All 3 of these fail because the context's Document isn't fully live yet.

The navigate() steps - https://w3c.github.io/ServiceWorker/#client-navigate - clearly state:
"If browsingContext’s associated document is not fully active, queue a task to reject promise with a TypeError"

navigate() already fails today per the spec.

focus() is a little trickier - https://w3c.github.io/ServiceWorker/#client-focus - As you have to cross reference with some other specs and concepts.
But basically, since the document doesn't exist, focus will not be true after running focus steps, and therefore the promise will reject.

So focus() also fails correctly today!

Now we're back to postMessage().
We clearly intended to queue messages sent to a "not fully active" context and deliver them once it becomes active.

And we're failing that case here.

Let's fix.

You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20230308/2a08b961/attachment.htm>

More information about the webkit-unassigned mailing list