-
Notifications
You must be signed in to change notification settings - Fork 199
File system access API #1713
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
File system access API #1713
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
66f85d2
File system access API
captainbrosset ef9a9a0
Update features/file-system-access.yml
captainbrosset ffd2c5d
Merge branch 'main' of github.com:web-platform-dx/web-features into fsa
captainbrosset 2272d95
Add comment about DnD discussion
captainbrosset File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| name: File system access | ||
| description: The `showOpenFilePicker()`, `showDirectoryPicker()`, and `showSaveFilePicker()` methods request access to files and directories on the user's device and returns a handle for reading and writing to them. | ||
| spec: https://wicg.github.io/file-system-access/ | ||
| caniuse: native-filesystem-api | ||
| group: file-system | ||
| compat_features: | ||
| # api.DataTransferItem.getAsFileSystemHandle is likely to be part of a drag and drop feature, but it can't be in both features at once. See https://github.com/web-platform-dx/web-features/issues/1173 for details | ||
| - api.DataTransferItem.getAsFileSystemHandle | ||
| - api.FileSystemHandle.queryPermission | ||
| - api.FileSystemHandle.requestPermission | ||
| - api.Window.showDirectoryPicker | ||
| - api.Window.showOpenFilePicker | ||
| - api.Window.showSaveFilePicker | ||
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| name: Origin private file system | ||
| description: The `navigator.storage.getDirectory()` method returns a `FileSystemDirectoryHandle` that is restricted to a specific origin and invisible to the user's actual file system for faster file-based applications, such as SQLite databases. | ||
| spec: https://fs.spec.whatwg.org/#origin-private-file-system | ||
| group: file-system |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| name: File system access |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this might be part of a distinct thing, like https://caniuse.com/dragndrop. What do we lose by leaving it out of this feature?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's part of file system access, albeit of course it's also part of drag and drop. FWIW, we document it in the context of file system access at Google:
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK @captainbrosset can you add a comment to this file saying something like the following?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leaving it out doesn't change the overall feature support data.
It's worth thinking about why it's here though. This method is an extension to the dragndrop feature which allows you to turn a dropped file/directory into a
FileSystemHandle, which then allows you to write to it, just like if you had opened it usingshowOpenFilePickerinstead.Overall, I can think of 4 different ways to get access to a
FileSystemHandle, and using one of the show picker methods is just one of them:showOpenFilePickerorshowDirectoryPicker.getAsFileSystemHandle.window.launchQueue.setConsumer()to retrieve the file when the installed PWA is launched after double-clicking an associated file.I think this feature should not only cover the show methods, but also contain the various methods/interfaces that let you play with FileSystemHandle objects in code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IDB requires having gone through either D&D or the picker methods. File handling could be an independent feature (OS integration), but I can also agree to it being part of overall file system.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not objecting to its inclusion here. I just really want the
https://github.com/web-platform-dx/web-features/issues/1173text in the YAML file somewhere, because I think these file APIs are going to be rather central to figuring out BCD keys shared across multiple features. When it comes time to tackle that problem, I want breadcrumbs to the places where that's significant.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. I'll add a comment about this in here.
@tomayac I agree that File Handling should be its own separate feature.