19 December 2011

Set Gmail as default email client in Opera

I described in an older article how to make a webmail service, in this case Gmail, your default email client in several browsers. With the release of Opera 11.60 at the end of December, setting this up got slightly more user-friendly. now supports custom protocol and content handlers, meaning that adding Gmail as the default protocol handler can be done directly in the browser, following these steps:

  1. Login to your Gmail account in Opera;
  2. Type the following command in the address bar and press Enter:
    javascript:window.navigator.registerProtocolHandler("mailto","https://mail.google.com/mail/?extsrc=mailto&url=%s","Gmail")
  3. Confirm at the prompt and you’re done!

The next time you click on a mail-link (you can try it out at this test page) you will see another prompt to choose your default application for mailing and Gmail should now be one of the options. If you change your mind later, the setting can be changed from the Opera Preferences, on the Advanced tab under Programs.Opera use Gmail as mail client

In theory, this method should also work in , since it also supports registering web services as protocol handlers. The procedure above seems to work without error, however when I actually click on a mailto:-link, the browser throws up an error: ‘This webpage is not available’. My guess is that the protocol for mailto: is not yet fully implemented in Chrome, otherwise this wouldn’t work in other browsers.

Update: After a couple of weeks, the tip above started working in Chrome as well; it’s probably one of the final tweaks applied before releasing the stable version 17.

19 comments:

  1. Many thanks! We have tried to accomplish this for year! Bravo!!

    ReplyDelete
  2. I'm on 11.60, and I don't get any kind of confirmatory prompt. The command seems to have no effect at all. Help

    ReplyDelete
  3. Hi!
    The code above only works if you run it from the address bar of a tab where Gmail is loaded, from any other tab it will have no effect.
    Otherwise you should check the advanced settings in opera:config for an entry called Disallowed Web Handlers that can prevent websites to register themselves as handlers for webapps. Reset the setting, because the default is 'allow' and it should work.

    ReplyDelete
  4. Finally! :-) But still, why it is so cumbersome... ;-)

    ReplyDelete
  5. I have version 11.60 as well and am having the same difficulty (no confirmatory prompt). I checked the Disallowed Web Handlers and made sure it was set to default but to no avail :(

    ReplyDelete
    Replies
    1. Hmm, I don't know what to say in that case... it could be some sort of bug.
      Have you checked if Gmail is listed as a handler under Options > Advanced > Programs?
      Another thing I noticed on the change log page for Opera 11.60 is that they changed the UI related to handlers: "Web handler toolbar not invoked for mailto protocol after another protocol handler has been deleted". Maybe you accidentally deleted another handler and now the dialog won't show... Weird design choice if you ask me!

      Delete
    2. I just checked and the protocol mailto: is listed under Advanced > Programs. Although it doesn't say "Gmail". If I try and edit it I have these options:

      Open with Opera
      Open with Webmail service > (the ones that ship with Opera)
      Open with Default application> .exe" "C:\Windows\system32\url.dll", MailToProtocolHandler%.... (I can't see more as it's an uneditable field
      Open with Other Application > javascript:window.navigator.registerProtocolHandler( mailto , https://mail.google.com/mail/?extsrc=mailto&url=%s , Gmail )

      While it is possible that I've deleted another protocol handler, I try not to mess with things too much as a rule. If that's the case though, I have to agree that is a weird design choice!

      Delete
    3. That's not right, by me 'Gmail' is listed under Use a Webmail service alongside the default options. Try to delete the text from Open with Other Application, set the option back to Open with Opera and try the tip again. If that still doesn't work, there is still my older tip, which involves manually modifying an Opera config file, you can find it here.

      Delete
    4. Thanks :)... but still nothing. I tried your older tip as well, but it won't let me modify the file at all. I can open it, by but it says "access denied" if I try and save it. Any suggestions?

      Delete
    5. NVM! I could edit it in safe mode. The job is done. Thanks for the tips!

      Delete
    6. Ah, yes, I remember having problems with modifying that file as well on Windows 7. I don't know if I mentioned it in the original post, but I got around the limitation by copying the file in another locations, making the changes there and then replacing it in the original folder. There was a warning as well, but I could bypass it by logging in as admin. I'm glad you got it to work!

      Delete
  6. This didn't work for me. I completed steps 1-3 and in Advanced options it is set to "Gmail" under "Use a Webmail", but I never got another prompt to choose my default application for mailing. In fact, nothing at all happens when I click mailto links.

    ReplyDelete
    Replies
    1. Other than the troubleshooting ideas we already discussed in the previous comments, I'm afraid I don't have any other suggestions...
      Since you now see "Gmail" under "Use a Webmail service" and it's already selected, you shouldn't see any other prompts. Have you tried to change the setting (to 'Open in default application' for example) and check if the mailto:-links work in that case?

      Delete
  7. Is there way to open the new message in full Gmail interface (with sidebars etc.) as with the previous method?

    ReplyDelete
    Replies
    1. If there is, I'm not aware of it. It's probably hard-coded into the internal code in Gmail used to handle the mailto: protocol.

      Delete
  8. Excellent, a nice time-saver. Thank you!

    ReplyDelete
  9. Thank you! Worked like a charm.

    ReplyDelete
  10. Thank you! Worked like a charm. :-)

    ReplyDelete