Created
July 11, 2016 22:30
-
-
Save maurizi/7fd704de804e9ee976797d349945b02e to your computer and use it in GitHub Desktop.
Turn Github Branch names into links
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 Turn Github Branch names into links | |
// @namespace maurizi.org | |
// @include https://github.com/* | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
var i; | |
var elems = document.querySelectorAll('.commit-ref.current-branch'); | |
for (i = 0; i < elems.length; ++i) { | |
var elem = elems[i]; | |
var contents = elem.innerHTML; | |
var target = elem.title; | |
var url = '/' + target.replace(':', '/tree/'); | |
elem.innerHTML = '<a href="' + url + '">' + contents + '</a>'; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment