3 ms·
My application [0] I used daily for 13 years stores the data in localStorage and I had several unpleasant data loss incidents - mostly me cleaning storage of th
by Klaster_1 2y ago
My application [0] I used daily for 13 years stores the data in localStorage and I had several unpleasant data loss incidents - mostly me cleaning storage of the wrong browser tab. Thankfully, a simple JSON dump/import feature enables a good enough degree of reliability. Thanks to it, I didn't lose any data in 5 years, but now I have a questionable habit where I defensively export data before every major edit or deployment.
Simple localStorage replication has been an interest of mine for many years and I explore available solutions multiple times a year, but none of these ticks all the boxes - no server to maintain; free; optional for users; bring your own storage; the app stays a web page; cross-browser. I wish browsers had a file system API that allowed the app to read/write to specified directory or a file in background, which users may sync with their tool of choice, like Google Drive.
[0] https://github.com/Klaster1/timer-5 https://github.com/Klaster1/timer-5
- mlok 2y agoAdd your browser data directory to your backup folders list, and restore that folder in case of a localStorage loss, that should do it.
- Klaster_1 2y agoIf that works for you - I am glad, however, this approach won't work across different browsers and OSes.
- xnx 2y agoExactly! The number of subscription saas apps that could be replaced by open source if there was a bring your own storage API would be astounding. This might be exactly why browser makers will not add it.
- dugmartin 2y agoIt’s Chrome only but the file system access api lets you do this: https://developer.chrome.com/docs/capabilities/web-apis/file-system-access https://developer.chrome.com/docs/capabilities/web-apis/file...