-
Notifications
You must be signed in to change notification settings - Fork 22.5k
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
Update navigator.canShare, navigator.share, Web Share API #8381
Conversation
The <strong><code>canShare()</code></strong> method will return <code>false</code> if the permission is supported on the platform but has not been granted.</p> | ||
|
||
<p>The method will generally also return <code>false</code> if the implementation does not support sharing of an indicated data type, for example files, or if sharing that data type would be considered a "hostile share" by the user-agent. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- This attempts to capture some general guidance about what might cause
false
to be returned. - Is this a reasonable statement? I know that it is true for
files
- but is it the intent of the API? - When you refer to "implementation" in the spec about files perhaps not being shareable, do you mean "the user agent" or the underlying OS to which the share data is being passed?
- The term "hostile share" is used in the spec. I can imagine what it would mean, but does not appear to be defined. Is there one that I am missing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The statement is now changed so I'll only answer the last two ones.
When you refer to "implementation" in the spec about files perhaps not being shareable, do you mean "the user agent" or the underlying OS to which the share data is being passed?
Kinda both, the OS or the user agent not supporting the OS feature properly.
The term "hostile share" is used in the spec. I can imagine what it would mean, but does not appear to be defined. Is there one that I am missing?
That's from w3c/web-share#127 but admittedly it's way too vague. Filed w3c/web-share#217
@saschanaz @jpmedley Thanks for the review - adjusted to address your points. A few specifics:
In addition, I have added docs for |
590eac3
to
737530c
Compare
|
||
<p>The available share targets are provided using the native mechanisms of the underlying operating system. They might, for example, include the system clipboard or other services, Bluetooth or WiFi, email, contacts or messaging applications, and websites.</p> | ||
|
||
<p>The API consists of just two methods:</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please format this like the other API overview pages. Here's an example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I copied the Battery Status API - in retrospect, perhaps not a good choice.
Co-authored-by: Joe Medley <[email protected]>
Co-authored-by: Joe Medley <[email protected]>
Co-authored-by: Joe Medley <[email protected]>
Co-authored-by: Joe Medley <[email protected]>
Co-authored-by: Joe Medley <[email protected]>
Co-authored-by: Joe Medley <[email protected]>
Co-authored-by: Joe Medley <[email protected]>
Co-authored-by: Joe Medley <[email protected]>
Co-authored-by: Joe Medley <[email protected]>
Co-authored-by: Joe Medley <[email protected]>
Co-authored-by: Joe Medley <[email protected]>
Co-authored-by: Joe Medley <[email protected]>
Co-authored-by: Joe Medley <[email protected]>
Co-authored-by: Joe Medley <[email protected]>
Co-authored-by: Joe Medley <[email protected]>
Co-authored-by: Joe Medley <[email protected]>
Co-authored-by: Joe Medley <[email protected]>
Co-authored-by: Joe Medley <[email protected]>
Co-authored-by: Joe Medley <[email protected]>
30aa4ba
to
4b3ed60
Compare
Thanks for review @jpmedley. Since then ...
|
Thanks for your patience. |
Thanks for yours @jpmedley - much appreciated. |
Further updates to
navigator.canShare
.The main reason is that following some digging, I have verified that the message is a bit flawed. Essentially it can return invalid
true
if it does not understand data. It is however useful for feature detection.I added a simple example using pseudo code for that, and explained it.
Also removed the non-standard header and experimental flag. IMO it is not to either - though I am testing that in BCD. BCD also has spec update.
Also noted that the value for the data is a "base set". This can be extended. Lots of work to be done in Web Share API doc (still to be created).