-
-
Save youpy/26473 to your computer and use it in GitHub Desktop.
gist.user.js with fixed script URL
This file contains hidden or 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 gist.user.js | |
// @namespace http://github.com/hotchpotch | |
// @description install greasemonkey (user.js) | |
// @include http://gist.github.com/* | |
// @include https://gist.github.com/* | |
// @require http://gist.github.com/3242.txt | |
// ==/UserScript== | |
(function() { | |
if(!location.href.match(/gist\.github\.com\/\d+\/?$/)) | |
return; | |
$X('id("files")//div[@class="info"]/span').forEach(function(e) { | |
var filename = e.innerHTML; | |
if (/\.user\.js$/.test(filename)) { | |
var el = document.createElement('a'); | |
el.href = location.href.replace(/\/?$/, '') + '.txt?' + filename; | |
el.innerHTML = filename; | |
e.parentNode.replaceChild(el,e); | |
} | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment