[Webkit-unassigned] [Bug 225559] Implement standards-compliant user gesture tracking
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Mon Apr 4 08:23:16 PDT 2022
https://bugs.webkit.org/show_bug.cgi?id=225559
John Ozbay <webkit-bugzilla at johnozbay.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |webkit-bugzilla at johnozbay.c
| |om
--- Comment #7 from John Ozbay <webkit-bugzilla at johnozbay.com> ---
(In reply to Ryosuke Niwa from comment #1)
> Do you have a specific use case / test case where Safari's heuristics
> doesn't work?
Hello, this week we got affected by this as well, and thought I'll stop by to comment an easy to reproduce real-life use-case example on jsfiddle to demonstrate where Safari's heuristics doesn't work.
Here's the scenario (and I have a jsfiddle link below which you can test on iOS 15.4.1) :
– user presses a 'download file' button.
– we show downloading progress indicator
In an async function:
– we need to "await fetch" a few json files,
– do something with json files client side (i.e. await doSomething(), like combine, decrypt contents client side etc – basically anything)
– then use navigator.share() to let the user share the contents. (let's say an image file, or some textual contents from the json files etc)
Intuitively, end users shouldn't have to press three separate buttons for each step of : fetch, decrypt, and finally to trigger navigator.share().
They should just press "download file", and after a brief loading spinner, they should be presented with the native navigator.share popup.
But right now, since all three steps are in an async function, if either the download time or i.e. the decrypt time takes even a few seconds (i.e. due to network conditions, say it's a 10 - 20mb file), we use lose user activation by the time we get to navigator.share(), and since navigator.share() requires user activation, it throws :
"NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission."
--
Here's a barebone example I prepared to demonstrate this on jsfiddle :
https://jsfiddle.net/dw6g2opr/8/
If you try this example on iOS 15.4.1 with a relatively decent speed internet connection in Europe (~100mbps on cellular, so maybe try 30-50mbps to be safe?), you'll see that navigator.share() won't work half the time, depending on the network conditions / due to the time it takes to fetch the first two files.
Consequently, at the moment we cannot use navigator.share on iOS, and instead use alternatives like display resulting images then instruct users to tap and hold on images to share etc, or if it's a PDF or another file, opening it in a new tab using a blob URL and asking users to press share from there etc.
--
Expected behavior / what would be great:
Users should be able to async fetch a large file, then use navigator.share() to open the native share dialog for that file with a single tap/click.
--
Hoping this helps :-)
Many thanks!
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220404/e8ab280a/attachment.htm>
More information about the webkit-unassigned
mailing list