[Greasemonkey] hCard and Gmail

Roberto De Almeida roberto at dealmeida.net
Tue Jul 11 21:54:02 EDT 2006


Hi, all.

Today I hacked a proof-of-concept script to parse a hCard and add it
to the Gmail addressbook. The scripts adds a little button below every
hCard that when clicked adds the contact information using a XML HTTP
POST request.

    http://dealmeida.net/projects/greasemonkey/hcardtogmail.user.js

In order to do the POST, I need a cookie called GMAIL_AT from
mail.google.com. Is it possible to read this cookie using Greasemonkey
from a different domain, ie, the one hosting the hCard?

The solution I found was to steal the cookie when the user visits
mail.google.com, and store it using GM_setValue. Later, the script can
use GM_getValue and read the cookie from other domains. Is there a
better solution?

Thanks,
Roberto


More information about the Greasemonkey mailing list