rpwoodbu / mosh-chrome

Mosh for Chrome
GNU General Public License v3.0
372 stars 59 forks source link

Protocol handler (mosh://) for bookmarks and links #81

Open rpwoodbu opened 9 years ago

rpwoodbu commented 9 years ago

It may be possible to register a custom protocol handler (e.g. mosh://) using navigator.registerProtocolHandler or similar. This could make it possible for bookmarks to be created to mosh sessions, which could act as a poor-man's connection manager.

Also see this, although it may not be relevant in this context: https://developer.chrome.com/apps/manifest/url_handlers

rpwoodbu commented 7 years ago

This seems increasingly possible. I've noticed that Secure Shell is asking for permission to add a protocol handler. At the least, we could ask to associate with ssh://, but that may not be nice.

vapier commented 7 years ago

in case you try to use the JS API like nassh does, it isn't well documented that it only works in direct response to user input. i.e. a callback from a mouse click or a keyboard press. you can't add it to something like an onload event -- the call is silently ignored which is obnoxious for debugging.

you won't be able to request mosh:// as it isn't a whitelisted schema: https://developer.mozilla.org/en-US/docs/Web/API/Navigator/registerProtocolHandler#Permitted_schemes

you should be able to do web+mosh:// but obviously that's a bit ugly :/

no idea if the chrome manifest support is more flexible

I wouldn't feel bad about mosh also asking the user to register ssh://. they can always say no, or change it later in their settings. this goes into more detail: https://chromium.googlesource.com/apps/libapps/+/master/nassh/doc/FAQ.md#Can-I-create-bookmarks-to-specific-sites