Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set content type when Firefox #62

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Set content type when Firefox #62

wants to merge 3 commits into from

Conversation

mlnmln
Copy link

@mlnmln mlnmln commented Nov 12, 2018

IS:
When using the download method generated files will be interpreted as plain text(txt) files in Firefox.
Thus when the download dialog opens, the suggested application to open the file will be notepad/textedit.

This PR adds the missing type in the saveAs call.
https://github.com/eligrey/FileSaver.js#examples

Afterwards when the download dialog opens,
the suggested application to open the file will be ical/outlook.

@@ -135,7 +135,7 @@ var ics = function(uidDomain, prodId) {
// Since some calendars don't add 0 second events, we need to remove time if there is none...
var start_time = '';
var end_time = '';
if (start_hours + start_minutes + start_seconds + end_hours + end_minutes + end_seconds != 0) {
if (start_hours + start_minutes + start_seconds + end_hours + end_minutes + end_seconds !== 0) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's wrong because the variables are strings. Your code will never enter the if clause. A (one possible) correct fix is: !== "000000000000". I fixed it like this: michael-maltsev@f34a6ed

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@michael-maltsev Thanks for letting me know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants