28 ms·
Getting Started with the File System Access API
- monkellipse 5y agoI didn’t see any security features mentioned… am I the only one a wee bit terrified? Am I just paranoid?
- monocasa 5y agoThere's explicit dialogs the user has to opt into.
- est31 5y agoMost (>80%) of users are highly computer illiterate. Even among younger folks. There has recently been a story on hn about zoomers not "understanding" how file systems work.
- monocasa 5y agoStatistically they have a lesser understanding of hierarchical filesystems, because Apple and to a lesser degree Google have been going out of their way to hide that on mobile OSes for some reason that was never really clear to me. They still understand files though. And at the end of the day there's only so much you can do. The same kind of people that will click yes on any dialog will also click yes on "do you want to run this exe you just downloaded", and that'll get you file system access just fine too.
- est31 5y agoYeah hierarchical file systems are not the one true way to organize your data. But from my understanding, the user grants access via this API on a directory based level when the website asks for access to one directory. If you have no concept of directories, or you put everything directly into one directory, it's tough to make this restriction useful. So in this instance, knowledge of hierarchical file systems is relevant, even if new operating systems make this knowledge increasingly obsolete.
- monocasa 5y ago> Yeah hierarchical file systems are not the one true way to organize your data. It's the way nearly all computers, mobile or not, organize data. Some hide this fact to because they either think they know better than the user (Apple) or they want to make it really painful to not store all of your data in their backend (Google). > But from my understanding, the user grants access via this API on a directory based level when the website asks for access to one directory. If you have no concept of directories, or you put everything directly into one directory, it's tough to make this restriction useful. So in this instance, knowledge of hierarchical file systems is relevant, even if new operating systems make this knowledge increasingly obsolete. I think that illiteracy here has more to do with the advent of mobile OSes and people only exposed to mobile devices. Filesystem access isn't supported on mobile browsers at all so there isn't really a problem there (except for mobile Safari, which also doesn't expose folders to users, being on Apple's direct control). https://caniuse.com/native-filesystem-api https://caniuse.com/native-filesystem-api
- tshaddox 5y agoIf you’re concerned about users having literally no floor to their technical understanding or awareness, then those users are already vulnerable to websites with a form that says “type your Gmail address and password here.”
- hulitu 5y agoYou mean like in Android ? Where you give an app access to all your files ?
- nekcihc 5y agoI remember some time ago Firefox denied all the local access as a security issue - despite all the dialogs that asked for rights. Had to find some other ways to access simple txt file - via link.
- cmeacham98 5y agoFirefox never has implemented the filesystem access API: https://caniuse.com/native-filesystem-api https://caniuse.com/native-filesystem-api
- iggldiggl 5y agoThey didn't even want to give extensions that kind of capabilities (and in the process significantly crippled mass downloaders like DownThemAll and others), so yeah…
- nekcihc 5y agoI was refering to ability to manipulate local files from Firefox, that existed 6 - maybe 8 years ago - long long time ago, when this filesystem API did not exist.
- drenvuk 5y agoas much as I'd like to use this no browser really supports it aside from chrome. the brave team even specifically disabled it due to security issues.
- extra88 5y agoPerhaps not coincidentally, today WebKit also blogged about availability of the API in Safari as well. https://webkit.org/blog/12257/the-file-system-access-api-with-origin-private-file-system/ https://webkit.org/blog/12257/the-file-system-access-api-wit...
- drenvuk 5y agoThe main selling point to me for the file system access api is the ability to write directly to the file system on the device but from what I could understand in that blog post is that the 'files' that you write to don't actually map to the device's fs itself. Has anyone used it to write to an existing directory or is it just an alternative and more familiar interface to indexedDB?
- kushan2020 5y agoI have been using it to provide ability to read existing markdown notes in a users directory see [1]. So far it works great but browser support is limited to chrome and edge. [1] https://bangle.io https://bangle.io
- darrinm 5y agoNote that, unlike Chrome, Safari only supports “origin private” files which means it cannot be used to access files already on your system (e.g. no vscode.dev, photoshop.adobe.com opening of local files).
- spankalee 5y agoThis is what apps like photoshop.adobe.com and vscode.dev use to let you edit local files - with a fallback of single file access with input/type="file". I hope Firefox and Safari support this API soon. The alternative of installing native executables isn't any more secure.
- tehbeard 5y agofrom the caniuse data, it looks like Safari might actually be working on this? Which is both hugely surprising and deeply concerning, given their track record with both implementing APIs and the stability/reliability of them.... The tinfoil hat me in says they might fuck it up to justify the apple ecosystem stance of app store or nothing.
- eyelidlessness 5y agoPut down the tinfoil, the WebKit team has been on a tear recently and very actively hiring to keep that momentum and very actively seeking feedback. Regardless of Apple’s priorities, Safari is very much on an improvement track
- hnbad 5y agoI think a more justified and nuanced criticism is that Apple is harming the web by tying Safari updates to macOS and iOS updates, which makes the criticism of Safari being the new IE a lot more justified (now that IE has been replaced by the evergreen cross-platform Edge). Safari might get more frequent and broader updates but that's no use when people are still using older versions of macOS and iOS and might be stuck with it (especially with fresh memory of Apple intentionally slowing down iOS devices to encourage buying new hardware).
- shuckles 5y agoSafari on macOS is supported two major OSes releases back. The latest iOS is supported on iPhones launched in 2015 and later. How many users on older versions of Safari are limited by OS version?
- qwtel 5y agoIt's great and I'm using it for https://sqliteviewer.app https://sqliteviewer.app. It would be even better if it allowed partial reads/writes with offsets, but alas, security concerns seem to block that. I'm looking at the File Handling API[1] next to let the (installed) web app open .sqlite lite files from the OS file explorer. [1]: https://github.com/WICG/file-handling https://github.com/WICG/file-handling
- darknavi 5y ago> Getting Started with the File System Access API > css-tricks.com Here I thought CSS was getting just a bit more spooky. Thankfully not.
- eyelidlessness 5y agoThey regularly post JS stuff, it’s pretty much just FE Stuff Weekdaily.
- kushan2020 5y agoThis is amazing for indie note taking apps like https://bangle.io https://bangle.io . I will no longer have to tell users to switch to chrome now.
- pxeger1 5y agoReally organic plug you got there.
- _8j50 5y agoCool blackhat brief on how it can be abused: https://i.blackhat.com/USA21/Wednesday-Handouts/us-21-Internal-Affairs-Hacking-File-System-Access-From-The-Web.pdf https://i.blackhat.com/USA21/Wednesday-Handouts/us-21-Intern...