-
Notifications
You must be signed in to change notification settings - Fork 15
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
Folder Handlers #9
Comments
Sorry it's taken me so long to get back to you on this. This is definitely on our roadmap (it'd be really handy for IDE like tools), but probably won't be part of the initial API. We're hoping to add it later, depending on how the initial API is received. Thanks for taking the time to give feedback :) If you have some specific use cases it'll help us with prioritization. |
Now that the spec is complete and File Handling has shipped in Chrome, I think we should extend it with directory handling. This feature would be awesome for all sorts of PWAs, especially for code editors like VSCode.dev. For the API design I'm thinking of something like this:
[
{
"action": string, // destination URL
"title": string, // title that gets displayed in the file explorer's context menu, e.g. "Open with Foo", "Play in Bar", ... (default is `Open with ${PWA_NAME}`)
"icons": [ // the icon to display in the file explorer's context menu (default is the PWA's icon)
{
"src": string,
"sizes": string,
"type": string,
},
...
],
"launch_type": "single-client" | "multiple-clients", // defines whether multiple directories should be opened in a single client or in multiple clients (default is "single-client")
},
...
]
If multiple directory handlers are specified in I'm tagging @tomayac here; I think they might be interested in this discussion. |
I think one problem might be OS interoperability. For example, macOS doesn't seem to expose special directory actions. If VS Code is installed, VS Code could offer itself as a directory handler, but I'm not even sure if this is possible on Mac—it's not implemented for the native VS Code app as far as I can tell. Looking at Electron.js (which I believe the native VS Code app is based upon), it seems like passed files are handled as arguments for |
@tomayac MacOS provides a way to customize the "Quick Actions" menu in the contextmenu of MacOS' finder. It is possible for a human to manually add an "Open folder in VSCode" shortcut to this quick actions menu (see this StackOverflow answer). If a human can do this manually, there should probably be a way for browsers to do this automatically. |
Hmm, this is a tricky one indeed. My idea was that it would be somehow possible to control MacOS Automator from the terminal using some fancy commands and add quick actions that way. The browser would then run these terminal commands internally. I could not find much information about this on the internet, except maybe for this blog post, which does not seem to be a solution to the problem. On Windows, native applications definitely can register their shortcuts in the "more options" menu that you have already pointed out. Native VSCode actually uses this: |
If it involves hackery, I (personally) wouldn't consider it supported.
This I would very much consider supported then. So we have at least one major desktop OS with native support. What about Gnome or KDE as major (at least as far as I know) Linux desktop window managers? |
Sounds good to me, we seem to have decent enough OS support then. The next step would be to drum up some developer excitement. |
On Mac, you can open a folder by dragging and dropping it onto the app icon. VSCode supports this. Some applications (such as Godot) register a file association for the project file, which opens the parent directory for editing. Perhaps there should be an option to expose the parent directory handle at launch? |
Any updates regarding this feature? |
Chrome Apps currently have the ability to register as handlers for folders. It would be great to have the same capability as part of this API.
https://developer.chrome.com/apps/manifest/file_handlers
This is what it looks like:
The text was updated successfully, but these errors were encountered: