Skip to content

Commit

Permalink
Update UA for Ladybird Browser (previously SerenityOS Browser)
Browse files Browse the repository at this point in the history
  • Loading branch information
MacDue committed May 9, 2023
1 parent 1ef0926 commit f9602f5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
9 changes: 4 additions & 5 deletions regexes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1013,10 +1013,10 @@ 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'
# Ladybird Browser (https://ladybird.dev)
# https://github.com/SerenityOS/serenity/blob/8da9ff24e4e720b1e80a027f09c419ac9503f896/Userland/Libraries/LibWeb/Loader/ResourceLoader.h#L52
# Note: The browser is just called "Browser" inside SerenityOS, and Ladybird everywhere else.
- regex: 'LibWeb\+LibJS\/\d+\.\d+ (Ladybird)\/(\d+)\.(\d+)'

os_parsers:
##########
Expand Down Expand Up @@ -5549,7 +5549,6 @@ device_parsers:
device_replacement: 'Motorola$2'
brand_replacement: 'Motorola'
model_replacement: '$2'


##########
# nintendo
Expand Down
2 changes: 1 addition & 1 deletion tests/test_os.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3175,7 +3175,7 @@ test_cases:
patch:
patch_minor:

- user_agent_string: 'Mozilla/4.0 (SerenityOS; x86_64) LibWeb+LibJS (Not KHTML, nor Gecko) LibWeb'
- user_agent_string: 'Mozilla/5.0 (SerenityOS; x86_64) LibWeb+LibJS/1.0 Ladybird/1.0'
family: 'SerenityOS'
major:
minor:
Expand Down
8 changes: 4 additions & 4 deletions tests/test_ua.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8646,10 +8646,10 @@ 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:
- user_agent_string: 'Mozilla/5.0 (Linux; x86_64) LibWeb+LibJS/1.0 Ladybird/1.0'
family: 'Ladybird'
major: '1'
minor: '0'
patch:

- user_agent_string: 'surveyon/2.7.6 Mobile (Android: 11; MODEL:CPH2127; PRODUCT:CPH2127T2; MANUFACTURER:OPPO;)'
Expand Down

0 comments on commit f9602f5

Please sign in to comment.