<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>244408</bug_id>
          
          <creation_ts>2022-08-26 13:52:10 -0700</creation_ts>
          <short_desc>navigator.canShare(data) returns true but navigator.share(data) results in Unhandled Promise Rejection when data contains both image and text field.</short_desc>
          <delta_ts>2022-08-30 11:20:49 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKit Misc.</component>
          <version>Safari 15</version>
          <rep_platform>iPhone / iPad</rep_platform>
          <op_sys>iOS 15</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>231995</dup_id>
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=231995</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Blocker</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>spreadpando</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>marcosc</cc>
    
    <cc>thorton</cc>
    
    <cc>tony</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1894071</commentid>
    <comment_count>0</comment_count>
    <who name="">spreadpando</who>
    <bug_when>2022-08-26 13:52:10 -0700</bug_when>
    <thetext>When passed a data object with both text, and image parameters, navigator.share() produces:

&quot;Unhandled Promise Rejection: NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission.&quot;

This occurs even if navigator.canShare returns true when passed the same data object.

This prevents users from sharing image, text and urls at once and negatively impacts iOS users&apos; abilities to share content on the web.


Not a duplicate, but could be related to:

https://bugs.webkit.org/show_bug.cgi?id=231995 


For now the Web Share 2 API remains broken on iOS.

Produced on iPhone X iOS 15.5 (19F77)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1894358</commentid>
    <comment_count>1</comment_count>
    <who name="Marcos Caceres">marcosc</who>
    <bug_when>2022-08-28 18:07:21 -0700</bug_when>
    <thetext>I&apos;ll try to reproduce, but there are a few things that can cause canShare() to return true, but still result in a NotAllowedError:  

1. .share() called multiple times before the first call&apos;s promise settles.
2. .share() is not initiated by user activation (or, more unlikely, there is no Window object).
3. Permissions policy violation, but this produces a different error string so we can rule this out.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1894360</commentid>
    <comment_count>2</comment_count>
    <who name="Marcos Caceres">marcosc</who>
    <bug_when>2022-08-28 18:34:35 -0700</bug_when>
    <thetext>Ok, confirmed. This is indeed being caused by 231995 and it&apos;s a result of 1 (because even though shares completes, the promise is not being resolved). Thus, subsequent calls to .share() cause the API to freeze.

*** This bug has been marked as a duplicate of bug 231995 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>