Skip to content

Commit fecff02

Browse files
committed
Backport - Fix #721 - Improve detection: recognize OPPO Pad as tablet
(cherry picked from commit 8dce4cc)
1 parent d3d83fa commit fecff02

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/ua-parser.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,8 @@
439439
/; (\w+) bui.+ oppo/i,
440440
/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i
441441
], [MODEL, [VENDOR, 'OPPO'], [TYPE, MOBILE]], [
442+
/\b(opd2\d{3}a?) bui\//i
443+
], [MODEL, [VENDOR, 'OPPO'], [TYPE, TABLET]], [
442444

443445
// Vivo
444446
/vivo (\w+)(?: bui|\))/i,

test/device-test.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1502,6 +1502,15 @@
15021502
"type": "mobile"
15031503
}
15041504
},
1505+
{
1506+
"desc": "OPPO Pad",
1507+
"ua": "Mozilla/5.0 (Linux; U; Android 13; zh-CN; OPD2101 Build/TP1A.220905.001) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/100.0.4896.58 UCBrowser/16.3.9.1290 Mobile Safari/537.36",
1508+
"expect": {
1509+
"vendor": "OPPO",
1510+
"model": "OPD2101",
1511+
"type": "tablet"
1512+
}
1513+
},
15051514
{
15061515
"desc": "OPPO Neo",
15071516
"ua": "Mozilla/5.0 (Linux; U; Android 4.2.2; zh-cn; R831T Build/JDQ39) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 OppoBrowser/3.3.2 Mobile Safari/534.30",

0 commit comments

Comments
 (0)