Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to detect if a mobile device is emulated by Google Chrome? [closed]

Is there a way to distinguish a real mobile device from a device emulated by Google Chrome? Please note that Google Chrome can emulate Useragent, touchscreen, screen resolution and accelerometer. I need to know some features which cannot be emulated but can be detected by javascript.

like image 481
Sergey Kravchenko Avatar asked Jan 22 '15 07:01

Sergey Kravchenko


People also ask

What is emulated devices in Chrome?

Chrome allows users to emulate Chrome on a mobile device (e.g. a “Nexus 7” tablet, or an “iPhone 5”) from the desktop version of Chrome, by enabling the Mobile Emulation feature in Chrome DevTools.

What are emulated devices?

Emulated devices, also known as device emulators, are mobile operating systems running on non-mobile devices. Most developers use device emulators on their laptops to test their products on different devices or operating systems without the need to go out and purchase and setup all different devices.

What is emulated in mobile?

Emulating various devices informs app developers of any necessary changes to the functionality of their app, as well as improving UX and highlight other areas for improvement. For example, an app developer could use an emulated device to test their product on iOS, and then on Android.


1 Answers

It is possible to check for navigator.plugins.length. Mobile browsers have no plugins, so navigator.plugins.length is equal to 0; Desktop browsers ordinary have plugins, so we can distinguish browsers by length of plugins array.

like image 194
Sergey Kravchenko Avatar answered Oct 01 '22 01:10

Sergey Kravchenko