You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We probably want to clarify what happens when multiple concurrent shares are triggered by user activation. Consider:
varb=document.createElement("button");document.body.appendChild(b);b.innerHTML="hello!";b.onclick=()=>{varp1=navigator.share({text: "i am 1",title: "i am 1"});varp2=navigator.share({text: "i am 2",title: "i am 2"});p1.then(()=>console.log("1 resolved")).catch(err=>console.error(1,err));p2.then(()=>console.log("2 resolved")).catch(err=>console.error(2,err));}
Should p1 win and p2 automatically gets rejected with an AbortError? or should p1 get rejected, and p2 wins?
Safari currently shares p1, but rejects both with AbortErrors (even though the share is successful). That seems like a bug.
In any case, seems like if p1 should win and trying to make subsequent calls to share() should reject with an InvalidStateError (i.e., only allow one share at a time per document).
The text was updated successfully, but these errors were encountered:
marcoscaceres
changed the title
Clarifying behavior of multiple simulations shares
Clarifying behavior of multiple simultaneous shares
Jul 2, 2019
We probably want to clarify what happens when multiple concurrent shares are triggered by user activation. Consider:
Should p1 win and p2 automatically gets rejected with an AbortError? or should p1 get rejected, and p2 wins?
Safari currently shares p1, but rejects both with
AbortErrors
(even though the share is successful). That seems like a bug.In any case, seems like if p1 should win and trying to make subsequent calls to share() should reject with an
InvalidStateError
(i.e., only allow one share at a time per document).The text was updated successfully, but these errors were encountered: