-
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
Open modes (view vs. edit) and CLI arguments #59
Comments
Hi Brett, To my knowledge, the concept of a "verb" attached to a file association (e.g. "view" vs "edit") isn't something formal in operating systems, it's something that's done informally by applications. The two major file association systems I've worked with (Windows and Linux/FreeDesktop) do not have a concept of a verb. They just associate file types (extensions or MIME types) with applications (.exe files, in the case of Windows) or command-line strings (in the case of Linux). So you can associate ".mp4" files with both a video editor and a video player, but the OS doesn't intrinsically know that one is an editor and the other is a viewer. The two solutions I have seen for this, if one application has two different verbs, would be either:
Either way, given that the OS doesn't properly expose a "verb" primitive, I don't think it makes sense for the web to either. Unless I'm missing something and certain OSes do expose verbs like this. Perhaps you can give some detailed examples of where you've seen this. |
They do actually expose verbs, at least in Windows. See https://docs.microsoft.com/en-us/windows/win32/shell/fa-verbs . Wikipedia states this on a generic page about OSes (though it only gives example for Windows): https://en.wikipedia.org/wiki/File_association#Associations_and_verbs .
Beyond the fact that at least Windows does offer this, it is handy to be able to pass in CLI arguments as per my other request within this issue--and if not done as proper OS verbs (as would be ideal, especially to avoid opening an app which could only handle viewing and not editing), these could at least be supplied as CLI arguments to the app if that were to be implemented. (Btw, if you're looking for inspiration, you might find my WebAppFind project of interest, including its to-dos, as I've given this kind of ability (and others related to it) quite a lot of thought. But thought I'd start with the addition I believe ought to make the most sense to add as an incremental improvement. Some other ideas go more far afield, like the ability to use a context menu within the browser to shuttle off a page or its content into a web app, with the ability for that web app being optionally granted the ability to POST back to the originally user-selected web app--like web intents perhaps but potentially reusing the same mechanism as |
The web's handling of user file's improves upon the security model of native OSes (ex: File System Access API defines user permissions for Having two separate PWAs for viewing and editing is not a good solution, especially when you consider the UI treatment things like
This perhaps suggests a UI for cases where there are multiple applicable file handlers: if there is just one, show an Open option (the first defined handler is the default action). If more than one, then also have an expandable entry that lists all the handlers ( I understand this is different on the OS-level (file association vs context menu extensions) but the semantics seem equivalent (as in,
You can accomplish this with query parameters on the
Will only open It'd also be nice to specify read-only (make launch queue provide a File with read only access) so that this UI can be more accurate for PWAs that truly will only read data. Just to summarize, because there's three different (closely connected) things here:
|
Sorry I had missed your reply from last year @brettz9 . It's true that Windows has "verbs" as a concept (sorry I over-simplified). But that concept of "open", "edit" and "print" is kind of incompatible with the user selecting their own application to open with. Note in that page you linked, there is an "open" "edit" and "print" command, but if the defaults are not set up the way the user wants, their only choice is to go "Open with" and pick an app, and that can only choose an app to use with the "open" verb. I don't think there is any way, outside of direct registry modification, for the user to choose which app handles the "print" verb for a given file type. So my original assessment stands: if not impossible, it is impractical on Windows for web apps to be able to handle multiple different verbs. There is no UI to expose it to the user. And I don't think there is on any other system either. And if there's no reasonable UI to expose it, it suggests that it is too complex to specify. To @connorjclark 's question:
Yes, I believe it is when we're dealing with OS integration topics like this. When we design an API, our explainer must explore how it fits into the natural UI of operating systems in existence. We aren't designing in a vacuum; we're trying to join into existing operating systems. If we specify something that can't be used, then we're giving web designers tools that don't work, and I would rather we don't specify those at all. Furthermore, if no OS exposes a given primitive, it should be a clue to us as platform designers that it isn't a very helpful primitive, or is too complex for users to understand. (As an example, I don't want to individually configure {N file types × M verbs}.) On the 7-zip example: what you're showing there is outside of Windows' file associations system. It's 7-zip manually inserting itself into the Windows Explorer context menu, to add more controls. That's something that some apps do if they want to add many verbs rather than just a simple "open". We could allow web apps to do this, but it would be a much more ambitious system with a lot more spoofing and compatibility concerns. (I don't think other OSes that I know of allow apps to insert menus into the file browser's context menu.) |
One reasonable UI would be to support it at least as a form of blessed command line argument (i.e., blessed to be used for app mode, while allowing other more arbitrary CLI args for other app-designated purposes). Then users could, besides at the command line, create shell scripts which opened their favorite web apps into its desired mode (as well as pass other initial configuration arguments to them, such as a desired theme or whatever). This might even allow alternative UIs to be built with file systems no longer innovating on their own. |
OS' have means to indicate whether a file open is meant to be sent to a viewer or an editor, and as such, this would be handy to have exposed to files opened from the desktop.
In addition this could conceivably be extended with arbitrary (namespaced) command line arguments being passed in to set up a default skin, or other behaviors which a web app might be inclined to support.
Apologies as just exploring this, but I didn't see mention of this in design docs or the explainer.
(I ask you please be aware that I have a disability with "brain fog", so despite my being able to do coding at my own pace, I am much more sharply limited in processing new info than I might give the impression.)
The text was updated successfully, but these errors were encountered: