Can you detect whether a device has phone capabilities (e.g. it can make voice calls/SMS) with JavaScript?

I havent seen an obvious way to see that sms: and tel: links get special treatment.

Update: @janogosteve below has confirmed there is currently no reliable feature detect. This looks undetectable.


Here’s a comprehensive way to check this feature detect. (Read jangosteve comment below!)

  • make a test page with two of those links and a regular http link
  • grab the elements and then traverse all their properties, copy it all over to an object..
  • also getComputedStyle info for a bunch of details on them and throw that into an object as well
  • JSON.stringify( that stuff so you can deal with it later on)

Do the above on an iOS device and in desktop Safari/Chrome

Then JSON.parse them back into objects… and use https://github.com/NV/objectDiff.js to see if you can spot any differences at all.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)