Sunday, May 18, 2008

Firefox 3 will open mailto: links with GMail

Web-based protocol handlers is a new feature in Firefox 3.0, they allow web-base application to handle non-html protocols, like 'mailto:'. This is becoming more important as applications migrate to the web.

For example you can handle 'mailto:' links to start composing new mail with GMail. How to do this?

0) install Firefox 3 ;) (today they release RC1 version)
1) Go to gmail.com, and run this address line

javascript:navigator.registerProtocolHandler("mailto",
"http://mail.google.com/mail/?extsrc=mailto&url=%s","GMail"
)

2) When Firefox executes this code, it should display a prompt, asking for permission to allow the web application to register as a handler for the protocol.
3) go to mailto:.. to see if it's working

2 comments:

pawelek said...

Please correct your tip! Not javEscript but javAscript ;-) It works and it's very useful for daily using.

Anonymous said...

@Pawelek: thx, it should work fine now.