4 ms·
I've used a similar solution/workaround to create a data URL blob for saving files from a web app. I agree it's not ideal and quite limited. If it were an Elect
by lioeters 9y ago
I've used a similar solution/workaround to create a data URL blob for saving files from a web app. I agree it's not ideal and quite limited. If it were an Electron app, there's an API for opening native file dialogs [0].
As for rendering an updated download link on every keypress - I remember I had to solve it by using a "dummy" download button: when it's clicked, it generates a fresh URL blob to replace the link href, then trigger another click event to start the download. I forget exactly how/if that worked.
A couple of months ago I came across remoteStorage, "an open protocol for per-user storage on the Web" [1]. I have not implemented it, but the main idea seems to be "offline-first" apps that keep the user's data local, then sync if/when online.
There's also "progressive web apps" [2], to promote this kind of offline-first approach and leveraging local storage.
[0] https://electronjs.org/docs/api/dialog https://electronjs.org/docs/api/dialog
[1] https://remotestorage.io/ https://remotestorage.io/
[2] https://developers.google.com/web/progressive-web-apps/ https://developers.google.com/web/progressive-web-apps/
- nuclx 9y agoI would love to see Chrome/Firefox embrace the unhosted approach a bit more, but security concerns are certainly a hindrance when it comes to empowering web apps.