Skip to content

Commit

Permalink
fix: ensure Ladybird regex works with newer UAs (#573)
Browse files Browse the repository at this point in the history
  • Loading branch information
lbarthon authored Feb 21, 2024
1 parent 8144b03 commit d3450bb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions regexes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1029,8 +1029,8 @@ user_agent_parsers:
- regex: '\b(HTTrack) (\d+)\.(\d+)(?:[\.\-](\d+)|)'

# Ladybird Browser (https://ladybird.dev)
# https://github.com/SerenityOS/serenity/blob/8da9ff24e4e720b1e80a027f09c419ac9503f896/Userland/Libraries/LibWeb/Loader/ResourceLoader.h#L52
- regex: 'LibWeb\+LibJS\/\d+\.\d+ (Ladybird)\/(\d+)\.(\d+)'
# https://github.com/SerenityOS/serenity/blob/6a662e0d43810c1dbd56fbf0c123f258aa1d694e/Userland/Libraries/LibWeb/Loader/ResourceLoader.h#L64
- regex: '(Ladybird)\/(\d+)\.(\d+)'

# MullvadBrowser (https://mullvad.net/en/browser)
- regex: '(MullvadBrowser)/(\d+)(?:\.(\d+)|)(?:\.(\d+)|)'
Expand Down
6 changes: 6 additions & 0 deletions tests/test_ua.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8670,6 +8670,12 @@ test_cases:
minor: '0'
patch:

- user_agent_string: 'Mozilla/5.0 (Linux; x86_64) 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;)'
family: 'Surveyon'
major: '2'
Expand Down

0 comments on commit d3450bb

Please sign in to comment.