Wednesday, June 18, 2008

Set Firefox 3 to Launch Gmail for mailto Links

Add Gmail as application handler
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 to open certain types of links. This means that when you click on an email address that uses the standard mailto: email protocol, 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. Here's how to configure Firefox 3 to use Gmail as your default mailto: application handler.

Ready to set up Gmail? Roll up those sleeves.

  1. Open Gmail in Firefox.
  2. In the tab where Gmail is loaded, copy and paste the following snippet of 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 code instead, but replace example.com with your domain name:
    javascript:window.navigator.registerProtocolHandler("mailto","https://mail.google.com/a/example.com/mail/?extsrc=mailto&url=%s","GMail")
  3. Firefox 3 will ask permission to add Gmail as default mailto handler. Click the Add Application button, as shown.

Update, 6/18/08: Thanks to a great tip from a reader Andrew, the instructions above have been shortened considerably. Thanks, Andrew!

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.

gmail-handler-choice-win.png

**Updated 5/21** If this trick doesn't work for you, go into about:config and make sure that network.protocol-handler.external.mailto is set to its default value true.

***Updated 5/21*** To remove the Gmail handler, in Firefox's Tools menu, choose Options. (Mac users, go to the Preferences dialog.) In the Applications tab, search for mailto. From the drop-down of mailto handlers, choose Applications Details, as shown. Here you can select a webapp handler and Remove it using the button.

gmailremovehandler.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!