Home » Android » javascript – How to detect if a mobile device is emulated by Google Chrome?

javascript – How to detect if a mobile device is emulated by Google Chrome?

Posted by: admin May 14, 2020 Leave a comment

Questions:

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.

How to&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.