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

Image Fix and Linkify

Reload missing images, and linkify images.

Original description (check latest description below)

This script adds anchors (linkify) to originally unclickable images. Image opens in the same tab. If you want to open in new tab, uncomment one line in the source file (check yourself).

If the image is originally clickable, this script leave it alone. After linkification, no link border is around the original image.

Also, this script add a "< Unavailable Image >" alt text to the images which are originally have no alt text.

We know in Firefox, if an image cannot be shown, there is no image place holder, and we do not even know there should be an image. However, if this image has alt text, the text is shown.

If you see any "< Unavailable Image >" text in the web page, it means there should be an image, but it is not available now.

Those images originally have alt text are untouched.

Description after 05/18/2008

I updated my Firefox to 3.0, and noticed the script does not function properly. Also, I found that Firefox holds image placement for some images (browser.display.show_image_placeholders = true), not all. Now Firefox has "Show Image", but not "Show all missing images". Seems this script is still valuable, and I decide to rewrite the script.

Now the missing image is shown as the default icon of Firefox (resource://gre/res/broken-image.gif). For images originally without an "alt" attribute, you can reload them using the Greasemonkey menu. Reloading does not affect loaded images. I added many comments in the code to explain the mechanism. If you are interested, read them :-)

Besides, I added several constant booleans at the header section of the script, which control certain behaviors. For example, if you do not want to use linkification, turn "useLinkification" to "false"; if you want to open images in new tab, set "linkInNewTab" to "true";

Known Issue


If an image's parent nodes, directly or not, has associated event, that image will be falsely linkified and the event will not be triggered. For example,


<div id="parentDIV" onclick="alert('Hello World!');">
<img src="http://www.example.com/image.jpg" />
</div>

Although scanning parent nodes of every image node can solve the issue, it will take noticeable time for large pages. Please exclude those pages for this script.

Version History

1.1 on 05/18/2008:
- Rewrote the script to support Firefox 3.

1.0.2 on 05/07/2008:
- Added "Reload missing images" function (Greasemonkey user script menu).

1.0.1 on 03/30/2008:
- Fixed problem when an image is assigned some events, such as onClick or onMouseDown. This problem may cause some script-based pages malfunction.

1.0 on 03/14/2008:
- This script is incompatible with Windows Live Hotmail. I added it in the exclude list. If you find any other incompatible site, please tell me. Thank you!

Test area:

Please switch this script on and off to see difference.

1. Normal plain image:
2. Image originally with link:
3. There is an invalid image after the colon:





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