Created
July 31, 2008 09:22
-
-
Save javascripter/3429 to your computer and use it in GitHub Desktop.
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
// ==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