Skip to content

Commit

Permalink
Improve CPU detection: x86
Browse files Browse the repository at this point in the history
  • Loading branch information
faisalman committed Dec 23, 2024
1 parent 10ab810 commit 9e64f34
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/ua-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@
], [[ARCHITECTURE, 'amd64']], [

/(ia32(?=;))/i, // IA32 (quicktime)
/\b((i[346]|x)86)\b/i // IA32 (x86)
/\b((i[346]|x)86)(pc)?\b/i // IA32 (x86)
], [[ARCHITECTURE, 'ia32']], [

/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i // ARM64
Expand Down
8 changes: 8 additions & 0 deletions test/data/ua/cpu/cpu-all.json
Original file line number Diff line number Diff line change
Expand Up @@ -278,5 +278,13 @@
{
"architecture" : "68k"
}
},
{
"desc" : "x86",
"ua" : "Mozilla/5.0 (Photon; U; QNX x86pc; en-US; rv:1.8.1.20) Gecko/20090127 BonEcho/2.0.0.20",
"expect" :
{
"architecture" : "ia32"
}
}
]

0 comments on commit 9e64f34

Please sign in to comment.