Skip to content

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

Open

Description

@kzahel

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

Activity

  1. creationix commented on Oct 31, 2014

    @creationix
    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.

  2. kzahel commented on Oct 31, 2014

    @kzahel
    Author

    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)

  3. kzahel commented on Nov 1, 2014

    @kzahel
    Author

    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

  4. creationix commented on Nov 1, 2014

    @creationix
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions