4 ms·
The advantage of using the `showSaveFilePicker()` method is that you can get a `FileSystemFileHandle`, with which you can then implement a true "edit, save, edi
by tomayac 4y ago
The advantage of using the `showSaveFilePicker()` method is that you can get a `FileSystemFileHandle`, with which you can then implement a true "edit, save, edit, save,…" flow; always saving over the current file, instead of downloading copies on each "save".
- modeless 4y agoIn the future you may even be able to save the handle and retain permission to the file or directory between page reloads or even browser restart. I've been experimenting with this in Chromium. There's a preliminary implementation behind a flag (--enable-features=kFileSystemAccessPersistentPermissions). The preliminary implementation is still buggy, but it's an extremely useful feature. You could use it to e.g. make a web version of VSCode that only ever has to request your permission once, and can then edit any file in your workspace directory without spamming you with more permission requests, just like the Electron version of VSCode. (The persistent file access permission is displayed in the address bar and can be revoked at any time).
- tomayac 4y agoAnd getting the default permission period right for this feature once unflagged is something we're very actively discussing. Watch our publications web.dev and developer.chrome.com for updates on this.
- jeroenhd 4y agoAs a user, I think that's a very unexpected feature. When a file crosses the border from browser to file system, I expect it to remain untouched. This approach feels very unnatural to me.
- meragrin_ 4y agoAs a user, I think that it is a very expected feature. When use a browser as an editor, I expect it to change the file when I save it. This approach feels very natural to me.
- svnpenn 4y ago> When use a browser as an editor thats the problem. You should never be doing that. You should be using an editor, as an editor. The confusion is understandable though, as in general editors [1] aren't [2] widely [3] available [4] for [5] people to use. 1. https://github.com/vim/vim https://github.com/vim/vim 2. https://github.com/emacs-mirror/emacs https://github.com/emacs-mirror/emacs 3. https://github.com/xi-editor/xi-editor https://github.com/xi-editor/xi-editor 4. https://github.com/notepad-plus-plus/notepad-plus-plus https://github.com/notepad-plus-plus/notepad-plus-plus 5. https://github.com/helix-editor/helix https://github.com/helix-editor/helix
- frou_dh 4y agoYeah, there's some really dumb practices out there. Some people even exclusively run their editor inside an EMULATOR of one of these devices: https://i.imgur.com/SBUxWMg.jpg https://i.imgur.com/SBUxWMg.jpg - rather than using their actual operating system.
- kweingar 4y agoThere are more kinds of editors than text editors, and some of them are suited to web browsers.
- gl-prod 4y agoI use https://www.photopea.com https://www.photopea.com as a Photo editor. When working on projects, hitting CTRL+S saves the file as I expect it to do.
- easrng 4y agoGood thing there's a prompt[1] then. [1]: https://i.imgur.com/A0Byw7Q.png https://i.imgur.com/A0Byw7Q.png