kennethjiang / js-file-download

MIT License
915 stars 119 forks source link

Safari #24

Closed rudovjan closed 4 years ago

rudovjan commented 7 years ago

Unfortunately this plugin does not work with safari. Any plan to take a look on that?

kennethjiang commented 6 years ago

Sorry for the delay. I've been tied up recently.

This is a known issue. Look at issue #5. It seems there is a fork to address Safari https://github.com/rmiller-fc/react-file-download/commit/12c4312bb17683b434575b09ea68708a51c448eb. I can't merge that fix though as it breaks the current behavior of opening up download in a new tab.

Of course if you have better solution feel free to send in a PR @rudovjan

rudovjan commented 6 years ago

Thank you!

Strange thing happened :) So I copy&paste your code into project, change it into ES6, let it compile with babel and code started working.

  1. If i left it as a es5 dependency it does not work
  2. compiled to es5 using babel, started to work

Once will have little bit more time, I have a plan to take a look on that.

kennethjiang commented 6 years ago

Great. It'll be awesome if you can help add transpiler to this project (using rollup or similar tool) so that everyone can benefit from your work!

exihuatl commented 4 years ago

@kennethjiang I've created a simple PR with a fix/workaround: #55

kennethjiang commented 4 years ago

Sorry just saw your comment. Can you give a bit more details on how your PR fixes this issue? Thanks lot @exihuatl

exihuatl commented 4 years ago

@kennethjiang The problem is that we are removing blob in the same cycle as opening a new window. This causes some problems for iOS Safari which shows an enigmatic error message.

Some resources: https://discussions.apple.com/thread/250191294 https://github.com/mozilla/pdf.js/issues/8152 https://bugs.webkit.org/show_bug.cgi?id=190351

All this PR does is ensuring that the resource exists while opening a new window.

Vovan-VE commented 4 years ago

The problem still exists on Safari/13.3.1. Sometimes it works, sometimes it's not. Behavior is unstable. Look's like 0 timeout is not enough.

kindrowboat commented 4 years ago

I believe that #63 fixes this issue (which has been released in 0.4.12). If this issue still persists, please feel free to open a new issue.