ua-parser-js
ua-parser-js copied to clipboard
Can't detect Apple's new M1 Chip with arm architecture.
Can confirm, on my M1 MacBook Air I get:
device: {vendor: undefined, model: undefined, type: undefined}
Confirm, I have this result too
+1
ua: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:97.0) Gecko/20100101 Firefox/97.0"

Result:
{
"ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:97.0) Gecko/20100101 Firefox/97.0",
"browser": {
"name": "Firefox",
"version": "97.0",
"major": "97"
},
"engine": {
"name": "Gecko",
"version": "97.0"
},
"os": {
"name": "Mac OS",
"version": "10.15"
},
"device": {},
"cpu": {}
}
Any solution for this?
I'm acutally using this as a feature not a bug. If the os is MacOS but the CPU is undefined then I can tell it is an apple silicon device.
I'm acutally using this as a feature not a bug. If the os is MacOS but the CPU is undefined then I can tell it is an apple silicon device.
Yeah, but there are already 5-6 different silicon CPUs (M1, M1 Pro, M1 Max, M1 Ultra, M2) who will you identify them?
having this issue as well 😕
an alternative I'm trying out is https://github.com/etienne-martin/device-detector-js – it detects M1 Macs correctly
Can anyone with Apple Silicon device confirm this is correct? using navigator.userAgentData
https://stackoverflow.com/questions/65146751/detecting-apple-silicon-mac-in-javascript#answer-75177111
await navigator.userAgentData.getHighEntropyValues(['architecture'])
Firefox:
Chrome:
Safari: