Set Gmail as Your Browser’s Default Email Client with a Simple Hack

Set Gmail as Your Browser's Default Email Client with a Simple HackSick of mailto: links in your browser opening Outlook or Mail.app whenever you click them? You can tackle this problem with extensions or through other means, but Googler and HTML5 guru Paul Irish offers a simple, no-add-ons-required approach. Here's how it works:

  1. Open Gmail in Chrome.
  2. Press Ctrl+Shift+J (Windows) or Cmd+Opt+J (Mac) to open Chrome's built-in JavaScript console.
  3. Paste the following into the console and press Enter:
      navigator.registerProtocolHandler("mailto",                                   "https://mail.google.com/mail/?extsrc=mailto&url=%s",                                   "Gmail");  
  4. Chrome will prompt you, asking if you'd like to "Allow Gmail (mail.google.com) to open all email links?" Click the Use Gmail button.
  5. That's it!

To test that it worked, try this mailto: link, which should open a new message in Gmail with a link to Irish's post over on HTML5 Rocks.

Set Gmail as Your Browser's Default Email Client with a Simple HackIncidentally, this feature has been around in Firefox since Firefox 3, so Firefox users, you can accomplish the same task by following roughly the same steps. However, Firefox has also gone a step further to make this easier. Open Firefox Preferences, click the Applications tab, and type mail into the search filter. In the Action dropdown for the Content Type mailto, select Use Gmail. Easy peasy.

Getting Gmail to handle all mailto: links with registerProtocolHandler | HTML5 Rocks

Tags:

About the author: Pavel Ciorici

 

Share a little biographical information to fill out your profile.

Website: http://www.nuldi.com

 

Recent posts

 
 

Add a comment

required

required

optional