Origin private file system access seems cool, albeit a half measure. Seems like a better alternative than putting blobs into IndexedDB.
Origin private file system access seems cool, albeit a half measure. Seems like a better alternative than putting blobs into IndexedDB.
You mean, just like all other 200 [1] or so APIs that want to request that access?
It's a good thing some browser vendors don't look at these APIs in isolation, but look at the whole picture. So they see all the other APIs that also want to spring a pop up requesting access to something, and are concerned about confirmation fatigue.
[1] Exaggeration. Or maybe not. These days between all the hardware APIs chrome is pushing, and existing APIs like notifications and locations, and half-consensus APIs like file system access and MIDI there might be more than 200 hundred already.
Indeed. That's precisely why some browser vendors don't want to give random access to your computer to any and all website. And don't want to give every app and site access to the data that should be private to a particular web site.
From this point of view sandboxing websites seems like a good compromise.
---
It's also strange that the argument I keep hearing is "but apps have unrestricted access, so to preserve security and privacy... let's give web sites the same access as native apps". It doesn't work lime this.
Indeed. That's why browser vendors (well, some of them) take a dim view of "oh just let them access anything, just pop a confirmation prompt in there"
> There are permission prompts, privacy controls and access limits.
And users are surely aware of those and can definitely understand where to find them, and what implications those have? Literally the entire history of computing tells us: no.
> This is not at all "random access to your computer"
It is. This is already done by MacOS with its incessant "app X wants to access files in Y". Even I, a programmer, and a power user, end up clicking "to hell with it, yes" more often than not. Especially if I'm in the middle of an important task.
Of course this happens a lot after installing a new machine. Once I have my machine running however, I don't encounter this anymore. I think it has to do with the fact that I very infrequently install new applications.
In at least one of those cases I was like "you want my Downloads? Fine, go away" because I was in the middle of some task :)
7 of those are actually available in Firefox at all.
For example, Firefox implemented permissions for enumerating MIDI devices, and Chrome didn't, with predictable results: https://twitter.com/denschub/status/1582730985778556931?s=20
There are many sites which would really benefit from file system access and a unified API so that they don't have to resort to constant upload/download or roll their own virtual file system. It's more than worth slight inconvenience of another popup, and while it also makes scamming less tech-savvy people easier (e.g. if they store all their passwords in the "Documents" folder which the phishing site is now requesting access), there are already so many ways to scam these people that we need better solutions.
"Good sites". Like the "good" apps on Android that ask for a hundred permissions at once. Like that good Android flashlight that ended up settling with FTC: https://www.ftc.gov/news-events/news/press-releases/2013/12/...
Edit:
> there are already so many ways to scam these people that we need better solutions.
We're literally in a discussion about one such solution: reduce the chance of scamming by sandboxing.
And the question isn't just scamming. It's also things like fingerprinting: https://twitter.com/denschub/status/1582730985778556931?s=20
> The FTC’s complaint alleges that the company’s privacy policy deceptively failed to disclose that the app transmitted users’ precise location and unique device identifier to third parties, including advertising networks. In addition, the complaint alleges that the company deceived consumers by presenting them with an option to not share their information, even though it was shared automatically rendering the option meaningless.
> Upon first opening the app, they were shown the company’s End User License Agreement, which included information on data collection. At the bottom of the license agreement, consumers could click to “Accept” or “Refuse” the terms of the agreement. Even before a consumer had a chance to accept those terms, though, the application was already collecting and sending information to third parties – including location and the unique device identifier.
And just to be clear: the permission screen should make it really obvious that a site which can access the file system API can access files on your computer, which can be dangerous, and allow/encourage the user to only grant access to specific directories. If a site requests many permissions, they don't get to hide them within a big TOS, all requested permissions will be clearly shown. And the FileSystem API is already set up to transparently return a virtual file system (https://developer.mozilla.org/en-US/docs/Web/API/FileSystem), so sites won't know if the user doesn't grant access vs. gives them an empty folder.
We could go for a different one: https://cybernews.com/privacy/android-apps-are-asking-for-to...
There's no world in which "good sites" ask for many permissions in one go, and the bad ones don't.
> And just to be clear: the permission screen should make it really obvious that a site which can access the file system API can access files on your computer
When a site/app requests several permissions at once, this "really obvious" becomes a wall of text full of technical and non-technical implications that very few users will read or indeed understand.
We literally have this already on Android and to a somewhat lesser extent on iOS.
I am a real person and I don't want this.
This whole idea is stupid. Another C program with and ability to run arbitrary code off the network written by idiots and nasty folk being given arbitrary filesystem access. Have we learned nothing? We need more controls (MAC / process sandboxing) not less.
Just because someone wants to do something to make their lives easier and asks a set of people what they want who says yes doesn't mean it's a good idea.
I say this as someone who has written desktop/web integration stuff over the years without this.
Only on Hacker News would “we offered users the ability to save to disk and 65% used it” be seen as a sinister conspiracy theory.
The percentages of users who use or don't use specific features, in isolation, cannot be effectively used to determine those users' opinions on the relative merits of those features. There are so many other factors at play that you really need to do some kind of explicit survey to determine whether, just as a for instance, some of those 65% would prefer a different way of saving files but don't have the choice (or think they don't), and, conversely, whether some of those 35% would be happy to use that feature, but don't know about it.
As for writing, you don't get unlimited unchecked writes the way that Chrome's proposed Filesystem Access API grants you, but you can trigger "checked" writes (that show a file save dialog) using `<a/>` elements with the `download` attribute. This is arguably a better user experience, because it keeps the user in the loop, giving them the opportunity to veto (or rename/relocate) the written file—which will be difficult or impossible to do if the Chrome team's proposed API became standard.
Overall, the File System Access proposal is a bad one that gets the developer vs user prioritization wrong (favoring the convenience and satisfaction of the former over preserving control for the latter), and I hope it doesn't become either a de facto or a de jure fixture of the Web platform soon. Here's to hoping for a future post to the Chrome Developers blog announcing that this is yet another experimental API of theirs that they have decided is going to be sunset in some future release.
This is access to some controlled contents that happen to come from the filesystem, with interaction explicitly initiated by the user every time. It gives the browser no access to the structure of the filesystem, no way to navigate it, and crucially no way to transparently read or write anything.
This is good isolation, I'd prefer it to be this way. OFS also gives equally good isolation, I'm fine with that.
Sharing between OFS and the rest of the user's file system should be possible, but only explicitly, a la iOS, Android, and the file upload / download dialog.
> This is not access to the filesystem.
Wrong. I know what "this" is, thanks, and it is access to the filesystem. That's because "this" here—in the subthread you have just posted to—refers to Chrome's experimental implementation of the larger proposal (which is literally called "File System Access API"), not the limited subset described by the submission as having just gotten enabed in Firefox.
While Google's new API definitely is.
It's the `download` attribute, but yeah, I understand the significance of those words. I wrote them.
Your replies in this thread, on the other hand, are confusing at best. What are you actually trying to communicate?
Why is arbitrary access to a whole folder needed? Cool, yes. Dangerous? Very.
Making users repeatedly upload and download the same file to work with it is clunky.
People having been doing that with Word and other local word processors using (SMB) file shares for decades. There's nothing special about web browsers that's causing it.
And if they’re not the sole persistence mechanism, if downloads are just an export option separate from a ‘normal’ save, like you see in most web apps, then the 99.9% of users who don’t constantly export all their documents will have to deal with the consequences of the normal persistence mechanism. That is probably cloud storage, with associated centralization, privacy, and cost concerns, though it could also be browser-local temporary storage (cookies / localStorage / IndexedDB / origin-private file system), with reliability and portability concerns.
I'm insufficiently informed about the differences between File System Access API and Origin Private File Access to have an opinion on which of those I think is a better choice, but please remember that Your Experiences Are Not Universal.
https://developer.mozilla.org/en-US/docs/Web/API/File_System...
....what?! ... World Wide Web Desktop? World Wide Web on my desktop? My desktop on the World Wide Web? There must be some confusion here. : )
If an app becomes desktop app why the heck using a browser?
Windows and Linux do have a way to go in this regard, though. I’ve seen efforts from the Elementary OS team to include some form of permissions in their distro but I’ve not seen it elsewhere in desktop OSes aside from macOS.
Flatpack-ed applications on Linux do have similar sandbox.
It was a web-based clone of the "Strong" Android app - a simple fitness tracker that is basically an excel spreadsheet. I made for myself with no intentions of commercialising.
I stored all the records in IndexedDB but really wanted to persist them to the fs as a file. I was hoping to sync workouts at the user's discretion - put the "workouts" file on you Google Drive or whatever and just load it using the app when you use it.
It wasn't possible, best I could do was a manual import/export.
Worst part was, a few months after I made the app, Chrome dropped a bug on an update that wiped local storage on update, so I lost months of IndexedDB records.
I now look at apps like Google Sheets and Google Docs with disdain. Why can't they be distributed as a PWA that interacts with logical files that exist in my filesystem? Files I can generate from other applications (like performance profilers).
Combine FS access with using WASM as a compile target, suddenly you're writing native cross platform applications in C++, Rust or your language of choice - if WASM ever gets off the drawing board.
I feel like the web is an analogy for Fusion, the good part is always a decade away.
/rant
And files which other folks can generate, like marketing malware injected there by out-of-browser applications and/or shady OS vendors (who might pre-populate data for their own sites, as well as business partners' sites (for a fee, of course), under the pretense of "improving user experience").
If browser-accessible storage is accessible to arbitrary out-of-browser applications, arbitrary package updates and installers can _put stuff there_ or overwrite stuff which is already there. We can be certain that such things would rarely, if ever, be to users' benefit.
With Google Sheets, one thing I find annoying is; I am unable to write/pre-format a bunch of data to a google sheets specific document (containing formulas, graphs, etc).
Instead, I must interact with the Google Sheets API, force the user to SSO, and programmatically assemble a sheet via the API.
It's difficult to distribute templates, and google sheet document links cannot be moved out of Google Drive. If they are, they cannot be recovered when they are moved back into Google Drive.
Macros are evaluated by Google's cloud compute and not locally on my machine, so they have some crazy convoluted way to implement macros.
This is the model a lot of web applications take - "anything happening in the browser is not happening on your computer". I want to view the web as an alternative to GTK, Cocca, WinUI - an ergonomic cross platform GUI toolkit.
Electron is evidence that I am not alone in that thought process. Giving the browser greater capabilities with a sensible user-prompt security model would allow PWAs to replace Electron - reducing the overhead of running several Chromium instances to access applications that are just web apps which need FS access.
Implicit persistent file system storage based on origin is fine, given scripts cannot automatically execute things there. Could use it to store sqlite databases or whatever.
Access to folders and such (like through the filesystem API) also makes sense because it's via a user prompt.
Giving the browser more powers would eliminate the demand for platforms like Electron - which are basically inefficient unsandboxed PWAs
That is the state of web currently. I don't care if FAANG or some standard committee have RFC saying that the storage is persistent, if it is NOT a file on the system it can just go away much like cookies or cache. Just think of what Safari did to indexdb of sites that is NOT bookmarked on the screen.
I've also long felt that "cookies" is a really poor term - these days it really refers to "storage on your local device accessed by websites", and the confusion literally leads to data loss.
element.setAttribute("href","data:text/plain;charset=utf-8," +encodeURIComponent(content))
and element.click() followed by document.body.removeChild(element);
This works perfectly fine for saving single files. FileSystem access API is useful when entire directory needs to be stored and perhaps without the standard SaveAs.. UI.
Giving web and desktop apps the same access - temporarily or permanently alike, no difference - to local data and system will make both the same secure. Or the web one being even less secure as that is inherently remote centered while the desktop could be restricted to local.
Ultimately nothing is secure with a non-paranoic user nowadays so idealisticly no reason not allowing the same access to a web app. But oh there is! Knowing that one does not need to worry at least about a surely web app digging around in the local system above desktop apps that may or may not send local data somewhere is better. Should mitigate the risks not aggravate!
Btw. desktop apps has no unpermissioned access to everything on your system.
“It is not intended that the contents be easily user-accessible” is different from “it is intended that the contents not be easily user-accessible”, and they sure seem to be trying for the latter when they don’t need to, especially given that we know it’ll be a short matter of time until OPFS is being abused in some way.
(I probably shouldn't give any support to Windows by even mentioning it, but doesn't it have built-in sandboxing and especially permissions too these days ? What else the "run as an admin" command is about ??)
Are we really still making this argument in an era where Figma and Google Docs exist?
Figma literally said they had to build a browser inside the browser: https://www.figma.com/blog/building-a-professional-design-to...
I’m not saying the web is the technically best platform to implement a native app, I’m saying that users want to use these complex apps on the web. Making a native app that has to be installed is limiting your audience.
As someone who has used Figma since it’s inception I’ve always hated the web interface. I like software being it’s own application with its own suite of tools and shortcuts that are only beholden to the OS, not the OS + Browser.
They couldn't care less about the tech behind those apps.
Thinking that users "want to use complex apps on the web" is literally what engineers are thinking.
And especially in the actual context of the thread my original point still stands.
I’d argue “users crave native experiences” is the engineer thinking. I have friends, family and hundreds of coworkers using Google Docs. No one cares.
It's free and available everywhere, so you're not imposing on anyone when you share a doc with them. That's the appeal. ~Nobody I know actually likes it. Googlebucks delivering free service is the reason it's dominant. Easy to win a competition by burning cash.
Users would prefer a better product (I'm certain a much better one could even be delivered in the browser—Google's god-awful at writing efficient customer-facing software, especially on the Web) but GDocs wins due to subsidies and network effects. Its winning has little to do with whether customers would prefer native (or just somewhat better in-browser) software.
Native v. non-native, maybe they don't care, but good, yes, they care.
They care. They just can't put in words that engineers understand.
"This is slow", "why can't I copy-paste?", "why is it laggy?", "why does my laptop het up?", "why do I have to wait X seconds for this to open"... All these are "users crave native experiences".
On top of that there are power users. Who may not be engineers, but who rely on certain things that exist in the system. From shortcuts (half of which are hijacked by the browser) to offline use to ...
On top of that a decade of moving everything to web tech has taught users to expect shittiness. Many don't even know that it shouldn't take 10+ seconds for an app containing nothing to open. And yet, here we are. Especially if it's an "app" on a spotty network connection.
Copy and paste on the other hand is a great example of the circular logic at work here: it is an issue and when browsers propose an API to fix the issue everyone throws up their hands and says "clipboard access? in a browser?!?!?" just like they are in this thread with filesystem access. Same with offline access via service workers. So it becomes a self fulfilling prophecy: web apps are inferior because they don't have features native apps have... and they shouldn't be allowed to have those features because native apps are superior. So around and around we go with the same old debate, the only losers are the users that want to just get on with things.
Again: it's because no one ever asks the right questions or actually watches people work. Or watches these apps in general.
Last year Google Docs consumed 20% of CPU on an M1 to scroll a two-page empty document. "They are happy with the solution in their hands".
> Copy and paste on the other hand is a great example of the circular logic at work here: it is an issue and when browsers propose an API to fix the issue everyone throws up their hands and says "clipboard access? in a browser?!?!?"
Nope. It's not "circular logic". If you look at iOS which actually has app sandboxing that you want on desktop (and that people keep complaining about), you are now notified when an app accesses clipboard. Why? Precisely because of the numerous issues with apps accessing clipboard data.
Again, it's funny how in the name of privacy you're literally arguing for giving web sites all the same access as the desktop apps that you complain are security nightmares.
This thread is getting nowhere but I'll leave it with this: the attitude you've outlined here is really patronizing. That these users can't possibly have valid opinions about the tools they use, if they dare to be happy with them they are wrong because you know better than they do. How dare they not care about 20% CPU usage! How dare they!
> it's funny how in the name of privacy
at no point have I made an argument that has anything to do with privacy
> the desktop apps that you complain are security nightmares
nor have I ever claimed desktop apps are security nightmares.
Like I said, I think I'm comfortable wrapping up my contributions here. I don't think conversation beyond this point is productive.
It's not.
> That these users can't possibly have valid opinions about the tools they use, if they dare to be happy with them they are wrong because you know better than they do. How dare they not care about 20% CPU usage! How dare they!
You're ascribing thoughts and words to me that I never said or thought.
> at no point have I made an argument that has anything to do with privacy
What argument did you then make? We're literally in the context of why these things are the way the are due to privacy concerns
> I don't think conversation beyond this point is productive.
I don't think it was ever meant to be productive with opening like "you're thinking like an engineer and can't ever imagine what a user thinks or does"
Users CONSTANTLY bitch about how slow the internet is, and people who grew up with microsoft office in school complain about how mediocre google docs is.
(Also, this isn't so much about the best that can be done, but about what your median developer is able to do and/or median user is going to have to deal with.)
I don’t really see what Hacker News has to do with it. Are we supposed to deny the popularity of things because we don’t think they’re technically impressive enough?
Seriously it's pathetic. Stop making my computing environment worse just because you are too lazy to learn some desktop APIs
I'm not particularly happy about that but it's the way the world works. Calling people who work on the web "lazy" is a ridiculous response. Maybe you should get to work on the one size fits all native framework that will rival the web?
Windows, Android, and Linux all have stores/package managers and I assume/hope some level of sandboxing.
Glad I’m not the only one who get irritated with browser chrome and other “browserisms” like having to include a bespoke menu system that web apps uses instead of the macOS global menubar because browser menus already occupy it.
Google Docs for instance would be a lot more nice and clean without the clutter of the browser toolbar and redundant menu system eating up all that vertical space. It’s simple enough to hack together a WebKit/Electron wrapper to get you the first half, but you’re stuck with the redundant menubar no matter what.
Actually now that I’m thinking about it, it seems like a massive oversight that the PWA spec doesn’t seem to have anything for desktop menus.
I just use a vanilla install of chromium for this.
On all our projects it is already downgraded to "nice to have" status, if it matters at all.