Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix OS version detection for Chrome OS #231

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions regexes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -965,6 +965,9 @@ os_parsers:
# http://code.google.com/p/chromium-os/issues/detail?id=11573
# http://code.google.com/p/chromium-os/issues/detail?id=13790
##########
# Newer versions of Chrome OS require you to look at the Chrome version to get the real version
- regex: '(CrOS) [a-z0-9_]+ \d+\.\d+\.\d+\) .* Chrome/(\d+)\.(\d+)\.(\d+)\.(\d+)'
os_replacement: 'Chrome OS'
- regex: '(CrOS) [a-z0-9_]+ (\d+)\.(\d+)(?:\.(\d+))?'
os_replacement: 'Chrome OS'

Expand Down
7 changes: 7 additions & 0 deletions tests/test_os.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2342,6 +2342,13 @@ test_cases:
patch: '6'
patch_minor:

- user_agent_string: 'Mozilla/5.0 (X11; CrOS x86_64 8872.76.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.105 Safari/537.36'
family: 'Chrome OS'
major: '55'
minor: '0'
patch: '2883'
patch_minor: '105'

- user_agent_string: 'Safari/12602.2.14.0.7 CFNetwork/807.1.3 Darwin/16.1.0 (x86_64)'
family: 'Mac OS X'
major: '10'
Expand Down