Friday, May 27, 2005

Mailto Envelope Script

This is my first GreaseMonkey script: The Mailto Envelope script.

Its sole purpose is to make mailto links more obvious because mailto links look just like regular html links. What the script does is it scans all the links on a webpage, looking for the mailto links. When it finds mailto links, it unlink it and add hyperlinked envelope to it.

Features(v0.1):
  • Use image of envelope instead of unicode
  • Add title of the envelope showing its exact mailto address
  • Leave graphic links like email buttons alone
  • Only focus on HTML pages (http:// and https://) and local files (file://)
ADDED(v0.2):
  • Mailtos unlinker are now toggeable. Just edit "var unlink = 1" to "var unlink = 0" to turn off the unlinker.
Screenshots:
Without script
With script

(screenshots were taken while testing on http://www.ianr.unl.edu/internet/mailto.html)

Tested on wide range of various web pages including forums and discussion boards.

To install: Right-click the Mailto Evnelope link and click on "install user script...". Firefox with GreaseMonkey required.

The reason why I worked so much on this supposdly simple script is because it is my philosophy as a programmer to pay attention to every detail of my works, no matter how small.

Please post any bugs or comments you have about this script here or send email to me.

6 comments:

Anonymous said...

Nice work. This, your other mailto script, and the Mailto links to GMail compose all work seamlessly together. Thanks!

Anonymous said...

Good stuff. I'm totally new to this sort of thing, but one thing I've been fiddling around to try and make happen is that I want the envelope before text, rather than afterwards. Any ideas? Thanks.

GamingFox said...

See the line "links[i].parentNode.insertBefore(a, links[i].nextSibling);"?

Change it to:

"links[i].parentNode.insertBefore(a, links[i]);"

That way it will be put before the link instead of the link's next sibling.

Unknown said...

So then, does this complately disable (and defeat the purpose of) the link as well?

GamingFox said...

The image of the envelope will always be linked. You can click on it and still get to send emails.

Whichever you want to unlink the text or not, is up to you. Thats why it is toggable, just change "var unlink = 1" to "var unlink = 0" just to leave text link alone while adding linked evnelope right next to it.

Anonymous said...

Who knows where to download XRumer 5.0 Palladium?
Help, please. All recommend this program to effectively advertise on the Internet, this is the best program!