Skip to content

Commit

Permalink
Merge pull request #512 from linusg/add-serenityos
Browse files Browse the repository at this point in the history
Add SerenityOS
  • Loading branch information
elsigh authored Mar 15, 2022
2 parents bbd43ae + 45e1a12 commit 09e9ccc
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
7 changes: 6 additions & 1 deletion regexes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1005,6 +1005,11 @@ user_agent_parsers:
# HTTrack crawler
- regex: '\b(HTTrack) (\d+)\.(\d+)(?:[\.\-](\d+)|)'

# SerenityOS (https://serenityos.org)
# https://github.com/SerenityOS/serenity/blob/2e1bbcb0faeae92d7595b8e0b022a8cdcecca07e/Userland/Libraries/LibWeb/Loader/ResourceLoader.h#L27
- regex: 'SerenityOS'
family_replacement: 'SerenityOS Browser'

os_parsers:
##########
# HbbTV vendors
Expand Down Expand Up @@ -1724,7 +1729,7 @@ os_parsers:

# just os
- regex: '(Windows|Android|WeTab|Maemo|Web0S)'
- regex: '(Ubuntu|Kubuntu|Arch Linux|CentOS|Slackware|Gentoo|openSUSE|SUSE|Red Hat|Fedora|PCLinuxOS|Mageia|(?:Free|Open|Net|\b)BSD)'
- regex: '(Ubuntu|Kubuntu|Arch Linux|CentOS|Slackware|Gentoo|openSUSE|SUSE|Red Hat|Fedora|PCLinuxOS|Mageia|SerenityOS|(?:Free|Open|Net|\b)BSD)'
# Linux + Kernel Version
- regex: '(Linux)(?:[ /](\d+)\.(\d+)(?:\.(\d+)|)|)'
- regex: 'SunOS'
Expand Down
6 changes: 6 additions & 0 deletions tests/test_os.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3105,3 +3105,9 @@ test_cases:
patch:
patch_minor:

- user_agent_string: 'Mozilla/4.0 (SerenityOS; x86_64) LibWeb+LibJS (Not KHTML, nor Gecko) LibWeb'
family: 'SerenityOS'
major:
minor:
patch:
patch_minor:
5 changes: 5 additions & 0 deletions tests/test_ua.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8629,3 +8629,8 @@ test_cases:
minor: '20'
patch: '1'

- user_agent_string: 'Mozilla/4.0 (SerenityOS; x86_64) LibWeb+LibJS (Not KHTML, nor Gecko) LibWeb'
family: 'SerenityOS Browser'
major:
minor:
patch:

0 comments on commit 09e9ccc

Please sign in to comment.