Last active
November 10, 2018 22:20
-
-
Save blubbll/f4fe5a61053ea57ab8a3f166c791ce2b to your computer and use it in GitHub Desktop.
GitHub Userscript for rawgit instead of rawgit. (https://rawgit.com/)
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
//GitHub raw to RawGit. enjoy. | |
//Example: | |
//https://github.com/lokesh/color-thief/raw/master/dist/color-thief.min.js | |
//becomes | |
//https://rawgit.com/lokesh/color-thief/master/dist/color-thief.min.js | |
var rawgitURL = 'http://rawgit.com'; | |
//If this Button exists (raw button) | |
if (typeof document.getElementById("raw-url") != "undefined"){ | |
//Set href of element by getting the original source and appending rawgit | |
document.getElementById("raw-url").setAttribute("href", | |
rawgitURL + | |
document.getElementById("raw-url").getAttribute("href") | |
.replace('/raw', '')); //fix url | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment