Skip to content

Sharing service unavailable should reject with NotSupportedError #126

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
marcoscaceres opened this issue Sep 8, 2019 · 2 comments
Closed

Comments

@marcoscaceres
Copy link
Member

With #113, the spec says:

If there are no share targets available:
   Reject [[sharePromise]] with an "AbortError" DOMException.

However, in the above, it's possible that there is no share service available at all (or the service may fail to be initiated). It's not really possible to know this beforehand if it will succeed. In such a case, it may be more suitable to reject with a "NotSupportedError".

@ewilligers
Copy link
Collaborator

The user agent might decide there are no suitable share targets available because of the specific file types being shared. Future share attempts might use different file types, or the user might install a new app that receives the relevant file types. In this scenario, NotSupportedError will not be the appropriate error - it would allow the website to learn which apps are installed.

We expected that browsers would know if the share service was available, and not define navigator.share if it wasn't available, so web apps could hide their Share buttons. If I understand correctly, you are suggesting a NotSupportedError would be useful to indicate that all future attempts will fail (regardless of the shared data), so web app can disable their Share buttons when they receive such an error.

@marcoscaceres
Copy link
Member Author

Agree. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants