Fork me on GitHub
Its the Code garbage collector. Mind dumps of daily coding antics from a frustrated silly little man. VBS, PHP, TCL, TK, PERL, C++, JAVA....what now? Ruby?
No Wait.. It should be just RUBY!

20070215

Gmail HTML Signatures - GreaseMonkey script

So of course you cant create html signatures in gmail... ergg!

Silly rabbit, you can drag and drop images/html into the gmail Richtext editor...
well that just will not do.

So that would mean - greasemonkey script! Im not going to waste any time here.
GMAIL HTML SIGNATURE - Install this Script
//
// Released under the CC Attribution 2.5 license
// http://creativecommons.org/licenses/by/2.5/
// --------------------------------------------------------------------
//
// This is a Greasemonkey user script.
//
// To setup, insert html signature code into:
// * html_signature
// --------------------------------------------------------------------
//
// ==UserScript==
// @name GMAIL HTML Signature
// @namespace http://shad0wbq.answorld.com/
// @description Insert HTML signature into GMAIL
// @include http://gmail.google.com/*
// @include https://gmail.google.com/*
// @include http://mail.google.com/*
// @include https://mail.google.com/*
// ==/UserScript==
//
var html_signature = '<div style="margin: 0 auto 0 auto; margin-top: 5px; margin-bottom: 5px;" >' +
'<a href="http://feeds.feedburner.com/Codeburst">' +
'<img src="http://feeds.feedburner.com/Codeburst.gif" style="border:0" alt="codeBurst"/>' +
'</a></div>';

window.setTimeout(function() {
//Debug Frame window
// alert(window.frames[0].name);
if (window.frames[0])
{
if (window.frames[0].name == "v2_hc_compose")
{
var logo = window.frames[0].document.createElement("div");
logo.innerHTML = '<br><br>' + html_signature
window.frames[0].document.body.insertBefore(logo,window.frames[0].document.body.lastChild);
}
}
}, 600);

9 comments:

Scott Sanders said...
This comment has been removed by a blog administrator.
Pablo Benitez Barreto said...

Are you sure this is working? I couldn´t use it.Thanks

shadowbq said...

if your having any problems.. you may have to increase the timout.. the only problem with that is the load time increases..

change 600 => 1500 milliseconds.

l3utterfish said...

not working for me.. i installed it.. cahnge the code to my blog.. and now what im i suposse to do?? does it appear automaticly on new email compostition?

Tatiana Q said...

So how do you use it?

Anonymous said...

I get an error saying " window is undefined" and does not execute fully.

shadowbq said...

It appears that there are couple different things happening. One is the lag time of browser loading the iframe. The iframe is located within the body of the text of the email. You may need to tweak the iframe name and load time depending on your different configurations of gmail composer.

Anonymous said...

so how do I edit the script before I install it. it works fine as is if I want feedburner as my email sig. heh

Anonymous said...

Working Gmail 2.0 Multiple HTML signatures:

http://userscripts.org/scripts/show/20887