I think something that is a mix between localStorage or IndexedDB and access to the user's filesystem would be better. I agree with the comments about how much of a security risk this poses. But, isn't that the case with any binary or executable files and apps we download from the internet anyway? It would be cool if you could have a specially-demarcated directory (e.g. even inside the application like `~/Application…
window.showDirectoryPicker opens up a whole new world
61–70 of 122 posts
Re: window.showDirectoryPicker opens up a whole new world
#62Earlier quoted context omitted.
> So websites can now nag users to allow access to the root of their local disk No, Chrome doesn't allow this. Here's a simple demo: https://output.jsbin.com/kekekac/quiet - note that you can't select root, Downloads etc.
Ah yes, totally secure. I’m sure there will be no unforeseen problems or bypasses.
Re: window.showDirectoryPicker opens up a whole new world
#63So websites can now nag users to allow access to the root of their local disk and then read all their files and settings, all their SSH keys and other passwords? From what I gather from the docs [1], this API gives you a FileSystemDirectoryHandle object, and then you just call getDirectoryHandle() on that to recursively read the the entire filesystem. The spec [2] has some vague suggestions about blacklisting certain…
Root directory would be on that blacklist for sure. Those "vague suggestions" actually seem to include some pretty specific examples. > A user’s entire "home" directory. Individual files and directories inside the home directory should still be allowed, but user agents should not generally let users give blanket access to the entire directory.
Re: window.showDirectoryPicker opens up a whole new world
#64both Mozilla[1] and Apple[2] are opposed to it
encouraging people to build apps that only work in google web browsers actively harms the web and sends a signal to google that they can in fact keep doing this
[1] https://mozilla.github.io/standards-positions/#native-file-s...
Re: window.showDirectoryPicker opens up a whole new world
#65> Chrome introduced a new API, window.showDirectoryPicker() that allows the user to grant access to a directory on their computer and allow a website to read/write everything inside. I mean, what could go wrong? It's not like an user is tricked into uploading a file from a folder (let's say, the main "Documents" folder) and some malicious website steals all the files over there.
If you tried this out in Linux, for example, the system would block you from selecting folders that contain files that are flagged as dangerous or "system files". I'm assuming this was implemented across all OSes.
what are websites gonna steal, debian binaries and libraries?
all my important stuff are in my home directory, which is owned (read+write) by me, the same user running the browser.
Re: window.showDirectoryPicker opens up a whole new world
#66I wish we had this in the operating system. It would solve an immense number of risks such as data deletion from bugs and even ransomware.
Which operating system do you mean? Flatpak has this already, Android enforces this kind of API for shared files, Windows UWP has pretty much the exact same API ( https://learn.microsoft.com/en-us/uwp/api/windows.storage.pi... ). App developers will often choose not to sandbox their applications because it's a lot easier (and sometimes faster) do to all file management yourself, but the APIs are there and ready to be…
I was thinking about desktop OS's, actually.
You don't need to use that Windows API. You can just access any file you want. There is no reason a music player, for example, needs to access ~/Pictures. An arbitrary program requiring access to all your files is a huge red flag, but it's a red flag that users aren't allowed to see. Proper filesystem permissions would fix that.
Re: window.showDirectoryPicker opens up a whole new world
#67I wish we had this in the operating system. It would solve an immense number of risks such as data deletion from bugs and even ransomware.
MacOS has this and what happens is that you get into the habit of just clicking through it. It won't help with ransomware, only backups would.
Re: window.showDirectoryPicker opens up a whole new world
#68I'm really excited about window.showDirectoryPicker and the local-first web apps it will enable. There's lots of talk about local-first sync engines, but the best sync engine is one you don't even manage, like the user's file system / cloud storage service!
APIs that encourage websites to store user data in files are a positive thing.