-
Notifications
You must be signed in to change notification settings - Fork 65
Closed
Description
We probably want to clarify what happens when multiple concurrent shares are triggered by user activation. Consider:
var b = document.createElement("button");
document.body.appendChild(b);
b.innerHTML = "hello!";
b.onclick = () => {
var p1 = navigator.share({text: "i am 1", title: "i am 1"});
var p2 = 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).
saschanaz
Metadata
Metadata
Assignees
Labels
No labels