Set Firefox 3 to Launch Gmail for mailto Links

In today's earlier list of five extensions you won't need in Firefox 3, we said you won't need any special toolbars, third-party apps, Greasemonkey scripts, or extensions to get Firefox to use webapps like Gmail to open certain types of links—like email mailto links. This means that when you click on an email address that uses the standard mailto: link, Firefox 3 itself can launch Gmail instead of a desktop app. By default, the Firefox RC 1 only comes with Yahoo! Mail as a possible mailto: link handler, which leaves Gmail users out in the cold—unless you know how to set it up by hand, that is. Here's how to set up Gmail as your default mailto: webapp.

Word of Warning: This workaround involves disabling a security feature that ships with Firefox 3, which prevents your browser from registering link protocol handlers from a domain other than the one it's registering. Only proceed if you are comfortable doing that.

  • Type about:config into the address bar.
  • Type gecko.handlerService into the search box until you locate the gecko.handlerService.allowRegisterFromDifferentHost key/value pair. Set it to true.
  • Copy and paste the following javascript into your address bar:
    javascript:window.navigator.registerProtocolHandler("mailto","https://mail.google.com/mail/?extsrc=mailto&url=%s","GMail")

    If you are a Google Apps user, use this instead, but replace example.com with your domain:

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

    Firefox 3 will ask permission to add Gmail as default mailto handler. Click the Add Application button, as shown.
    addapplication.png

Now, if you click a mailto: link—try the tips link on Lifehacker's sidebar—Firefox 3 will ask which application you want to use. Choose Gmail, and select "Remember my choice for mailto links" to set the preference permanently.

gmailhandlerchoice.png

Firefox 3's new ability to register webapps as link handlers has lots of potential usage, for everything from fax and telephone numbers to IM buddy name links. Setting up your mailto handler is just the beginning. Read more about Firefox 3 web protocol handler possibilities. Thanks, readme!


Comments

    excellent tip

Join the discussion!

Trending Stories Right Now