4 ms·
> but trying to save data required hosting it somewhere With the File System Access API, webpages nowadays can read and write local files just like desktop app
by mg 16d ago
> but trying to save data required hosting it somewhere
With the File System Access API, webpages nowadays can read and write local files just like desktop applications:
https://developer.chrome.com/docs/capabilities/web-apis/file-system-access https://developer.chrome.com/docs/capabilities/web-apis/file...
Try this text editor for example:
https://googlechromelabs.github.io/text-editor/ https://googlechromelabs.github.io/text-editor/
It works nicely on Desktop and Mobile.
- pspeter3 16d agoMy dream is that you could write to Google Drive or iCloud Drive transparently too if the browser allows you to
- jg0r 16d agoI believe you are able to connect to a Google Drive account with a purely client side site via google oauth and then using the Google Drive rest api. There was an article in particular that I liked that walked through it. Let me see if I can find it
- Lord_Zero 16d agoYes but Google OAuth is a nightmare if you want to "publish" your client so that anyone can use it. If only you use it, you can add yourself as a test user. Just know your access token expires super fast and you will have to frequently re-auth. Its crazy annoying.
- realPubkey 16d agoThis is possible with RxDB, you can sync from browser to google drive or ms onedrive
- emaro 16d ago*In Chrome.
- simongray 16d agoThat file editor seems to work in Firefox. I just tested the save/open functionality.
- maelito 16d agoIt just downloaded the file on my firefox.
- tbrockman 16d agoIt's not using the File System Access API, on Firefox it uses <input type="file"> for file-picking, and the save just downloads it. It's not synchronizing anything with your filesystem.
- simongray 16d agoI see. Thanks for enlightening me.
- whizzter 16d agoIirc the File System Access API should always originate File objects from an input picker so that the user selects the file to be opened and not give more access to apps than users allows?
- bithammerthunde 16d agoDo you know the reason for that? The File System API does seem to be well supported on Firefox: https://developer.mozilla.org/en-US/docs/Web/API/File_System_API#browser_compatibility https://developer.mozilla.org/en-US/docs/Web/API/File_System...
- mg 16d agoFirefox unfortunately does not support the File System Access API. You can try by calling the most fundamental function, the one that asks the user to select a file: window.showOpenFilePicker() What Firefox supports is a "File System API" which creates something similar to the other old ways of storing data in a browser, like cookies and indexeddb. You cannot use it to edit normal files on your disk. This is my main gripe with Firefox. They force their users to either store everything in the cloud or go through the arcane "download" workflow where you have to manually save files.
- darkvertex 16d agoEven better how about a fully functional VSCode: https://vscode.dev https://vscode.dev The File System Access API makes it possible.
- rtvn83 15d agoit's not only about saving data but easily sharing too. I think the capsule file is great for sharing one's work without the hassle of hosting.
- cosmic_cheese 15d agoEase of backup too. One of the issues I take with browsers allowing web apps to save data locally is that they don’t also expose a way to easily locate the data in the filesystem or export it, and to my knowledge on-disk format isn’t standardized and so portability between browsers is also a concern. The effect of this is that unless the user uses migration assistants or similar when upgrading to a new computer is that they’ll lose all local web app data. To me to this feels like a serious problem but when it’s brought up it tends to be hand waved away.