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

blob opens in current tab iOS Safari #581

Open
shikinen opened this issue Jul 22, 2019 · 14 comments
Open

blob opens in current tab iOS Safari #581

shikinen opened this issue Jul 22, 2019 · 14 comments

Comments

@shikinen
Copy link

I have a problem with saveAs function in iOS Safari -> blob is opened in the current tab and I want it to open in a new tab at least, I am aware that it won't trigger downloading the file but I just need to open the file in NEW tab.

I rummaged through issues and I came across conflicting information in this matter -> some say it opens in new tab, some do not and I am confused.

Does anyone have it implemented in a way that blob opens in a new tab, not the current one?

@omidpaydar
Copy link

omidpaydar commented Aug 6, 2019

I have this problem too. :(

@enterframe
Copy link

+1
Documentation says it will open in a new tab, but it doesnt...
iOS 12.4, Safari

@hacaro76
Copy link

hacaro76 commented Sep 4, 2019

+1
same for me , iOS 12.4 someone can help to fix or workaround ?

@phuocnelet
Copy link

Same here, not working on iOS 12.4.*

@groupboard
Copy link

Strangely, if you put the button inside an iframe, it will work properly and iOS will pop up the "Do you want to Download ...pdf", allowing you to download it to your downloads folder. See example here:

https://codepen.io/ianaya89/pen/JoRNyK

(If you take this code out of the iframe, it fails. Add your own iframe instead of using the codepen one, and it works again).

I'm not sure it's a good idea to rely on this behaviour.

@ehsanzarei2
Copy link

I have this problem and i register a pull request fot it...
#673
please merge that if its correct to solve problem.

@felek000
Copy link

Is this fix in master ? I just import v2.05 and on safari pdf open same window not download.

@heyalexchoi
Copy link

@ehsanzarei2 i don't see any difference in behavior on your branch.

@usb248
Copy link

usb248 commented Oct 3, 2021

This project seems to be dead. Many problems not solved... :/

@nhandt-nals
Copy link

I found that you just need to add MIME Content Type of blob file become: application/octet-stream, it will download directly.

@DEVfancybear
Copy link

+1

@maciej-zabielski
Copy link

I have the same issue in Firefox 100.0.2 - When downloading a file using
saveAs(xhr.response, fileName, saveAsOpts);

The current tab is replaced by the download. It works fine in Chromium.

My server returns the following headers:

content-disposition: attachment; filename=myFile.pdf
content-type: application/pdf

@groupboard
Copy link

The firefox bug is already fixed: https://bugzilla.mozilla.org/show_bug.cgi?id=1766420

@maciej-zabielski
Copy link

The firefox bug is already fixed: https://bugzilla.mozilla.org/show_bug.cgi?id=1766420

thanks for a good find - when type is changed to application/octet-stream as mentioned earlier it does open in a new tab correctly in Firefox as well.

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

No branches or pull requests