Skip to content

Commit

Permalink
Add new device vendor: HMD
Browse files Browse the repository at this point in the history
  • Loading branch information
faisalman committed Nov 20, 2024
1 parent c72198d commit 94d3d84
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/enums/ua-parser-enums.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ const Vendor = Object.freeze({
GEEKSPHONE: 'GeeksPhone',
GENERIC: 'Generic',
GOOGLE: 'Google',
HMD: 'HMD',
HP: 'HP',
HTC: 'HTC',
HUAWEI: 'Huawei',
Expand Down
2 changes: 1 addition & 1 deletion src/main/ua-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@

/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,
// BlackBerry/BenQ/Palm/Sony-Ericsson/Acer/Asus/Dell/Meizu/Motorola/Polytron/Infinix/Tecno/Micromax/Advan
/; (imo) ([\w ]+?)(?: bui|\))/i, // IMO
/; (hmd|imo) ([\w ]+?)(?: bui|\))/i, // HMD/IMO
/(hp) ([\w ]+\w)/i, // HP iPAQ
/(asus)-?(\w+)/i, // Asus
/(microsoft); (lumia[\w ]+)/i, // Microsoft Lumia
Expand Down
27 changes: 27 additions & 0 deletions test/specs/device-all.json
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,33 @@
"type": "mobile"
}
},
{
"desc": "HMD Pulse",
"ua": "Mozilla/5.0 (Linux; Android 14; HMD Pulse) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Mobile Safari/537.36",
"expect": {
"vendor": "HMD",
"model": "Pulse",
"type": "mobile"
}
},
{
"desc": "HMD Pulse Plus",
"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",
"expect": {
"vendor": "HMD",
"model": "Pulse Plus",
"type": "mobile"
}
},
{
"desc": "HMD Pulse Pro",
"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",
"expect": {
"vendor": "HMD",
"model": "Pulse Pro",
"type": "mobile"
}
},
{
"desc": "Honor MagicPad 13 WiFi",
"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",
Expand Down

0 comments on commit 94d3d84

Please sign in to comment.