ua-parser-js icon indicating copy to clipboard operation
ua-parser-js copied to clipboard

Detect mobile browsers as mobile

Open shaharmor opened this issue 7 years ago • 1 comments

For example, Mozilla/5.0 (Linux; Android 7.1.2; Nexus 5X Build/N2G47W) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.83 Mobile Safari/537.36

Should display Chrome Mobile as the browser, not Chrome Same for Firefox & Firefox Mobile.

shaharmor avatar Jun 28 '17 12:06 shaharmor

I usually just detect for /(phone|mobile)/i in the user agent. This will give some false positives (for tablets, etc), but in general a good enough baseline.

tracker1 avatar Mar 08 '18 17:03 tracker1

Fixed in #251

faisalman avatar Mar 20 '23 04:03 faisalman