Extract Chromecast firmware version

Rather than put the CPU type as the OS version, for Chromecast, the
firmware version would be much more useful.

For example:

  Mozilla/5.0 (X11; Linux aarch64) AppleWebKit/537.36 (KHTML, like
  Gecko) Chrome/76.0.3809.81 Safari/537.36 CrKey/1.42.183786

This should produce:

  os: { name: "Chromecast", version: "1.42.183786" }

Instead of:

  os: { name: "Linux", version: "aarch64" }
This commit is contained in:
Joey Parrish 2020-08-12 11:00:50 -07:00
parent 1fc9d5a4a4
commit 20ceaf9000
2 changed files with 13 additions and 0 deletions

View File

@ -731,6 +731,10 @@
/mozilla.+\(mobile;.+gecko.+firefox/i // Firefox OS /mozilla.+\(mobile;.+gecko.+firefox/i // Firefox OS
], [[NAME, 'Firefox OS'], VERSION], [ ], [[NAME, 'Firefox OS'], VERSION], [
// Google Chromecast
/crkey\/([\d\.]+)/i // Google Chromecast
], [VERSION, [NAME, 'Chromecast']], [
// Console // Console
/(nintendo|playstation)\s([wids34portablevu]+)/i, // Nintendo/Playstation /(nintendo|playstation)\s([wids34portablevu]+)/i, // Nintendo/Playstation

View File

@ -251,6 +251,15 @@
"version" : "undefined" "version" : "undefined"
} }
}, },
{
"desc" : "Google Chromecast",
"ua" : "Mozilla/5.0 (X11; Linux aarch64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.81 Safari/537.36 CrKey/1.42.183786",
"expect" :
{
"name" : "Chromecast",
"version" : "1.42.183786"
}
},
{ {
"desc" : "Nintendo", "desc" : "Nintendo",
"ua" : "", "ua" : "",