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
Currently the share method throws an AbortError for three distinct failure modes:
No share targets available.
User cancelled picker.
Error transmitting the data to the chosen target.
Lumping all three of these together (making them indistinguishable to the client) may not be sufficient. Consider an app that wants to use the following logic:
Call share.
If it fails before the user sees the picker (due to input error, not allowed to show a popup, or no share targets available), fall back to showing a hard-coded set of targets (like Twitter and Facebook).
If it fails after the user sees the picker (due to cancellation, or error transmitting the data), do nothing. Perhaps show an error message if there was an error transmitting the data, but not if the user cancelled the picker.
It is not currently possible to distinguish these cases. It seems the most important thing to distinguish is whether it failed before or after the user saw the picker. Secondarily, we might want to distinguish user cancellation and transmission error.
Should we perhaps change to reject with a different error type in each case? Or somehow attach additional data to the rejection object.
The text was updated successfully, but these errors were encountered:
@mgiuca, do you still think this is something we should pursue? The situation you describe makes sense, but I'm not sure it comes up often enough in practice: i.e., browsers + OS seem to fairly reliably show a picker.
If this gets reconsidered in future, we will need to make sure not to expose to the developer whether there are share targets available. Implementations would also need to avoid making private browsing modes detectable, in any implementations where some/all shares are blocked in such modes.
Currently the
share
method throws anAbortError
for three distinct failure modes:Lumping all three of these together (making them indistinguishable to the client) may not be sufficient. Consider an app that wants to use the following logic:
share
.It is not currently possible to distinguish these cases. It seems the most important thing to distinguish is whether it failed before or after the user saw the picker. Secondarily, we might want to distinguish user cancellation and transmission error.
Should we perhaps change to reject with a different error type in each case? Or somehow attach additional data to the rejection object.
The text was updated successfully, but these errors were encountered: