Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Emilgardis/7a65af4106d66289bc800940912efcbb to your computer and use it in GitHub Desktop.
Save Emilgardis/7a65af4106d66289bc800940912efcbb to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name clone_github_on_vscode
// @namespace http://greasespot.net/
// @version 0.2
// @description Let you open Github repositories in vscode
// @author idanp, emilgardis
// @match https://github.com/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
var links = document.querySelectorAll("a[href*='git-client']");
for (var i = links.length - 1; i >= 0; --i) {
var oldHref = links[i].getAttribute('href');
var newHref = oldHref.replace(/git-client:\/\/clone\?repo=/, "vscode://vscode.git/clone?url=");
links[i].setAttribute('href', newHref);
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment