Extra caution is recommended when installing recently uploaded/updated scripts (read more)
Be sure you trust any scripts you install

changeLinks

Allows you to modify the names and paths of all Links and Buttons in Google and most other websites.

This script used to be called "changeGoogleLinks", but I changed the name to better emphasize that this is a global script.

This script will work on many sites other than google as well. Just include the sites you want to modify. You will need to modify the script for each link you wish to change. Detailed instructions are found in the source.

Enjoy.

***UPDATE***
-You now have the option of changing the links path.
-Much easier and more convenient to modify a new link or button

--Coming Soon--
> Support for all links on all sites
> Support for radio buttons and other GUI elements
> Wildcard option for matching text on longer links

*Note* I do not recommend using the Auto Updater with this script as you may lose all your saved changes.

Known list of sites for which this script will work (will get updated when I get less lazy):
-Google
-Facebook (this one is fun to change the names of your friends to something insulting)
-Wikipedia
-Yahoo

If you found it works on any other major sites, post it in the comments and I'll add it to the list.

I should also mention that using this script on a site with a crazy amount of links will slow down the load times of the page. So if you only want to modify one or two links on a site, be very specific with what you include.




11 hours ago
crazian User

sweeeeeeet, when will that happen?

 
Aug 19, 2008
Ahal89 Script's author

So if I understand you right, you want to be able to change a certain link which may have a different name depending on who's profile your on? eg. Add [insert name] as a Friend.

In this version here that is not possible, however it isn't hard to implement. I'll be implementing regular expressions soon, so you'll be able to do tons of stuff with the name matching.

 
Aug 19, 2008
crazian User

i wanna ask if you can make the "Actual Link Text" in var
for example,
this is something i wanna do,
Alan (Actual Link Text, which is Random)
www.facebook.com/detail.php?id=123456 (this is the person's actual address)
www.facebook.com/addfriend.php?id=123456 (this is the link that can direct add friend on page)

what shall i do with your script to make it work?

 
Aug 15, 2008
JoeSimmons Scriptwright

How about I add user script commands then? They can simply click "add change", pick the type, the title, the href, everything.

 
Aug 13, 2008
Ahal89 Script's author

Sounds good. Keep in mind that since this script requires a fair amount of modification to the source from a users perspective, I want to keep it as simple as possible for users less experienced with javascript. So I'll make a "mode selection" method with an additional selection parameter that will call the appropriate modification method.

 
Aug 13, 2008
JoeSimmons Scriptwright

Ok I'll make the code I suggested and post the parts you need to change here. I might have separate functions for changing a link through the href, and changing a link through the title.

 
Aug 13, 2008
Ahal89 Script's author

Another good idea, I'm on vacation for the rest of this week, but there are obviously tons of improvements to be made which I will do upon my return.

For the moment, feel free to modify the script to better suit your needs,

Cheers

 
Aug 13, 2008
JoeSimmons Scriptwright

Well what if 2 links have the same name?
oh and you can just change XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE to 6. Each snapshot type has a number (1-9)

I know another way to work the script that would interest me more.... if you let us supply a link's href, and supply a new text for it. So it searches for the href and replaces that link's text with our set one.

 
Aug 13, 2008
Ahal89 Script's author

Thanks for the tips, as I guess you could tell I've only just started to dabble in JavaScript recently.

However I think I'll leave the option of using indexOf to the user. Consider a site like Facebook where there are many link titles which contain the word "friends" for example. You may wish to modify the "friends" link, but not the "5 of your friends" link. So if you would rather match substrings, then make the change that Joe suggested. Otherwise enter the text in exactly. What I will do, however, is make the equality case insensitive.

P.S, What I'll do later on (too busy now) is allow you to search using substrings, and give the option of only replacing the substring instead of the entire text.

 
Aug 13, 2008
JoeSimmons Scriptwright

Use document.evaluate not document.getElementsByTagName
And you should use if(link[i].innerHTML.indexOf(ExpectedName) !== -1){ not if(link[i].innerHTML==(ExpectedName)){ incase they don't put the EXACT text in.

 
Jul 25, 2008
Ahal89 Script's author

I don't have a list of what sites this will work on for sure, though it seems to work well with wikipedia as well. You'll need to just use trial and error to figure out on what links it will work, and what ones it won't (works on almost all links in Google).

You could comment on this script if you were logged in.