Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

`navigator.storage.persist()` will prompt the user to allow persistent storage for your site, so data won't be evicted under storage pressure (for IndexedDB, service worker registrations, localStorage, sessionStorage, etc.)

https://developer.mozilla.org/en-US/docs/Web/API/StorageMana...



The problem runs deeper than what the GP complains about.

If you rely on that, and write important things on the browser storage, a week later your user access some moronic site that doesn't work, and their support tells him to clear his browser cache, your data will almost certainly be cleaned with it.

The problem is that browsers do not even consider that they may be storing important data. There is no clear way to recover or backup that data, and it is tangled with what comes from every other site.


That doesn't work on iOS, nor on Safari on Mac for any released version as far as I understand:

https://caniuse.com/mdn-api_storagemanager_persist




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: