From 8dce4cc5146c70239076b0610a1fe241cbcd9fe6 Mon Sep 17 00:00:00 2001 From: Faisal Salman Date: Fri, 17 May 2024 22:36:41 +0700 Subject: [PATCH] Fix #721 - Improve detection: recognize OPPO Pad as tablet --- src/main/ua-parser.js | 2 ++ test/specs/device-all.json | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/src/main/ua-parser.js b/src/main/ua-parser.js index 2bdf786..b00a871 100755 --- a/src/main/ua-parser.js +++ b/src/main/ua-parser.js @@ -521,6 +521,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, diff --git a/test/specs/device-all.json b/test/specs/device-all.json index fbaf6e9..3927c2a 100644 --- a/test/specs/device-all.json +++ b/test/specs/device-all.json @@ -1511,6 +1511,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",