Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mattn/226662 to your computer and use it in GitHub Desktop.
Save mattn/226662 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name gist: replace title with filename
// @namespace http://d.hatena.ne.jp/youpy/
// @include http://gist.github.com/*
// @exclude http://gist.github.com/gists
// ==/UserScript==
(function() {
var $ = $ || unsafeWindow.$;
var username = $('#owner a').text()
var filenames = $.map($('span.code'), function(a){return a.textContent})
if(filenames.length) {
document.title = document.title.
replace(/^(gist: \d+)/,
'$1 (' + filenames.join(', ') + ') by ' + username);
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment