RESOLVED DUPLICATE of bug 231995238713
Web Share API: share() result promise never resolved if I save an image to the gallery
https://bugs.webkit.org/show_bug.cgi?id=238713
Summary Web Share API: share() result promise never resolved if I save an image to th...
Riccardo Perra
Reported 2022-04-03 08:14:05 PDT
With share api, when the share() method is triggered, iOS provide several ways to share your data. There is an unexpected behavior when the data parameter of the share() has an image file as a `files` property: ``` const response = await fetch('500x500.png'); const blob = await response.blob(); const shareData = {files: [ new File([blob], 'meme.png', {type: "image/png", lastModified: new Date().getTime()}), ]}; navigator.share(shareData).then(() => { // never called if I save the image on the gallery }).catch((err) => [..]) ``` - If the user click on "Save image" button to save the file in the gallery, the Promise will never be resolved - If the user press again the button that trigger the share() method, the Promise will be rejected with this error: "Not allowed error: The reequset is not allowed by the user agent or the platform in the current context, possibly because the user denied permission." I published a github repo with the source code and reproducible example: Demo: https://riccardoperra.github.io/webkit-save-image-broken-web-share-api/ Implementation: https://github.com/riccardoperra/webkit-save-image-broken-web-share-api/blob/main/src/main.ts
Attachments
Tim Horton
Comment 1 2022-04-03 14:04:58 PDT
*** This bug has been marked as a duplicate of bug 231995 ***
Note You need to log in before you can comment on or make changes to this bug.