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

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -