Forked from idanpa/clone_github_on_vscode.user.js
Last active
August 10, 2020 16:07
-
-
Save Emilgardis/7a65af4106d66289bc800940912efcbb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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