Sign in with Github! Your email. Your password? Remember me. Not registered? Sign up with Github! First name. Last name. Display name. By clicking "Sign up" you agree to the terms and conditions. Small JS script to download files on Safari. New here? Learn about Bountify and follow bountify to get notified of new bounties!
Follow bountify x. Posted almost 5 years ago by user Why do you need JS for this? Bharat Sewani 7 Aug Reply. Sham 13 Jul Reply. Sebastiaan 27 Sep Reply. Andrey 15 Oct Reply. Lucas 18 Oct Reply. Is it possible to add text to the blob? Marcelo Sampaio 17 Nov Reply. Francis 26 Feb Reply. Thanks a bunch man, it works in React.
THanks you so much man…it works on React. Bibi 12 Apr Reply. Ani 4 Jun Reply. Sam 16 Jul Reply. Hello Ani, have you found a solution to this, I am having the same problem in Vue js. Jason 17 Jun Reply. HansM 26 Jun Reply.
Anders Poulsen 26 Jun Reply. L-Bloch 5 Sep Reply. Hi Anders Poulsen For this to work in ie 11 and Edge, there need to be and file extension to this line: window.
Anders Poulsen 5 Sep Reply. Thanks, man, appreciate it! Yatin 15 Oct Reply. Hey Anders, Thanks for writing such a nice post. Adis 15 Dec Reply. When i click on a link in IE it opens in Edge. Katherin Carrero 28 Jan Reply. Luis Guerra 28 Feb Reply. Divya 22 Apr Reply. Robert Tessler 6 Jun Reply. A really excellent article, exactly what I was looking for and incredibly useful. Chris Keene 20 Oct Reply. Eric 9 Feb Reply. Some Dude 18 Jul Reply.
Sick solution. Thank you very very very much. So good. Sorry, something went wrong. Hi eligrey ,. I could take a crack at it, but I'll need some direction. Do you have any initial thoughts of where in the code this issue could stem from?
Any starting points would help me greatly. Plain text files are displayed in the tab but for example. Experiencing the same problem here in both my own code and the supplied demo. Update: used Weinre to remote debug Chrome, but nothing useful there. Console didn't output anything. Skip to content. Star 18k. New issue. Jump to bottom.
Labels chrome mobile. Since there's no way to perform an option-click from js programatically you can't post a file dialog. I ended up using a target to push the content to another tab. Then the user has to go to the tab, select save page as, select source instead of webarchive in the file popup, and then save it from there.
That's pretty convoluted if you ask me for a platform that prides itself on user interface simplicity, but better than getting the previous tab content kicked out and replaced with the saved content. Hitting the back button to return to previous tab content isn't always cheap or even possible. IE has the some of the same problems, but has msSaveBlob as a workaround. It also doesn't open content into the same tab by default.
Safari doesn't have anything to solve these issues simply as far as I can tell.
0コメント