When we use window.open(url, "_blank") to bring up a new Safari tab/window with our PWA we see that the document.visibilityState is not updated and then returning to the PWA from the webview/tag results in fetch calls failing with Unhandled Promise Rejection: AbortError: Fetch is aborted. All fetch calls fail until the PWA is refreshed or closed and then opened again.
Upon further investigation it seems document.visibilityState is updated and that clicking Done from the Safari window does not cause the issue. It is only caused when handoff javascript executes in the other window (calls to window.opener.postMessage). We are unsure why this breaks all fetch calls.
<rdar://problem/108884055>
It appears the issue is related to the service worker becoming unresponsive. Our service worker has no fetch handler but all network calls failed when a redirect was performed in the new safari tab. Resetting the service worker (unregistering the service worker and then refreshing the page) resolved the issue.
Pull request: https://github.com/WebKit/WebKit/pull/13639
Committed 263901@main (7a4f94728cde): <https://commits.webkit.org/263901@main> Reviewed commits have been landed. Closing PR #13639 and removing active labels.
Committed 264076@main (f1665400b299): <https://commits.webkit.org/264076@main> Reviewed commits have been landed. Closing PR #13740 and removing active labels.