Google Calendar as default handler of webcal protocol for iCal/ICS files

In newer versions of Chromium/Chrome, you need to login to google calendar and click the overlapped diamond icon in the address bar.

Screenshot

Select "Use Google Calendar", then click done. This will register google calendar as a handler for webcal links.

Note:
You may need to set Chromium to allow sites to become default protocol handlers. You can do so via :

  1. Advanced settings -> Privacy, Content Settings -> Handlers
  2. Select "Allow sites to ask to become default handlers for protocols"

Chromium

The chromium browser offers this option when you first log in to Google Calendar:

Google Calendar in Chromium browser offers to handle webcal protocols

If you have accidentally answered with No on this question, you can press the Wrench toolbar button and go to Settings. Click Show advanced settings, find Content settings... (just after Privacy header) and find the Manage handlers button. Click the X next to the ignored protocol you wish to delete. Alternatively, you can type in protocol handlers search box in Chromium settings.See the screenshot below.

Undo ignore protocol handler in Chromium browser

Firefox

I found this post on stackexchange which explains how to achieve the same thing in Firefox, but this doesn't work for me on firefox 12 and 15: this works for me if I disable the Never save history option (Private browsing mode):

Go to Google Calendar's site and press Ctrl+Shift+K.

Paste this after the > sign:

navigator.registerProtocolHandler("webcal","https://www.google.com/calendar/render?cid=%s","Google Calendar");

Press the enter key and click the Add application button which should appear below the toolbar.

Firefox console

Firefox accept protocol hanlder

You may need to toggle the gecko.handlerService.allowRegisterFromDifferentHost option in about:config to true before trying this (if google redirects you to a local google domain). Remember to return it to false after calling the registerProtocolHandler function because malicious sites may exploit this. See details here.


As of Jan 2020 I managed to solve this for Firefox by doing the following:

  • about:config - switch dom.registerContentHandler.enabled to true;
  • open Google calendar;
  • press Ctrl+Shift+K to open console;
  • copy the following code, paste it into the console and press Enter:

    javascript:window.navigator.registerProtocolHandler("webcal","https://calendar.google.com/calendar/r?cid=%s","Google Calendar");

After these steps, you should see a window-width stripe under the address bar asking you if you want to set Google calendar as a default webcal handler.

Before all that, I tried to use the master Yoda's solution but it didn't work - anyway, cheers, it inspired me to look closer at the about:config entries and to discover this method.