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

Can't detect Apple's new M1 Chip with arm architecture.

Open rommelmamedov opened this issue 3 years ago • 7 comments

rommelmamedov avatar Mar 30 '21 10:03 rommelmamedov

Can confirm, on my M1 MacBook Air I get:

device: {vendor: undefined, model: undefined, type: undefined}

felixakiragreen avatar Jul 17 '21 15:07 felixakiragreen

Confirm, I have this result too

p3yman avatar Nov 16 '21 13:11 p3yman

+1

ua: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:97.0) Gecko/20100101 Firefox/97.0"

image

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": {}
}

wscourge avatar Mar 23 '22 04:03 wscourge

Any solution for this?

PrimeDominus avatar Mar 24 '22 11:03 PrimeDominus

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.

seanaye avatar Aug 19 '22 18:08 seanaye

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?

rommelmamedov avatar Aug 19 '22 19:08 rommelmamedov

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

steven-tey avatar Sep 04 '22 16:09 steven-tey

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

faisalman avatar Mar 22 '23 05:03 faisalman

await navigator.userAgentData.getHighEntropyValues(['architecture'])

Firefox: image

Chrome: image

Safari: image

wscourge avatar Mar 22 '23 09:03 wscourge