ua-parser-js
ua-parser-js copied to clipboard
Detect mobile browsers as mobile
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
.
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.
Fixed in #251