Skip to content

Commit 94d3d84

Browse files
committed
Add new device vendor: HMD
1 parent c72198d commit 94d3d84

File tree

3 files changed

+29
-1
lines changed

3 files changed

+29
-1
lines changed

src/enums/ua-parser-enums.js

+1
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ const Vendor = Object.freeze({
213213
GEEKSPHONE: 'GeeksPhone',
214214
GENERIC: 'Generic',
215215
GOOGLE: 'Google',
216+
HMD: 'HMD',
216217
HP: 'HP',
217218
HTC: 'HTC',
218219
HUAWEI: 'Huawei',

src/main/ua-parser.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,7 @@
697697

698698
/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,
699699
// BlackBerry/BenQ/Palm/Sony-Ericsson/Acer/Asus/Dell/Meizu/Motorola/Polytron/Infinix/Tecno/Micromax/Advan
700-
/; (imo) ([\w ]+?)(?: bui|\))/i, // IMO
700+
/; (hmd|imo) ([\w ]+?)(?: bui|\))/i, // HMD/IMO
701701
/(hp) ([\w ]+\w)/i, // HP iPAQ
702702
/(asus)-?(\w+)/i, // Asus
703703
/(microsoft); (lumia[\w ]+)/i, // Microsoft Lumia

test/specs/device-all.json

+27
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,33 @@
350350
"type": "mobile"
351351
}
352352
},
353+
{
354+
"desc": "HMD Pulse",
355+
"ua": "Mozilla/5.0 (Linux; Android 14; HMD Pulse) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Mobile Safari/537.36",
356+
"expect": {
357+
"vendor": "HMD",
358+
"model": "Pulse",
359+
"type": "mobile"
360+
}
361+
},
362+
{
363+
"desc": "HMD Pulse Plus",
364+
"ua": "Mozilla/5.0 (Linux; Android 14; HMD Pulse Plus) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Mobile Safari/537.36",
365+
"expect": {
366+
"vendor": "HMD",
367+
"model": "Pulse Plus",
368+
"type": "mobile"
369+
}
370+
},
371+
{
372+
"desc": "HMD Pulse Pro",
373+
"ua": "Mozilla/5.0 (Linux; Android 14; HMD Pulse Pro) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Mobile Safari/537.36",
374+
"expect": {
375+
"vendor": "HMD",
376+
"model": "Pulse Pro",
377+
"type": "mobile"
378+
}
379+
},
353380
{
354381
"desc": "Honor MagicPad 13 WiFi",
355382
"ua": "Mozilla/5.0 (Linux; U; Android 13; zh-CN; GDI-W09 Build/HONORGDI-W09) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/100.0.4896.58 UCBrowser/16.3.9.1290 Mobile Safari/537.36",

0 commit comments

Comments
 (0)