Skip to content

Commit

Permalink
Fix #620 - Add new Device: Kobo
Browse files Browse the repository at this point in the history
  • Loading branch information
faisalman committed Jan 26, 2023
1 parent 0cbeb7a commit f815ca6
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ console, mobile, tablet, smarttv, wearable, embedded

# Possible 'device.vendor':
Acer, Alcatel, Amazon, Apple, Archos, ASUS, AT&T, BenQ, BlackBerry, Dell,
Essential, Facebook, Fairphone, GeeksPhone, Google, HP, HTC, Huawei, Jolla,
Essential, Facebook, Fairphone, GeeksPhone, Google, HP, HTC, Huawei, Jolla, Kobo,
Lenovo, LG, Meizu, Microsoft, Motorola, Nexian, Nintendo, Nokia, Nvidia, OnePlus,
OPPO, Ouya, Palm, Panasonic, Pebble, Polytron, Realme, RIM, Roku, Samsung, Sharp,
Siemens, Sony[Ericsson], Sprint, Tesla, Vivo, Vodafone, Xbox, Xiaomi, Zebra, ZTE, ...
Expand Down
1 change: 1 addition & 0 deletions src/ua-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,7 @@
/(oppo) ?([\w ]+) bui/i // OPPO
], [VENDOR, MODEL, [TYPE, MOBILE]], [

/(kobo)\s(ereader|touch)/i, // Kobo
/(archos) (gamepad2?)/i, // Archos
/(hp).+(touchpad(?!.+tablet)|tablet)/i, // HP TouchPad
/(kindle)\/([\w\.]+)/i, // Kindle
Expand Down
20 changes: 19 additions & 1 deletion test/device-test.json
Original file line number Diff line number Diff line change
Expand Up @@ -817,6 +817,24 @@
"type": "smarttv"
}
},
{
"desc": "Kobo eReader",
"ua": "Mozilla/5.0 (Unknown; Linux) AppleWebKit/538.1 (KHTML, like Gecko) Kobo eReader Safari/538.1",
"expect": {
"vendor": "Kobo",
"model": "eReader",
"type": "tablet"
}
},
{
"desc": "Kobo Touch",
"ua": "Mozilla/5.0 (Linux; U; Android 2.0; en-us;) AppleWebKit/538.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/538.1 (Kobo Touch 0377/4.20.14622)",
"expect": {
"vendor": "Kobo",
"model": "Touch",
"type": "tablet"
}
},
{
"desc": "Lenovo Tab 2",
"ua": "Mozilla/5.0 (Linux; Android 5.0.1; Lenovo TAB 2 A7-30HC Build/LRX21M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/74.0.3729.157 Safari/537.36",
Expand All @@ -826,7 +844,7 @@
"type": "tablet"
}
},
{
{
"desc": "Lenovo Phone",
"ua": "Mozilla/5.0 (Linux; Android 6.0; Lenovo PB2-650M Build/MRA58K; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/89.0.4389.105 Mobile Safari/537.36 [FB_IAB/FB4A;FBAV/311.0.0.44.117;]",
"expect": {
Expand Down

0 comments on commit f815ca6

Please # to comment.