Modified from 9to6Mac.com
1. Open Gmail in Chrome and click the Protocol Handler icon in your browser's address bar.
2. When prompted to "Allow Gmail to open all email links?", select "Use Gmail," and click "Done."
Then you're done! Skip steps 3-5.
3. If you were unable to see the Protocol Handler icon , click the Chrome menu icon in the top right corner of your browser, and choose "Settings."
4. Click the "Show Advanced Settings" link at the bottom of the screen. Then click the "Content Settings" button under the "Privacy" header.
5. In the pop-up window, scroll down to the "Handlers" section and click the "Manage Handlers" button. Then select Gmail from the mailto dropdown, click "Done," and, well, you're done!
Sadly, setting up Safari to open mailto links in Gmail isn’t as straightforward as it is for browsers like Chrome and Firefox.
With Safari, you’ll need to harness the power of a third-party mailto extension. The good news is that I’ve vetted this extension, checked out its code, and have verified that it’s legit and contains nothing malicious. You can download the extension here. Not only does this extension work for Gmail, but it also works for other popular web-based email services.
Once the mailto extension is downloaded, double click it to add it to Safari. Click Trust when asked in order to successfully install the extension.
After installation, click the Options check box to open the Options page for the mailto extension. From there, click the Gmail radio button to set Gmail as the default handler for mailto links clicked within Safari.
Before you can start using the mail extension, however, you’ll need to quit and restart Safari. Once you do, clicking email links should open a new composition window inside of Gmail directly in the browser.
Like Chrome, setting up mailto links to open Gmail while using Firefox is super-easy. Open Firefox’s preferences, and click the Applications tab on the sidebar. Find mailto under Content Type, and use the drop down box to select Gmail. After that, just close the preferences page, and you can start opening email links directly inside of Gmail while using Firefox.