changeElements

By Ahal89 Last update Feb 24, 2010 — Installed 5,009 times.


Script Summary: Allows you to modify Links, Buttons and Images on any website.

This script used to be called "changeLinks" but I changed it as it now modifies more than just links.

This script will work any website. Just include the sites you want to modify. You will need to modify the script for each element you wish to change. Detailed instructions are found in the source (leave a comment if you need any help getting started).

Enjoy.

How to use this script:
You can search for links, buttons and images on any page using regular expressions based on various attributes of the element (i.e innerHtml or image src). The script will then allow you to modify attributes of the elements that were matched by the regex (i.e link target or image src). There is an enormous amount of flexibility with what you can do with this script.

Here is an example:

Google

***UPDATE***
-Ability to modify an image's source, height and width.
-Overloaded methods
-You can now search based on the link's href property.
-Now implements regular expressions to match link names.
-You now have the option of changing the links path.
-Much easier and more convenient to modify a new link or button
*Note* I do not recommend using the Auto Updater with this script as you may lose all your saved changes.

I should also mention that using this script on a site with a crazy amount of links and images may 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.

Regular Expressions
There is now an option to use regular expressions. To enable regular expressions, set the last parameter in the function call to '1'. Any other value will disable regular expressions (ie. it will look for an exact match).

If you have no idea what regular expressions are, then leave the last parameter as 0 (or nothing) and carry on as normal.
If you would like to learn more about regular expressions, there is a tutorial here.

Images Supported
You can change the source height and width attributes of any image.
Here is an example function call that will change all of the localized google images to the standard one. (It's also fun to change all instances of a friend's Facebook profile pic).

modifyImage.bySource("/intl/en_../images/logo.gif", "http://www.google.com/intl/en_ALL/images/logo.gif", 1);