javascript - How do you make Greasemonkey Click a link that has specified text? -
alright want click link changes has same text name. heres example of code might be
<a href="unlock.php?confirm=md5hashere">click here</a>
here starter script that. note uses jquery , assumes running firefox or using tampermonkey, if on chrome.
// ==userscript== // @name _your_script_name // @include http://your_server.com/your_path/* // @require http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js // @grant gm_addstyle // ==/userscript== /*- @grant directive needed work around design change introduced in gm 1.0. restores sandbox. */ //--- note contains() text case-sensitive. var targetlink = $("a:contains('click here')") if (targetlink.length) window.location.href = targetlink[0].href
see also:
Comments
Post a Comment