I am trying to implement downloading images from PWA. I am using
<a target="_blank"
rel="noopener noreferrer"
href="photo.url"
download>Download image</a>
to achieve that. I am good on desktop Chrome and Safari and Chrome for Android. But when I am in a standalone mode (PWA) on Safari iOS 13 I can't close the opened window that was opened to save the file. On iOS 12 there was a button 'Done' and preview of the image.
I have tried solutions from here. But without success; Safari blocks the window.open()
.
a
to abutton
which callswindow.open
on a Google Drive link (where I've uploaded a copy of the image) - this isn't ideal, as 1) if the user has Google Drive installed on their phone this method takes them out of the PWA and opens the Google Drive app, and 2) it relies on a third party service. Hopefully if this is an unavoidable bug it will be fixed soon. – Hagio