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

Opening up in same Tab in Safari on iPhone #346

Closed
Toterbiber opened this issue Jun 20, 2017 · 6 comments · Fixed by #463
Closed

Opening up in same Tab in Safari on iPhone #346

Toterbiber opened this issue Jun 20, 2017 · 6 comments · Fixed by #463

Comments

@Toterbiber
Copy link

In Safari on my iPhone / iPad the File (PDF) does not open up in a new Window but in the same Window, so I have to navigate back to the Page where I came from.

It should open up in a new Tab as described.

If you can't confirm this issue I can show you, but I don't want to publish the URL right here.

@usecode
Copy link

usecode commented Jun 28, 2017

Yes I agree. File should be open in new tab.
iPhone 5 iOS 10.3.2

@awerlang
Copy link

Here, we explicitly create another window and navigate to it. There's already some provision for this workaround on this module, but line https://github.com/eligrey/FileSaver.js/blob/master/FileSaver.js#L126 needs to exclude iOS.

@lakefield
Copy link

Same issue with iOS 11.3. Opens in same window.

Anyone find a workaround to trigger a new window/tab?

@phuczeero
Copy link

phuczeero commented Nov 13, 2018

Confirmed. I think this issue depends on Safari on iOS.
I've created 2 apps from react-boilerplate and CRA with the same implementation.

Import dependencies

import { saveAs } from 'file-saver';
import jsdocx from 'jsdocx';

and render a button

<button onClick={() => {
  const doc = new jsdocx.Document();
  doc
    .addParagraph()
    .addRun()
    .addText('Hello World!');
  doc.generate().then(content => {
    saveAs(content, 'test.docx');
  });
}}>
  Click me
</button>

When clicking the CRA button, Safari opens new tab and displays blob data.
But in react-boilerplate, Safari navigate to blob url. It's strange to me and I'm still investigating.

**Update: include live heroku
React boilerplate
Create react app

@jacksonhart
Copy link

jacksonhart commented Nov 18, 2018

Having this issue with Angular 6 when using iOS 12 Safari.
Opens in the same window and pressing 'back' reloads our single page app entirely.
@eligrey can we re-open

@Bonfims
Copy link

Bonfims commented Jul 25, 2024

Still having the issue, blobs only opening in the current tab

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 a pull request may close this issue.

7 participants