From c8ece08b1b90131746db6b02aba114aa2bf2c5f7 Mon Sep 17 00:00:00 2001 From: Faisal Salman Date: Wed, 20 Nov 2024 17:19:46 +0700 Subject: [PATCH] Improve device detection: Google Pixel Watch --- src/main/ua-parser.js | 3 ++- test/specs/device-all.json | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/main/ua-parser.js b/src/main/ua-parser.js index b0bf179..2fb34d3 100755 --- a/src/main/ua-parser.js +++ b/src/main/ua-parser.js @@ -782,7 +782,8 @@ /\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i // Samsung Galaxy Watch ], [MODEL, [VENDOR, SAMSUNG], [TYPE, WEARABLE]], [ - /((pebble))app/i // Pebble + /((pebble))app/i, // Pebble + /(google) (pixel watch[\w ]*)( bui|\))/i // Pixel Watch ], [VENDOR, MODEL, [TYPE, WEARABLE]], [ /(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i // Apple Watch ], [MODEL, [VENDOR, APPLE], [TYPE, WEARABLE]], [ diff --git a/test/specs/device-all.json b/test/specs/device-all.json index b45d4ac..9adbd09 100644 --- a/test/specs/device-all.json +++ b/test/specs/device-all.json @@ -4769,6 +4769,24 @@ "type": "tablet" } }, + { + "desc": "Google Pixel Watch", + "ua": "Dalvik/2.1.0 (Linux; U; Android 13; Google Pixel Watch Build/TWD4.231005.002)", + "expect": { + "vendor": "Google", + "model": "Pixel Watch", + "type": "wearable" + } + }, + { + "desc": "Google Pixel Watch 2", + "ua": "Dalvik/2.1.0 (Linux; U; Android 13; Google Pixel Watch 2 Build/TWD9.240605.001.A1)", + "expect": { + "vendor": "Google", + "model": "Pixel Watch 2", + "type": "wearable" + } + }, { "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",