Automatically open ICS files in Google Calendar

12

9

Lots of web sites have an option to export events as an ICS file that can then be imported into a desktop or web-based calendar (for example if you're invited to a Facebook event there will be an export button that gives you an ICS file).

By default in Firefox 3.5 on Vista I'm only offered three options here "Open with Windows Calendar", "Open with Other" or "Save File", so what I'd do is save the file onto my PC, and then log into Google Calendar and import that ICS file.

What I'd like is to have an "Open with Google Calendar" or "Import to Google Calendar" type option when I click the Export link.

I know that you can configure Firefox to send mailto: links to GMail, and I've got the Operator extension installed that will detect hCalendar microformat entries embedded in the text and offer to import them to Google Calendar, but I can't work out how to configure either of these to do what I need.

Preferably I'd do this without installing any additional software, and in a way that will work with a Google Apps account (but if someone can point toward a solution for normal Google Calendar's that would be a good start).

GAThrawn

Posted 2009-09-20T15:44:08.180

Reputation: 4 176

i'm interested in this too. have you searched userscripts.org? lifehacker.com? – Capi Etheriel – 2009-12-01T01:26:06.530

Answers

3

I found a final solution to this! I based it off of the code to add Gmail as a mailto: handler, and adapted using information taken from Google Chrome's preferences file:

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

To use it, just go to Google Calendar, open Firefox's Web Console (Ctrl+Shift+K), and paste it into the code box.

F-Lambda

Posted 2009-09-20T15:44:08.180

Reputation: 54

Not working in FF 30 on Ubuntu as it's a VCS/ICS file. – Gaurav Kumar – 2014-06-27T16:27:25.803

@tatsuhirosatou run it from google.com – Good Person – 2014-08-04T05:16:55.197

2This still works, and even persists in your user profile, but the URL has changed. You now need to enter javascript:window.navigator.registerProtocolHandler("webcal","https://calendar.google.com/calendar/render?cid=%s","Google Calendar");. Like Good Person said above, this will only work if run from a tab which has calendar.google.com loaded! – Artfunkel – 2016-12-06T19:33:48.463

I'm getting syntax error: illegal character for this. FF v54 – dez93_2000 – 2017-06-28T15:22:24.303

Brilliant, just what I was hoping for, seems to do everything it should do and so simple! – GAThrawn – 2012-06-28T10:16:55.870

4I get the following error when I run the command. Permission denied to add https://www.google.com/calendar/render?cid=%s as a content or protocol handler – tatsuhirosatou – 2012-10-11T21:59:38.530

1

iCalendar is not a microformat so I'm afraid Operator isn't going to help you here. So you'll need a separate Firefox extension or helper app to do this. I'm not aware that one exists and Google was no help when I searched. Sounds like a good development opportunity.

Workaround: save the .ics file to disk, then create a draft email in Gmail. Title it whatever, Attach the .ics file. Save it and go to the Drafts view. Now you should see a calendar icon to the right of the draft email you created. Click it to add the event to Google Calendar. Simple, eh?

Update: I'd go with Alejandro's .NET solution if you have that option.

dschwarz

Posted 2009-09-20T15:44:08.180

Reputation: 39

2Your workaround actually sounds more complicated than the normal save ICS file to disk, then click the Import Calendar button in Google Calendar!

It's strange, you'd think this was something that lots of people would be annoyed by!

Wonder if it could be done with a Greasemonky script? – GAThrawn – 2009-10-21T09:01:05.580

1

I have created a small .NET application to do just that. If you associate the .ics extension to this application, whenever you either double click a .ics file or click a link to one, this application will import it to the google calendat that you configure, and it works with google hosted domains.

I know that you prefer a "no software" solution, but maybe this could be of use to you.

It is available at: http://gcalicsimporter.codeplex.com/.

Alejandro Mezcua

Posted 2009-09-20T15:44:08.180

Reputation: 119

1Thanks! But I don't use .NET and I don't know enough .NET to quickly understand the basic approach here. Are you opening up a google calendar url, using some sort of api? Can you point to the relevant google calendar api you're using or whatever so we can implement it on other platforms? – nealmcb – 2014-10-11T00:55:09.713

Chrome won't permit that file to be downloaded as it is "dangerous". It's been a decade now that this question has been out there and it is downright silly there isn't a straightforward way to make double clicking on an ics file automatically add to google calendar. – James Bowery – 2020-01-13T19:20:10.800