Skip to content

Commit

Permalink
Fix #413 Bug resulting Motorola model O
Browse files Browse the repository at this point in the history
  • Loading branch information
faisalman committed Mar 8, 2021
1 parent 9999815 commit d78a2e0
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ua-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,8 @@

// Motorola
/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?:?(\s4g)?)[\w\s]+build\//i,
/mot[\s-]?(\w*)/i,
/\smot[\s-](\w*)/i,
/(moto[\s\w\(\)]+(?=\sbuild|\)))/i,
/(XT\d{3,4}) build\//i,
/(nexus\s6)/i
], [MODEL, [VENDOR, 'Motorola'], [TYPE, MOBILE]], [
Expand Down
27 changes: 27 additions & 0 deletions test/device-test.json
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,33 @@
"type": "mobile"
}
},
{
"desc": "Motorola Moto g(6) Play",
"ua": "Mozilla/5.0 (Linux; Android 9; moto g(6) play) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.136 Mobile Safari/537.36",
"expect": {
"vendor": "Motorola",
"model": "moto g(6) play",
"type": "mobile"
}
},
{
"desc": "Motorola Moto g(7) Supra",
"ua": "Mozilla/5.0 (Linux; Android 9; moto g(7) supra Build/PCOS29.114-134-2; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/73.0.3683.90 Mobile Safari/537.36",
"expect": {
"vendor": "Motorola",
"model": "moto g(7) supra",
"type": "mobile"
}
},
{
"desc": "Motorola Moto E",
"ua": "Mozilla/5.0 (Linux; Android 7.1.1; Moto E (4) Build/NDQS26.69-64-11-7; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/56.0.2924.87 Mobile Safari/537.36",
"expect": {
"vendor": "Motorola",
"model": "Moto E (4)",
"type": "mobile"
}
},
{
"desc": "Nokia3xx",
"ua": "Nokia303/14.87 CLDC-1.1",
Expand Down

0 comments on commit d78a2e0

Please sign in to comment.