-3

I am using window.open() functionality to open the Url in a popup window, it is working in Chrome, but it's not in Safari browser, are there any settings to open the window as a separate popup or any other solution?

rozsazoltan
  • 2,831
  • 2
  • 7
  • 20
Vinu Ram
  • 109
  • 6
  • 6
    See: [window.open(url, '_blank'); not working on iMac/Safari](https://stackoverflow.com/questions/20696041/window-openurl-blank-not-working-on-imac-safari), *Safari is blocking any call to `window.open()` which is made inside an async call.* – Sally loves Lightning Jul 04 '23 at 14:36
  • is this safari on Mac or on iOS?... and how are you attempting to open the window... Safari might be blocking this if you are auto-launching it without any user interaction. Can you show us the code you are using? – scunliffe Jul 04 '23 at 14:37
  • 1
    Can you show a [Minimal, Reproducible Example](https://stackoverflow.com/help/minimal-reproducible-example) – Arjun Jakkipally Jul 04 '23 at 14:47

1 Answers1

0

There's a possible cause: Safari, for some security reason, doesn't allow calling window.open() in callback function which be like:

test().then((value) => { window.open(value) })

Solution:

  1. Put your window.open() in a immediate setTimeOut.
  2. Use window.location instead

:)