I use a service worker pattern that returns an offline.html if the in case that the network disconnects.
It works well: the program loads the intial page my_site.html.
Through out the program, the network disconnects, the service worker detects this and loads the offline.html page:
When the service worker returns the offline.html page, the Javascript uses window.location.href = response.url;
which reloads the page and changes the address bar to offline.html.
But then, how does the user recover the original html page, once the network re-connects?
Naturally, the user will refresh/reload the page. But this operation will keep asking for the last address (offline.html)
But the user expects to see the original page: my_site.html ?
Thanks,
Avner