public
Created

Github MD5 Hashes

  • Download Gist
github-md5-hashes.user.js
JavaScript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
// ==UserScript==
// @id github-md5-hashes@erikvold.com
// @name Github MD5 Hashes
// @version 1.0
// @namespace github-md5-hashes
// @author Erik Vold
// @description
// @include http*//github.com*
// @run-at document-end
// ==/UserScript==
 
 
(function() {
 
var $ = function(id) document.getElementById(id);
 
var rawURL = $("raw-url");
 
var infoDiv = GM_xpath({
path: "//div[@class='file']/div[@class='meta']/div[@class='info']"
});
 
if (!rawURL || !infoDiv) return;
 
var ret = GM_xmlhttpRequest({
method: "GET",
url: rawURL.getAttribute("href"),
ignoreCache: true,
onload: function(res) {
var md5 = document.createElement("span");
md5.setAttribute("class", "md5");
md5.appendChild(document.createTextNode(GM_cryptoHash(res.responseText, "MD5")));
 
infoDiv.appendChild(md5);
}
});
 
 
 
})();

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.