Open Jaifroid opened 6 months ago
This does not happen upstream in KJS. The article does load in a new window/tab, but the main app remains perfectly usable. So it's very much a bug/regression specific to this Repo's earlier implementation.
Issue is confirmed to affect only zimit2, not zimit1 archives.
The content does load in the new tab or window (in browser), and is fully navigable, but there are no app search or navigation bars in that instance. That is as expected, but what should not happen is that the main app UI is blanked out and all navigation controls disappear.
What appears to be happening is that the app is unaware that a new tab has been opened. The Service Worker has no idea of the DOM, so can't tell which client is requesting resources. Because the app believes it is loading a local resource, it tears down the existing article in the iframe ready to receive new content, which instead goes to the new window/tab.
This does not happen if the new tab/window is one opened by the app itself as a result of a user gesture. So, to fix this, we need to handle the fact that the content will be sent by the SW to a different client. We already know how to do this in the message channel event, but it needs to be coordinated.