This bug still exists in 17.3.1.
The lack of PWA main page can be detected by looking for it in clients.matchAll. If none of the window type clients have a matching URL, then the PWA UI can be restored by invoking clients.openWindow with its URL inside the notificationclick event handler. The problem with that, is that you then cannot open the URL from the notification, because only 1 invocation of openWindow is allowed in the handler. Also window.open() cannot be invoked by the PWA page just like that. One would need to show a banner on that page which the user has to click, and from that click handler, the actual page could then be opened. A major PITA of course, it would be much better if Apple could fix this obvious bug.
Topic:
App & System Services
SubTopic:
Core OS
Tags: