Skip to content
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

Add NativeFS support #143

Closed

Conversation

christianliebel
Copy link
Contributor

This PR introduces support for the Native File System API, currently experimented with by Chrome. The API isn’t generally available yet, so for testing it you would either have to enable the flag or request an Origin Trial token.

The new script makes use of ES6 language features. Using <script type="module"> prevents the script from being loaded in non-ES6 browsers, which won’t support NativeFS anyway. Using this method, we can progressively enhance the codebase.

@kenchris
Copy link

This is soon launching in Chrome (not next release, but the one after as currently scheduled) - what is holding this up?

@1j01
Copy link
Owner

1j01 commented Jul 8, 2021

I tested this PR and it didn't work because it was written using an older version of the API.
I appreciate you using the system* hooks system, but I already felt that system needed to be redone, and so I've massively restructured the file handling, and implemented File System Access API support in a branch with lots of other improvements. Hopefully I'll release that soon, but no promises.

  1. Unfortunately the FS Access API doesn't yet support specifying a default filename for the dialog, so I can't implement seamless Save As. And it doesn't support retrieving the selected file format, so I can't use it for choosing the file format. I implemented a stopgap solution where I show two dialogs, one just for the file format, and then the native file saving dialog. Some people might prefer the old behavior of simply saving to your Downloads folder.
  2. I plan on adding a dialog that warns users about the new possibility of overwriting files, as I imagine some people have gotten used to using Ctrl+S to save a new file (I know I did!), with an option to hide the dialog permanently. This could be removed later, once a good portion of existing users are assumed to be up to speed with the new behavior (say, half a year, if it's not too annoying).

@1j01 1j01 closed this Jul 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants