-
Notifications
You must be signed in to change notification settings - Fork 8
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
Detect which contact properties are supported by the browser #19
Comments
Can you explain more why it is important to distinguish between "this user agent does not support property X" and "this contact does not have a value for property X"? |
It's not about distinguishing whether the contact has a value for that property or not. Ideally, if you want to request a property (say |
JavaScript doesn't require try/catching. It will just give undefined for accessing a property that does not exist. |
Yeah, but you'd still want to know ahead of time if requesting a property is supported so you can have a fallback. Also, I'm not a fan of allowing the |
I'm still not understanding. Can you provide a code example? It seems like you should provide a fallback if the field is missing, too.
That's against general web design principles and forward-compatibility. Please do not do that. |
Actually, what I said was wrong, it's already enforced by the IDL compiler.
Let's assume you want access to a contact's icon. If you don't have a way to know whether the browser supports that, you'd need to call Ideally, a developer should be able to run something like:
Where |
It might be a good idea to expose which
ContactProperty
s are supported by the browser.The properties will expand to include icons & addresses in the future, and probably some other things as well.
Having a way to detect which will remove the need for browser sniffing and give UAs a way to opt-out of some properties if they are not available on a given platform.
This can be easily achieved by having a read-only property in
ContactsManager
which is the list of supportedContactProperty
s.The text was updated successfully, but these errors were encountered: