Skip to content

Commit c752520

Browse files
committed
Detect Huawei P20 Lite and P30 Pro
1 parent a88934f commit c752520

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

‎src/ua-parser.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@
481481
], [MODEL, [VENDOR, 'HTC'], [TYPE, TABLET]], [
482482

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

487487
/(microsoft);\s(lumia[\s\w]+)/i // Microsoft Lumia

‎test/device-test.json‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,5 +1041,23 @@
10411041
"model": "MI PAD 2",
10421042
"type": "tablet"
10431043
}
1044+
},
1045+
{
1046+
"desc": "Huawei P30 Pro",
1047+
"ua": "Mozilla/5.0 (Linux; Android 9; VOG-L29) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.143 Mobile Safari/537.36",
1048+
"expect": {
1049+
"vendor": "Huawei",
1050+
"model": "VOG-L29",
1051+
"type": "mobile"
1052+
}
1053+
},
1054+
{
1055+
"desc": "Huawei P20 Lite",
1056+
"ua": "Mozilla/5.0 (Linux; Android 8.0.0; ANE-LX1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.143 Mobile Safari/537.36",
1057+
"expect": {
1058+
"vendor": "Huawei",
1059+
"model": "ANE-LX1",
1060+
"type": "mobile"
1061+
}
10441062
}
10451063
]

0 commit comments

Comments
 (0)