I have made a PWA by following the tutorial at /
I put the PWA on a server and when I navigate to it using Chrome on my Linux desktop I am able to download it to my desktop and then open it and use it. In Firefox I can still use the PWA after selecting "offline" from development tools. So it seems to be working to some extent.
When I navigate to the PWA from my Android phone using Firefox I can install the PWA to my home screen but if I turn off WiFi and mobile data it will not open the PWA. It warns that I am offline. Chrome does the same except instead of (when online) opening the site at example/pwa it opens the root ie. example which I do not want.
All i want to do is run some simple JavaScript code in a web browser when I am offline but it seems to be extremely difficult. I have tried to do this on several occasions over the last few years and can never get it to work.
I would very much appreciate seeing some minimal code to be able to deploy a PWA which I can put on a server, navigate to from my android phone, install on my android phone and then use offline in Chrome and Firefox. The example I quoted at the beginning of this question does not seem to do that.