0

I want to provide on page whether QR code with phone number for desktop browsers, or "tel:" link for devices, that can make a call directly from a browser.

There are a some methods to determine mobile devices (for example - http://detectmobilebrowsers.com/), but neither one don't answer the main question - have device a telephone module?

Some weak points of that methods:

  1. Device with small resolution can be a tablet, but not phone

  2. Device with different orientations can be a tablet, but not phone

  3. Desktop or laptop can have a touchsreen or have touch events emulated or converted from mouse events by software way

  4. Some desktops and notebooks have a plugged telephone modules and can make a calls, but its screens are big often, and they have no neither touchscreens, nor orientation sensors, and they browsers are ordinal desktop ones

  5. Not all Android, Apple or Balckberry devices are phones, they can be a TV, tablet or in general a toy or radio

How to check - can device make a call directly?

I saw this question but leave my own for some reasons: maybe all together we can found some nearly usable solution with considering of open weaks.

UPD: Maybe somebody knows which changes in HTML or in browser environment can make a phone's software? Maybe there is a way to detect these changes?

UPD2: Some limited solution can be a way to detect some pure phones. But not all possible:

(function(a) {
 window.isPhone = /\bi?Phone\b|(?=.*\bAndroid\b)(?=.*\bMobile\b)|(?=.*\bAndroid\b)(?=.*\bSD4930UR\b)/i.test(a);
})(navigator.userAgent || navigator.vendor || window.opera);

console.info('This device %s make phone calls', window.isPhone ? 'is originally intended to' : 'probably can\'t' );
Community
  • 1
  • 1
SynCap
  • 6,244
  • 2
  • 18
  • 27

0 Answers0