Spec
https://wicg.github.io/file-system-access/
Summary
This feature has been supported on the 4 other platforms since M86 and will now be supported on the remaining 2 platforms.
Android platform and its use of Intents rather than file choosers, and content-URIs rather than posix-style paths and semantics provides some challenges, but the intention is that existing code such as the demo link will work unchaged for users to read and / or edit files.
There is one area where I am considering proposing a change to the spec that showOpenFilePicker() could take a boolean hint to indicate the intention of whether files are intended for read-only vs writable which would allow Android to choose between Intent GET_CONTENT (read-only, but supported by more providers) vs OPEN_DOCUMENT (allows for writing to files, but not supported by as many providers).
Original Chrome Status:
https://chromestatus.com/feature/6284708426022912
Original Intent-to-Ship:
https://groups.google.com/a/chromium.org/g/blink-dev/c/9Fcpl2KVfbk
Link to “Intent to Prototype” blink-dev discussion
See Original Intent-to-Ship
Link to Origin Trial feedback summary
See Original Intent-to-Ship
Is this feature supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?
It is now.
Demo link
https://file-system-access-demo.glitch.me/
Debuggability
See Original Intent-to-Ship. Devtools is a little more challenging on android, so I would expect most devs would debug their code on one of the other 4 platforms, but devtools can still be used.
Measurement
Risks
Interoperability and Compatibility
This spec is already proven. Support for the remaining 2 platforms only improves interoperability and compatibility.
Ergonomics
Android uses Intents where other platforms use a file-chooser. The common intents to open a file are GET_CONTENT (read-only, but supported by more providers) vs OPEN_DOCUMENT (writable files, but not as many providers). As stated above, I am considering proposing a change to the API to give JS code control over this.
Android files (content-URIs) do not support atomic writes, or atomic renames. As such, not all operations will be supported, or some operations like move will be implemented as copy. I am in discussion with the Android storage team about what can be possible in the future, but any changes will take time (years).
Activation
Developers already have code using this.
Is this feature fully tested by web-platform-tests? Link to test suite results from wpt.fyi.
Yes, but chromium project does not currently run WPT for android.
https://wpt.fyi/results/file-system-access
Entry on the feature dashboard
https://chromestatus.com/feature/6284708426022912There is one area where I am considering proposing a change to the spec that showOpenFilePicker() could take a boolean hint to indicate the intention of whether files are intended for read-only vs writable which would allow Android to choose between Intent GET_CONTENT (read-only, but supported by more providers) vs OPEN_DOCUMENT (allows for writing to files, but not supported by as many providers).
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CALgRrL%3D05USBgLCdEgg3k9bcxB%2BzU3YXpXU9i8egymV3KJLQbA%40mail.gmail.com.
Thanks Tom and Ashley, I've created:
crbug.com/376097107 - Android FileSystemAccess mime filters are being ignored
crbug.com/376097630 - Android FileSystemAccess opening folder with many files causes chrome to become unresponsive
crbug.com/376097108 - Android FileSystemAccess save-as does not allow creating a new file, only selecting existing
Thanks Tom and Ashley, I've created:
crbug.com/376097107 - Android FileSystemAccess mime filters are being ignored
crbug.com/376097630 - Android FileSystemAccess opening folder with many files causes chrome to become unresponsive
crbug.com/376097108 - Android FileSystemAccess save-as does not allow creating a new file, only selecting existing
crbug.com/376097631 - Android FileSystemAccess save as project folder fails
I don't think clank (chrome on android) currently has any code that does file-saveas, so the interface between chrome and the OS might not have all the required Intent options. I'll take a look at that and the other issues.
Peter, apps that use webview will need to implement WebChromeClient#onShowFileChooser() for the JS code window.showOpenFilePicker() / showDirectoryPicker() / showSaveFilePicker(). I am working on adding more options to WebChromeClient.FileChooserParams to make it clearer when each is being used. The additional options will be available in a future (should be the next) API release. For permissions, the assumption is that if / when the app makes files available to JS code via onShowFileChooser(), the files are considered to have edit permissions. Any app that does not want to allow JS code to edit files should either not implement onShowFileChooser(), or should apply filtering.
Re 'save as folder': yes, it's just showDirectoryPicker({ mode: "readwrite" }). We just describe that as "save as" in our own UI (as it basically means "choose the location with a dialog"). My main point is that things that work on desktop Chrome aren't currently working on Android.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
Thank you Joel for your work to enable this on Andoid and
Webview, and thanks to you and others for ensuring we ship quality
features everywhere. :)