Skip to content

Commit

Permalink
Improve device detection: Google Pixel Watch
Browse files Browse the repository at this point in the history
  • Loading branch information
faisalman committed Nov 20, 2024
1 parent 4ddbeea commit c8ece08
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/ua-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]], [
Expand Down
18 changes: 18 additions & 0 deletions test/specs/device-all.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit c8ece08

Please sign in to comment.