philipmw / phrase.shop

A web app to generate secure yet memorable passphrases
https://phrase.shop
MIT License
4 stars 3 forks source link

Install to browser offline #40

Closed robbielove closed 1 year ago

robbielove commented 2 years ago

I note that I can disconnect my network and the page still works

However, if (for whatever reason) the page is reloaded/refreshed; then the app can not be reloaded.

I request that it can be installed as a chrome web app to allow for true offline use.

This link might explain the relevant info https://developer.chrome.com/blog/getting-started-pwa/#service-worker-for-offline-caching

philipmw commented 2 years ago

This would add complexity, but I am not sure about the benefit. Can you describe the scenario where the customer would have enough internet to cache the app, but not enough to load it subsequently?

robbielove commented 2 years ago

Hey @philipmw,

To clarify, currently, the app can generate a passphrase while offline, however, if the page is refreshed/reloaded; then any generated password is lost

I think it would be beneficial to install as a chrome web app to allow for true offline use; rather than rely on the browser's cache memory. This way if the browser or computer crashes, or if the page is refreshed - the user wouldn't lose the generated passphrase.

The scenario I have in mind is as follows: A user; generated a passphrase and then left that tab sitting open for a while. They then close their laptop and went to bed. In the morning they reopen their laptop, go to that tab; but for some reason the browser experiences an issue with that tab or similar, the user has not saved a copy of the passphrase anywhere - the only source is where they generated it in that tab which now can't be restored

In this scenario; it would be beneficial if the app were installed as a PWA - as the passphrase would still be accessible.

How is this scenario is different if the app were an installed PWA?

If the app were an installed PWA; then it would still work even if the tab was closed or the browser/computer restarted.

So, is the issue that the browser cache is cleared when the tab is closed or the computer restarted?

Well to an extent, it's hard to predict what might happen when the user walks away from their computer or the browser/computer crashes and then is restarted. By installing as a PWA - we can be sure that it will still work fine in these cases because it's installed on the user's device; not just reliant on the browser cache.

Other benefits of installing as a PWA:

Do you think these benefits would be enough to allow for offline installation?

philipmw commented 2 years ago

Thanks. It sounds like the problem you are trying to solve is this:

https://github.com/philipmw/phrase.shop/issues/42

Can we resolve this issue in favor of that one?