carlsednaoui/add-to-calendar-buttons

.ics file fails to download for iCal and Outlook links

Opened this issue · 10 comments

Clicking the 'iCal Calendar' or 'Outlook Calendar' links does not download the .ics file. The browser flashes, but no file is downloaded, and no new tab is opened.

Browser: Chrome 60.0.3112.90 (Official Build) (64-bit) OS X

'Copy link address' and pasting that into a fresh tab, does work however.

Removing the target="_blank" attribute from the <a> tag appears to resolve the issue, though I don't know if that breaks the links in other browsers.

Better to replace the target="_blank" with a "download" parameter.

looks like it's not supported on safari, and only recently on other browsers. I could put it in addition of the target attribute though

Afaik, it's supported as of Safari 10.3 on iOS and Safari 10.1 on MacOS: https://webkit.org/blog/7477/new-web-features-in-safari-10-1/
The "Can I use" site is a bit outdated on that feature.

Perhaps I'm doing something wrong(I am relatively new to all of this) but I notice no changes after adding the gulpfile.js and ouimincal.js. The download attribute seems to be enough to get around this on Chrome, but not IE. When I add both the gulpfile.js/outmincal.js after changing target_blank to download, it ceases to work again.

don't include the gulpfile.js in your html code, it's just there for development to generate the ouical.min.js from the ouical.js file...
just include either ouical.js, or the minified version

Thanks so much for your reply and the updated file. Even while I was doing it it was unclear to me why they would all be necessary. I still can't seem to get Outlook to work on Internet Explorer however, which is what I thought this would solve based on your comment in that issue thread. Perhaps there is another unrelated issue on my end preventing the fix from working.

not sure, my goal was just to fix the iCal download issue, but i can't help with IE as i am on linux.