Skip to content

Commit

Permalink
Backport - Fix #721 - Improve detection: recognize OPPO Pad as tablet
Browse files Browse the repository at this point in the history
(cherry picked from commit 8dce4cc)
  • Loading branch information
faisalman committed May 28, 2024
1 parent d3d83fa commit fecff02
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/ua-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,8 @@
/; (\w+) bui.+ oppo/i,
/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i
], [MODEL, [VENDOR, 'OPPO'], [TYPE, MOBILE]], [
/\b(opd2\d{3}a?) bui\//i
], [MODEL, [VENDOR, 'OPPO'], [TYPE, TABLET]], [

// Vivo
/vivo (\w+)(?: bui|\))/i,
Expand Down
9 changes: 9 additions & 0 deletions test/device-test.json
Original file line number Diff line number Diff line change
Expand Up @@ -1502,6 +1502,15 @@
"type": "mobile"
}
},
{
"desc": "OPPO Pad",
"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",
"expect": {
"vendor": "OPPO",
"model": "OPD2101",
"type": "tablet"
}
},
{
"desc": "OPPO Neo",
"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",
Expand Down

0 comments on commit fecff02

Please sign in to comment.