From 536031d78977a7af78996f82cf5be75a049650c3 Mon Sep 17 00:00:00 2001 From: Faisal Salman Date: Wed, 20 Nov 2024 16:59:37 +0700 Subject: [PATCH] Improve device detection: Google Pixel Tablet --- src/main/ua-parser.js | 2 +- test/specs/device-all.json | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/ua-parser.js b/src/main/ua-parser.js index e915b24..b0bf179 100755 --- a/src/main/ua-parser.js +++ b/src/main/ua-parser.js @@ -598,7 +598,7 @@ ], [[MODEL, /_/g, ' '], [VENDOR, 'Nokia'], [TYPE, MOBILE]], [ // Google - /(pixel c)\b/i // Google Pixel C + /(pixel (c|tablet))\b/i // Google Pixel C/Tablet ], [MODEL, [VENDOR, GOOGLE], [TYPE, TABLET]], [ /droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i // Google Pixel ], [MODEL, [VENDOR, GOOGLE], [TYPE, MOBILE]], [ diff --git a/test/specs/device-all.json b/test/specs/device-all.json index e0f2aee..b45d4ac 100644 --- a/test/specs/device-all.json +++ b/test/specs/device-all.json @@ -4760,6 +4760,15 @@ "type": "mobile" } }, + { + "desc": "Google Pixel Tablet", + "ua": "Mozilla/5.0 (Linux; Android 14; Pixel Tablet Build/AP2A.240905.003; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/130.0.6723.107 Safari/537.36", + "expect": { + "vendor": "Google", + "model": "Pixel Tablet", + "type": "tablet" + } + }, { "desc": "Google Pixel XL", "ua": "Mozilla/5.0 (Linux; Android 7.1; Pixel XL Build/NDE63X) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.85 Mobile Safari/537.36",