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?
2 Answers
I've had a similar puzzling issue with window.open in Safari.
We generate signed S3 urls, then download files using window.open(url, '_self');
This is done inside an async function, which was working fine.
But if you have Safari's Devtools open, this does not work at all.
Closing Devtools made it work. Tested on Safari 18.3.1.
Sample code to download multiple files on click:
async function download(urls = []) {
const entries = urls.entries()
for (const [index, url] of entries) {
await wait(index * 1000)
window.open(url, '_self')
}
}
async function wait(time = 1000) {
await new Promise((res) => setTimeout(res, time))
}
edit: Now it's working in Safari 18.4.
window.open()which is made inside an async call.