Skip to content

Instantly share code, notes, and snippets.

@javascripter
Created July 31, 2008 09:22
Show Gist options
  • Save javascripter/3429 to your computer and use it in GitHub Desktop.
Save javascripter/3429 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name GMEasyInstall
// @namespace http://d.hatena.ne.jp/javascripter/
// @include http*
// ==/UserScript==
function fixLink(doc) {
$$('a[href$=".user.js"]', doc)
.forEach(function(a) {
a.href += "#";
});
}
fixLink(document.body);
if ("AutoPagerize" in window)
window.AutoPagerize.addFilter(function(docs) {
docs.forEach(fixLink);
});
GM_registerMenuCommand("Install this Greasemonkey",
function() {
location.href += "#.user.js";
});
function $$(selector, context)
Array.slice((context || document).querySelectorAll(selector));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment