Closed tgowing closed 5 months ago
I can confirm that the device type
is undefined
for this Mac user agent:
import UAParser from "ua-parser-js"
const parser = new UAParser('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36')
console.log(parser.getDevice())
Result:
{ vendor: 'Apple', model: 'Macintosh', type: undefined }
Not same OS, but there is a similar problem with my UA:
import UAParser from "ua-parser-js"
const parser = new UAParser('Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36')
console.log(parser.getDevice())
Result:
{ vendor: undefined, model: undefined, type: undefined }
Same here.
With UAParser.js v2.0.0-alpha.3, this UA: "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/117.0"
gives undefined for type, model and vendor:
Object { type: undefined, model: undefined, vendor: undefined }
This is happening for me on both version 1.0.37
and 2.0.0-beta.2
. Can someone fix this?
This is not a bug, there's no such thing as desktop type, read more about it here: https://github.com/faisalman/ua-parser-js/issues/182
Describe the bug I am using a Mac computer and the device type is undefined. This is the object that ua-parser is producing.
To Reproduce Steps to reproduce the behavior: