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

create simple app for simply running "git clone" to local filesystem in chromeos #109

Open
kzahel opened this issue Oct 31, 2014 · 4 comments

Comments

@kzahel
Copy link

kzahel commented Oct 31, 2014

If I click on an anchor with such a url (git: uri scheme) it would be really great if there were a chrome app that would then pop up and ask me where I want to clone it to. The end result should be a local directory is populated with the project in the exact same fashion as if you were to run "git clone" in the terminal. It seems like it would be a great use of this library. Do you think it would be fairly easy to implement?

screenshot 2014-10-31 at 2 18 11 pm

@creationix
Copy link
Owner

What a great idea! Can a chrome app register an url handler and do arbitrary action based on it? I thought the protocol handlers could only return a url.

As far as cloning, most the needed code is there already.

@kzahel
Copy link
Author

kzahel commented Oct 31, 2014

There's a slightly less than ideal way to register protocol handlers. You need to do it on a website. There's no way yet for an app to register the protocol handler for itself (though I can see this coming in a future chrome version)

https://github.com/JSTorrent/jstorrent.github.io/blob/master/js/index.js#L29

But when the app is installed, it could give a notification with instructions for how to install it. (like https://plus.google.com/105605890151842939367/posts/VDaYzQoFDRW)

Once navigator.registerProtocolHandler has the url, you can use chrome.runtime.sendMessage to give the URL to the app (https://github.com/JSTorrent/jstorrent.github.io/blob/master/share/share.js#L129)

@kzahel
Copy link
Author

kzahel commented Nov 1, 2014

Hmm after doing a little searching I found out there may be a small improvement to be made in this process. Instead of using chrome.runtime.sendMessage it looks like this can bypass that step:
https://developer.chrome.com/apps/manifest/url_handlers

@creationix
Copy link
Owner

Also keep in mind that chrome apps can create http servers using
chrome.sockets and a lot of js.
On Oct 31, 2014 7:34 PM, "Kyle Graehl" [email protected] wrote:

Hmm after doing a little searching I found out there may be a small
improvement to be made in this process. Instead of using
chrome.runtime.sendMessage it looks like this can bypass that step:
https://developer.chrome.com/apps/manifest/url_handlers


Reply to this email directly or view it on GitHub
#109 (comment).

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

No branches or pull requests

2 participants