Skip to content

Commit

Permalink
update vivaldi browser regex to match multiple versioning structures (#…
Browse files Browse the repository at this point in the history
…575)

Co-authored-by: Carlos Azevedo <[email protected]>
  • Loading branch information
csazevedo and Carlos Azevedo authored Apr 9, 2024
1 parent 0cf88c5 commit 7f417c8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
4 changes: 2 additions & 2 deletions regexes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -608,8 +608,8 @@ user_agent_parsers:
- regex: 'Superhuman'
family_replacement: 'Superhuman'

# Vivaldi uses "Vivaldi"
- regex: '(Vivaldi)/(\d+)\.(\d+)\.(\d+)'
# Vivaldi
- regex: '(Vivaldi)/(\d+)(?:\.(\d+)|)(?:\.(\d+)|)(?:\.(\d+)|)'

# Edge/major_version.minor_version
# Edge with chromium Edg/major_version.minor_version.patch.minor_patch
Expand Down
18 changes: 18 additions & 0 deletions tests/test_ua.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1409,6 +1409,24 @@ test_cases:
minor: '0'
patch: '83'

- user_agent_string: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.105 Safari/537.36 Vivaldi/1.0.162.9'
family: 'Vivaldi'
major: '1'
minor: '0'
patch: '162'

- user_agent_string: 'Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_2 like Mac OS X) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Vivaldi/114'
family: 'Vivaldi'
major: '114'
minor:
patch:

- user_agent_string: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36 Vivaldi/3.7'
family: 'Vivaldi'
major: '3'
minor: '7'
patch:

- user_agent_string: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.9600'
family: 'Edge'
major: '12'
Expand Down

0 comments on commit 7f417c8

Please sign in to comment.