Access to a persons files destroys all security.
Is the issue just that it would widen the attack surface too much in the event of a potential bug that could compromise the browser sandbox and/or the same origin policy? Or is there more nuance that I'm missing?
For one it has to be clear to the user. Is he granting one time access or repeated access? Which sites are getting the access? Is it actually the exact page I see or some code loaded from elsewhere? etc.
The other part is the sandboxing part. Sandboxing access to file systems is hard. How do you deal with symlinks, hard links, ... (maybe there is a different vulnerability allowing to create those and both techniques together lead to an dangerous exploit?) what amount of the path name etc. are available to the application (this might i.e. link the username, which might be derived from a full name, think about /home, /Users, C:\Documents and Settings\ but might be useful to show) and then, again, the related real-life user issue: not all users have all their music in a distinct folder structure, but probably mixed with other files, and oh, they want to play the files freshly put into "Downloads", too ...
Granting such access is a can of worms ...
I use to rip torrent websites by de-paginating their browsable tables of things to hold 2000 entries each and saving it as .html. The search engine got with some dumb ajax thingy that would just perform a full text search on the link.textContent.
small print: The browser would still "download" the files before you could open them in other applications.
But I'm not sure if this local file access "security hazard" got patched.
A local webserver and a little scripts for writing files. Plus symbolic links to your music folders maybe? I never tried the symbolic links part, but surely there is a way to make that work.
All of that is very achievable, except the "web app" part. I think it might be about time for me to just give up on that pipe dream and start building an Electron and/or React Native app instead.
Unfortunately, there doesn't seem to be a way around the fact that web apps have no persistent access to the local filesystem, and thus would have to duplicate any locally stored music in browser-based storage in order to maintain its own fully synchronized library.
I can understand why this restriction is in place as a security measure, but it significantly limits the appeal of any web app that performs any kind of synchronization of files. I sometimes wonder if persistent filesystem access is really such a huge security risk for web apps that even asking for explicit permission grants from the user and limiting access to user-specified directories is not enough to make it an acceptably secure capability for inclusion in web browsers?