Javascript: detect if device can create phonecall

Is it possible to determine whether a device can create a music library or not? I have a web page with a list of phone numbers. I want to make them interactive if the device can call using the link tel:. When I click on such a link in my browser browser, Firefox reports:

The address was not understood

Firefox does not know how to open this address, because one of the following protocols (tel) is not associated with any program or is not allowed in this context.

I know about mobile device discovery . This is not what I want, because most tablets are mobile but cannot make a phone call.

Questions

  • Is it possible to determine if a device can make a phone call using Javascript or HTML, and if so, how?
  • If this is not possible, what is the best way to handle this?
+4
source share
1 answer

I think iOS does this automatically, not sure about another OS. But if you just test devices by their name using simple Javascript / jQuery, would that not be enough?

Something like that:

$.browser.device = (/android|webos|iphone|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()));
+1
source

All Articles