New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 767817 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 636274
Owner:
Long OOO (go/where-is-mgiuca)
Closed: Sep 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug



Sign in to add a comment

WebShare API rejects the wrong promise when user cancels

Reported by chem...@gmail.com, Sep 22 2017

Issue description

Steps to reproduce the problem:
1. Use navigator.share() in an onclick listener, provide it with 'title' and 'url' option.
2. Tap the element that fires the onclick listener
3. In the share dialog, tap one of the targets (copy to clipboard). The promise is resolved.
4. Tap the element again and cancel the share dialog (press back): the promise is *not* resolved or rejected.
4. Tap the element again: the promise is rejected immediately but the share dialog does pop up.

See codepen or attached example:
https://codepen.io/rejh/pen/bowqgE

What is the expected behavior?
If promises should be rejected when the user cancels the share, it should reject the promise that invoked the dialog. Currently, the promise is only resolved, never rejected.

What went wrong?
The promise of a WebShare call is never resolved or rejected but the *next time* the WebShare API is invoked it immediately rejects that promise but *does* show the share dialog.

Did this work before? N/A 

Does this work in other browsers? N/A

Chrome version: 61.0.3163.98  Channel: stable
OS Version: 8.0
Flash Version:
 
codepen_bowqgE.zip
1.7 KB Download

Comment 1 by mgiuca@chromium.org, Sep 25 2017

Mergedinto: 636274
Owner: mgiuca@chromium.org
Status: Duplicate (was: Unconfirmed)
Thanks for the report.

Unfortunately, this behaviour you describe (rejecting on the next time it is invoked) is the deliberate behaviour we implemented to work around the fact that the Android OS doesn't tell us when the dialog is cancelled.

Tracking this work in Issue 636274. We will try to find a better work-around so you can get the rejection immediately. Hopefully most sites don't need to actually handle the cancellation of the dialog.

Sign in to add a comment