Skip to content

Commit

Permalink
Fix #559: Sony Xperia 1 III misidentified as Acer tablet
Browse files Browse the repository at this point in the history
  • Loading branch information
faisalman committed Dec 17, 2021
1 parent 97f3368 commit 23ad60e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/ua-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@
], [MODEL, [VENDOR, GOOGLE], [TYPE, MOBILE]], [

// Sony
/droid.+ ([c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i
/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i
], [MODEL, [VENDOR, SONY], [TYPE, MOBILE]], [
/sony tablet [ps]/i,
/\b(?:sony)?sgp\w+(?: bui|\))/i
Expand Down
9 changes: 9 additions & 0 deletions test/device-test.json
Original file line number Diff line number Diff line change
Expand Up @@ -1602,6 +1602,15 @@
"type": "mobile"
}
},
{
"desc": "SONY Xperia 1 III",
"ua": "Mozilla/5.0 (Linux; Android 11; A101SO) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Mobile Safari/537.36",
"expect": {
"vendor": "Sony",
"model": "A101SO",
"type": "mobile"
}
},
{
"desc": "Sony G8141 (Xperia XZ Premium)",
"ua": "Mozilla/5.0 (Linux; Android 8.0.0; G8141) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.80 Mobile Safari/537.36",
Expand Down

0 comments on commit 23ad60e

Please sign in to comment.