Skip to content

Commit

Permalink
Detect Huawei P20
Browse files Browse the repository at this point in the history
  • Loading branch information
atomarch authored and mralbean committed Jul 24, 2019
1 parent c752520 commit e5a02c0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/ua-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@
], [MODEL, [VENDOR, 'HTC'], [TYPE, TABLET]], [

/d\/huawei([\w\s-]+)[;\)]/i,
/(nexus\s6p|vog-l29|ane-lx1)/i // Huawei
/(nexus\s6p|vog-l29|ane-lx1|eml-l29)/i // Huawei
], [MODEL, [VENDOR, 'Huawei'], [TYPE, MOBILE]], [

/(microsoft);\s(lumia[\s\w]+)/i // Microsoft Lumia
Expand Down
11 changes: 10 additions & 1 deletion test/device-test.json
Original file line number Diff line number Diff line change
Expand Up @@ -1059,5 +1059,14 @@
"model": "ANE-LX1",
"type": "mobile"
}
}
},
{
"desc": "Huawei P20",
"ua": "Mozilla/5.0 (Linux; Android 8.1.0; EML-L29) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Mobile Safari/537.36",
"expect": {
"vendor": "Huawei",
"model": "EML-L29",
"type": "mobile"
}
}
]

0 comments on commit e5a02c0

Please sign in to comment.