JavaScript reload of PWA after navigating back from external link

I'm developing a PWA for mobile Safari. Here is a video of the problem that I have: https://share.icloud.com/photos/068xNZvHZqAQI83EP5FHJj8ag

  • I open the app. It's like a Hacker News or Reddit clone so users always navigate away to external links.
  • The external link gets opened in this overlay, which I really like, that's great
  • However, when I press "done", you can see how the page somehow re-evaluates the JavaScript. E.g. the "voting errors" start pulsating which means that the page re-fetches some data from the server, which IMO isn't strictly necessary as the page was fine without that
  • I noticed that this isn't happening if I e.g. have the page open in a tab on regular Safari. When I then navigate to the tab, it doesn't reload JUST the JavaScript
  • What I also find weird about this is that it seems to only reload the JavaScript, not the entire page.
  • My site is at https://news.kiwistand.com/ so you can test this for yourself. The source code of the frontend is here https://github.com/attestate/kiwistand/tree/main/src/web and here's the PWA manifest https://github.com/attestate/kiwistand/blob/main/src/public/pwa.json

My question: Is there a way I can stop Safari from "reloading" the JavaScript when navigating back from an external link?

Hey this still remains a problem. Does anyone know how to resolve this?

JavaScript reload of PWA after navigating back from external link
 
 
Q