Skip to content

Commit

Permalink
Fix #601 - Detect Chrome OS without version
Browse files Browse the repository at this point in the history
  • Loading branch information
faisalman committed Jan 31, 2023
1 parent c9d1ab9 commit f8e5a1f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/ua-parser.js
Expand Up @@ -738,7 +738,7 @@
// Google Chromecast
/crkey\/([\d\.]+)/i // Google Chromecast
], [VERSION, [NAME, CHROME+'cast']], [
/(cros) [\w]+ ([\w\.]+\w)/i // Chromium OS
/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i // Chromium OS
], [[NAME, 'Chromium OS'], VERSION],[

// Smart TVs
Expand Down
9 changes: 9 additions & 0 deletions test/os-test.json
Expand Up @@ -665,6 +665,15 @@
"version" : "1.9.2.22-0.1mdv2010.2"
}
},
{
"desc" : "Chrome OS",
"ua" : "Mozilla/5.0 (X11; CrOS x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.0.0 Safari/537.36",
"expect" :
{
"name" : "Chromium OS",
"version" : "undefined"
}
},
{
"desc" : "Chromium OS",
"ua" : "Mozilla/5.0 (X11; CrOS x86_64 10575.58.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36",
Expand Down

0 comments on commit f8e5a1f

Please sign in to comment.