Is there a way to determine if browser can handle telephone links [duplicate]
Asked Answered
C

1

12

I've read through other SO posts, but everyone seems to check the user agent, if its mobile, add href="tel:1234567890" else omit tel:. But what if I have Skype, Google Voice, or another application that CAN handle the links. Is there any way to determine this?

I don't know much about modernizer, but that didn't seem to have any properties to determine this capability. I'd rather not "turn off" desktop links just because I'm not sure, but at the same time IE opens up a blank page if it can't handle the scheme which I definitely can't have. Any thoughts or suggestions?

Clarettaclarette answered 8/1, 2014 at 22:14 Comment(2)
Agreed that might be a duplicate, but I figured I'd ask if there's alternatives as that answer is about 2 years old or if everyone still does the all or nothing approach as the other SO question suggests.Clarettaclarette
If answers to an old question are outdated, then those answers should be improved or new answers posted to the old question. We don’t want duplicates around, with different sets of answers.Coit
G
3

No, you can't. Reason is because how the browser handles this is not your concern (from the browser's point of view).

My advise?

If you want such a link, then simply use it.

Competent browsers that do not know about tel: should ask the user what to do, for instance look for an app that handles that protocol in the store (MSIE windows / mobile, for instance) or plugin (firefox/chrome).

Edit: You could in theory do a check for mobile browsers and then fall back to checking known plugins (eg; skype), but this will definitely not cater to most of the case and will break down too soon to be feasible.

Gabriella answered 8/1, 2014 at 22:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.