Bug 216913 - REGRESSION (r265009): Web Share API can no longer be invoked if a previous invocation was dismissed using the close button
Summary: REGRESSION (r265009): Web Share API can no longer be invoked if a previous in...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: Safari 14
Hardware: iPhone / iPad Other
: P1 Normal
Assignee: Tim Horton
URL: https://mkonikov.com/web-share-testing/
Keywords: InRadar
: 218156 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-09-23 22:12 PDT by Oleg Strekalovsky
Modified: 2020-10-25 13:26 PDT (History)
9 users (show)

See Also:


Attachments
Patch (3.76 KB, patch)
2020-09-30 00:31 PDT, Tim Horton
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Oleg Strekalovsky 2020-09-23 22:12:03 PDT
Basic example of usage navigator.share() became unstable on recent release of the iOS 14. 

Example page - https://mkonikov.com/web-share-testing/

Detected problems:

- On first click on "Share" promise.then() not executed.
- Subsequent calls fails with error "NotAllowedError".

Reproducibility may vary depending on phone version. Confirmed issue for iPhone 6 and 11.
It seems that it is some timings related problem.
Comment 1 Radar WebKit Bug Importer 2020-09-27 09:58:42 PDT
<rdar://problem/69659878>
Comment 2 Tim Horton 2020-09-27 15:44:03 PDT
I can reproduce; other Web Share clients are broken too.
Comment 3 Higor 2020-09-28 10:53:54 PDT
Also happening here.
Comment 4 Rafael Amorim 2020-09-29 09:44:07 PDT
I can reproduce also on iOS 14.0 and some devices with iOS 14.0.1

Web Share API works on first time. After, no longer work.

This error is displayed on console:

Error NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission.

Tests:
iPhone 6s 14.0.0
iPhone 6s 14.0.1

iPhone 7 14.0.0
iPhone 7 14.0.1

iPhone 8 14.0.0
iPhone 8 14.0.1

iPhone XR 14.0.0
iPhone XR 14.0.1

iPhone 11 14.0.0
iPhone 11 14.0.1
Comment 5 Tim Horton 2020-09-29 16:58:38 PDT
This seems fixed in trunk, but I have /no idea/ what would have changed it (the most recent large change I made to WKShareSheet is in iOS 14, so it has to be elsewhere)
Comment 6 Tim Horton 2020-09-29 17:01:52 PDT
Oh, no, that's not it, it's just somehow only broken on iPhone, not iPad.
Comment 7 Tim Horton 2020-09-30 00:31:27 PDT
Created attachment 410097 [details]
Patch
Comment 8 EWS 2020-09-30 09:30:43 PDT
Committed r267792: <https://trac.webkit.org/changeset/267792>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 410097 [details].
Comment 9 Oleg Strekalovsky 2020-09-30 10:00:16 PDT
(In reply to Tim Horton from comment #7)
> Created attachment 410097 [details]
> Patch

Thanks for the fix. What browser version will this patch include or when can we expect this version to be released (at least approximately)?
Comment 10 Darin Adler 2020-09-30 10:38:03 PDT
(In reply to Oleg Strekalovsky from comment #9)
> Thanks for the fix. What browser version will this patch include or when can
> we expect this version to be released (at least approximately)?

If you asking that question of Apple, you’ll have to make your peace with the fact that Apple does not communicate timing of releases of WebKit fixes through the WebKit open source project.

I understand why you want to know, but you don’t find that answer here.
Comment 11 Darin Adler 2020-09-30 10:38:21 PDT
(In reply to Darin Adler from comment #10)
> I understand why you want to know, but you don’t find that answer here.

won't
Comment 12 Tim Horton 2020-10-25 13:26:58 PDT
*** Bug 218156 has been marked as a duplicate of this bug. ***