Closed pawelangelow closed 5 years ago
Thanks for the fix. I added ba5c562d23cc740d10c00cd26c809befcf88251c which should do the same thing but with less indirection. Let me know if it doesn't work for you.
@exupero, the actual problem is that you can't create popup ba5c562 there, because, as it is mentioned here, safari is blocking any call to window.open() which is made inside an async call. With few words: it is too late.
One possible solution is:
Pseudocode:
<button onClick=() => {
const popup = window.open();
processing.then((result) => {
popup.updateContent(result);
}
)}>
In the current codebase, popup initialisation has to be here, before return, and somehow pass the reference to the popup for using it here .
out$.download = (name, uri) => {
......
// THIS WONT WORK, CHECK SCREENSHOT
const popup = window.open();
// Instead, use the reference created in the out$.saveSvg
popup.document.title = name;
popup.location.replace(uri);
}
}
};
out$.saveSvg = (el, name, options) => {
const popup = window.open();
return ....
};
If you create the popup in the event handler, everything works as expected.
Thanks for the clarifications. Please check whether f0df944 works for you.
Yup, it is working now. Thanks 😃
Published version 1.4.14 to NPM with these changes.
Implement popup for "workaround" download in order to support iOS devices. Code split download method and introduce helpers.