How to detect Android in JavaScript?

What devices support the "tel:" hyperlink (RFC 3966) and how can you detect those devices with javascript?

  • On iPhones and other mobile devices you can use "tel:" instead of "http://" or "mailto:" in hyperlinks. This allows the phone to call the number in the hyperlink. On desktops and some other devices this "tel:" hyperlink isn't recognized and gives an error. For example, Mobile Safari supports "tel:" but desktop Safari does not. Neither do Firefox or Chrome? What devices/browsers understand the "tel:" hyperlink reference? Is there a javascript library that allows me to detect those that do and do not support it so I can decide whether or not to display the phone number as a hyperlink? ref: http://www.rfc-editor.org/rfc/rfc3966.txt

  • Answer:

    The tel: URL scheme works perfectly with Desktop Safari. You just need to: Install and configure a software for placing phone calls. Telephone.app (http://www.tlphn.com/) and a proper SIP account does the trick. If tel: URL scheme is not assigned to your phone app, use RCDefaultApp preference pane (http://www.rubicode.com/Software/RCDefaultApp/) to configure this. Point your Desktop Safari to a webpage sporting a tel: hyperlink and it'll place your calls. Details in RFC3966.

Bertrand Lupart at Quora Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.