-
-
Save anfedorov/1100396 to your computer and use it in GitHub Desktop.
This userscript is meant to be an example on how to use jQuery in a userscript on Google Chrome.
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 helpers | |
// @namespace anfedorov | |
// @include * | |
// @author Andrey Fedorov | |
// @description | |
// ==/UserScript== | |
function load(library) { | |
var script = document.createElement("script"); | |
script.setAttribute("src", library); | |
document.body.appendChild(script); | |
} | |
function load_jQuery(callback) { | |
var script = document.createElement("script"); | |
script.setAttribute("src", "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"); | |
document.body.appendChild(script); | |
} | |
jQuery("a.q1[href*=item=]").map( | |
function () { | |
$(this).attr( | |
'href', | |
"http://theunderminejournal.com/item.php?realm=A-Aerie%20Peak&item=" + $(this).attr('href').match("/item=([0-9]+)$")[1] | |
); | |
} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment