10 Extensions 200 Extensions Custom Deal Finder Recover Lost Bookmarks in Firefox Image Generators for Web Developers
Collapsed Today Collapsed CyberNotes
Collapsed Yesterday

HTML Signatures for Gmail 2

November 9th, 2007
21 Comments Written by Ryan


Gmail 2 Logo We just wrote about how Gmail 2 breaks a lot of the Greasemonkey scripts that are available, and Gina from Lifehacker turned right around and released Better Gmail 2. As expected this version only has a fraction of scripts that the original extension had, and it still lacks some of my favorites: Google Calendar integration, Google Reader integration, and Folders4Gmail. None of those scripts have been made compatible with Gmail 2 yet.

One script that I have to have is one for automatically inserting HTML signatures into my emails. The script I used previously wasn’t all that complicated, and I decided to go ahead and fix it myself. I took it one step further, however, and made it work with both the new version and the old version of Gmail.

Note: This script is designed to insert your signature at the beginning of replies/forwards, instead of at the end.

Here’s what you have to do:

  1. Download and install Greasemonkey if you don’t already have it.
  2. Install the script
  3. You’ll need to have the HTML code for the signature that you want to insert. Once you have that just go to the Greasemonkey script manager and edit the script’s HTML signature. The code looks something like this (insert the signature where you see the green text):

    var htmlSignature = ‘<br>–<br>Ryan Wagner, Founder/Editor<br><a href=”http://cybernetnews.com/”>CyberNet Technology News</a><br><a href=”http://cybernetnews.com/”><img src=”http://feeds.feedburner.com/CyberNet.gif” style=”border:0″ alt=”CyberNet Technology News”/></a>‘;

    top.window.setTimeout(”top.window.frames['main'].frames['" + parent.name + "'].document.getElementById(’hc_compose’).contentWindow.document.getElementsByTagName(’body’)[0].innerHTML = ‘” + htmlSignature + “‘ + top.window.frames['main'].frames['" + parent.name + "'].document.getElementById(’hc_compose’).contentWindow.document.getElementsByTagName(’body’)[0].innerHTML;”,500);

    var allBody = document.evaluate(”//body[@class='editable tr-field']“, document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
    allBody.snapshotItem(0).innerHTML = htmlSignature + allBody.snapshotItem(0).innerHTML;

This script does work with Opera, but only with the older version of Gmail. I used a special Firefox-only searching property to insert the signature for the new version of Gmail, and the reason being that Gmail 2 has some issues in Opera. In fact Opera users won’t even see a link to the newer version of Gmail unless they are masking the browser as Firefox or IE.

RSS Icon Enjoyed the post? Subscribe to our feed to get a daily dose of CyberNet!

Tags: Firefox, Freeware, Software, Web Sites, , , , ,

Learn Firefox
Previous ArticleNext Article
 

Related Posts:


21 Unread Comment Tracking CyberMark This Article
RSS Icon
21

  1. Avatar

    Hi, thanks for your work porting the script to the new Gmail version, but for me it’s not working… It’s installed correctly and I’ve tried changing or leaving your html sign. Whatever the case it’s always displaying the signature in the setup of gmail and not the html one. I’ve also put the html sign in the gmail settings but it’s displaying the html code inline, not the desired html rendering.

  2. Avatar

    Same here. It works with Gmail 1, but not Gmail 2. Also, in Gmail 1, it does not work with replies.

  3. Avatar

    same here, does not work in gmail 2

  4. Avatar

    I fourth this. Thanks for the effort though, I really want this script back! :)

  5. Avatar

    Hmmm, it works for me in Firefox 3 with Greasemonkey. I’ll have to try it out in Firefox 2. Thanks for the heads up.

  6. Avatar

    Hi, anything new to work with Firefox 2 and Gmail 2 with HTML Signature?

  7. Avatar

    This script not working for me in ff2 w/greasemonkey.

  8. Avatar

    Unfortunately I haven’t had time to work on the script. One thing that I forgot to mention was that the URL’s only work for the .COM version of Gmail, so if you’re using Gmail in a different country you’ll need to update that part of the code.

  9. Avatar

    dont work even with all update and latest update to Grease monkey (jan 22)

  10. Avatar

    ff2 with latest Grease Monkey version installed (today). No luck.

    Works fine for me in GMail v.1, but nothing in v.2

    Thanks for trying though.

  11. Avatar

    Are you guys using it on a domain other than .COM?

  12. Avatar

    Here’s an idea, how about just the signatures?

  13. Avatar

    PLEASE build a signature only extension, otherwise I will be forced to use outlook for this reason and only for this reason.

  14. Avatar

    Don’t Worry!

    Install Greasemonkey Firefox add-on
    https://addons.mozilla.org/en-US/firefox/addon/748

    Install Gmail HTML Signatures
    http://userscripts.org/scripts/show/20887

    Be Happy!

  15. Avatar

    Nice find Rodolpho, but now I’m just trying to figure out how to setup my signature with it.

  16. Avatar

    Awesome, the original gmail signatures has been updated :-). FYI, it only works with Gmail 2.

    To Ryan: Go into gmail itself, and set it up there. No need to edit the script directly.

  17. Avatar
    Justin Goldberg wrote:
    Awesome, the original gmail signatures has been updated :-). FYI, it only works with Gmail 2.

    To Ryan: Go into gmail itself, and set it up there. No need to edit the script directly.

    I did realize that’s how to set it up, but it took me a minute to notice that the script isn’t compatible with Firefox 3. That’s where my problem lied.

  18. Avatar

    Firefox 2 4-ever!@

  19. Avatar

    :D HTML Signatures for Gmail 2 Working with FF3 beta 4

    Gmail HTML Signatures not working wery well with FF3 :(

:mrgreen: :| :twisted: :arrow: 8O :) :? 8) :evil: :D :idea: :oops: :P :roll: ;) :cry: :o :lol: :x :( :!: :?:

Note: All links posted in comments will automatically be hyperlinked.

↓ Expand Text Area  or  Decrease Text Area ↑

 Find out how to track new comments!


 

  1. Firefox Extension: Better Gmail 2.0
  2. How to embed Virtual Toll Free into Gmail signature - Voxalot / SIP Broker Support Forums