-
Notifications
You must be signed in to change notification settings - Fork 65
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
Better describe intention of navigator.canShare()
and usage
#211
Comments
Hmmmmm. Given that Wdyt? @marcoscaceres |
navigator.canShare()
must fail for unknown dictionary membersnavigator.canShare()
and usage
It would also be worth mentioning that if support for a specific field is important, then the field should be passed alone for the expected result. |
Definitely wouldn't hurt to provide such guidance. Do you want to have a go at putting together some wording for it or suggest something here? |
I doubt I'll have time to do that too soon, but something like:
(Happy to review that if you intend to do that for me) |
That’s great! Thank you! I’ll adapt that and ping you for review. |
|
yes. This is because when called with
Ah, that basically just means this... if it was JavaScript: validateShareData(data, document.baseURI); Where "this" is the I know, it's super convoluted to read. But it's what we got to work with and it matches browser internals (C++) rather nicely. |
@marcoscaceres Thanks very much. It is mostly confusing because at the point you see this text you don't know that the URI can be relative (assuming reading from top to bottom). |
ah, gotcha. Yes, this is why we pass it along to the other validation algorithm. But the assumption is that URLs are always relative, which is why we always resolve them against some "base". |
Just to confirm, the main purpose of this method is actually feature detection of supported properties of the I ask because the MDN docs (I am updating) indicate that you would use it to verify that the share data you would send in the But as I see it, that is pointless because To illustrate, say you want to send a new field "vcard" along with a Does that make sense? Maybe I am missing something. |
It's kinda dual purpose... "is property supported" and "If I try to pass this url/file/etc., would it actually get shared?"
Correct!
If any are found to be in error or not supported, it always returns 'false'. But the design is actually broken in other ways and it's not future proof 😡 (what you found below!). A few of us pointed this out for over a year, however, no one cared enough to fix it, so broken
You can't, because you need a "click", and by calling
Nope! You got it. It's quite unfortunate. We might fix it in the future if anyone cares to. |
Thanks again. Awesome.
FYI only - minor clarification - you misunderstood me :-). In this path I was proposing that there is no point testing the data before calling share. Instead you'd just trigger But as we then discussed, given the limitations of the implementation of Doesn't change anything, just pointing it out. |
Can we please keep this open until next week. I hope to add links to the updated docs for you to sanity check! |
Can you please sanity check out the proposed new version of
Appreciate this is "not your job", but really appreciate it if you are able to find the time. I'll update |
Depends on what "safe" is. If one is okay when at least one field is supported and shared, then passing all at once should be completely okay. If one needs to make sure everything is supported, then the individual call is needed. (I'm not sure this behavior is any useful, though.) |
Closed by #211 |
Previous context: #108 (comment)
This should fail but currently it does not.
What weird is that
share()
will anyway succeed with that argument.The text was updated successfully, but these errors were encountered: