From c7525200417231e28e86818038643c233e9adb17 Mon Sep 17 00:00:00 2001 From: Alvin Portillo Date: Fri, 19 Jul 2019 14:45:34 -0700 Subject: [PATCH 1/2] Detect Huawei P20 Lite and P30 Pro --- src/ua-parser.js | 2 +- test/device-test.json | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/ua-parser.js b/src/ua-parser.js index de0579c..b3f0f71 100755 --- a/src/ua-parser.js +++ b/src/ua-parser.js @@ -481,7 +481,7 @@ ], [MODEL, [VENDOR, 'HTC'], [TYPE, TABLET]], [ /d\/huawei([\w\s-]+)[;\)]/i, - /(nexus\s6p)/i // Huawei + /(nexus\s6p|vog-l29|ane-lx1)/i // Huawei ], [MODEL, [VENDOR, 'Huawei'], [TYPE, MOBILE]], [ /(microsoft);\s(lumia[\s\w]+)/i // Microsoft Lumia diff --git a/test/device-test.json b/test/device-test.json index 6074665..5f4cc5c 100644 --- a/test/device-test.json +++ b/test/device-test.json @@ -1041,5 +1041,23 @@ "model": "MI PAD 2", "type": "tablet" } + }, + { + "desc": "Huawei P30 Pro", + "ua": "Mozilla/5.0 (Linux; Android 9; VOG-L29) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.143 Mobile Safari/537.36", + "expect": { + "vendor": "Huawei", + "model": "VOG-L29", + "type": "mobile" + } + }, + { + "desc": "Huawei P20 Lite", + "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", + "expect": { + "vendor": "Huawei", + "model": "ANE-LX1", + "type": "mobile" + } } ] From e5a02c0e5709e25c5c74670c6395b79053321b85 Mon Sep 17 00:00:00 2001 From: Tony Tomarchio Date: Mon, 22 Jul 2019 14:14:57 -0700 Subject: [PATCH 2/2] Detect Huawei P20 --- src/ua-parser.js | 2 +- test/device-test.json | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/ua-parser.js b/src/ua-parser.js index b3f0f71..49909fa 100755 --- a/src/ua-parser.js +++ b/src/ua-parser.js @@ -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 diff --git a/test/device-test.json b/test/device-test.json index 5f4cc5c..d38387c 100644 --- a/test/device-test.json +++ b/test/device-test.json @@ -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" + } + } ]