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

feat: add multiple new browsers #576

Merged
Merged
Show file tree
Hide file tree
Changes from 7 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
23 changes: 21 additions & 2 deletions regexes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,25 @@ user_agent_parsers:
- regex: '(Nintendo 3DS)'
family_replacement: 'NetFront NX'

# Huawei Browser, should go before Safari and Chrome Mobile
- regex: '(HuaweiBrowser)/(\d+)\.(\d+)\.(\d+)\.(\d+)'
csazevedo marked this conversation as resolved.
Show resolved Hide resolved
family_replacement: 'Huawei Browser'

# AVG
- regex: '(AVG)/(\d+)\.(\d+)\.(\d+)\.(\d+)'
csazevedo marked this conversation as resolved.
Show resolved Hide resolved
family_replacement: 'AVG'

# Avast
- regex: '(AvastSecureBrowser|Avast)/(\d+)\.(\d+)\.(\d+)'
family_replacement: 'Avast Secure Browser'

# Instabridge
- regex: '(Instabridge)/(\d+)(?:\.(\d+)|)(?:\.(\d+)|)'

# Aloha Browser
- regex: '(AlohaBrowser)/(\d+)\.(\d+)\.(\d+)(?:\.(\d+)|)'
family_replacement: 'Aloha Browser'

# Amazon Silk, should go before Safari and Chrome Mobile
- regex: '(Silk)/(\d+)\.(\d+)(?:\.([0-9\-]+)|)'
family_replacement: 'Amazon Silk'
Expand Down Expand Up @@ -606,8 +625,8 @@ user_agent_parsers:
- regex: 'Superhuman'
family_replacement: 'Superhuman'

# Vivaldi uses "Vivaldi"
- regex: '(Vivaldi)/(\d+)\.(\d+)\.(\d+)'
# Vivaldi
- regex: '(Vivaldi)/(\d+)(?:\.(\d+)|)(?:\.(\d+)|)(?:\.(\d+)|)'
csazevedo marked this conversation as resolved.
Show resolved Hide resolved

# Edge/major_version.minor_version
# Edge with chromium Edg/major_version.minor_version.patch.minor_patch
Expand Down
85 changes: 85 additions & 0 deletions tests/test_ua.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1385,6 +1385,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 Expand Up @@ -8717,3 +8735,70 @@ test_cases:
major: '102'
minor:
patch:

- user_agent_string: 'Mozilla/5.0 (Linux; Android 13; LGE-AN00; HMSCore 6.12.2.302) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.88 HuaweiBrowser/14.0.5.301 Mobile Safari/537.36'
family: 'Huawei Browser'
major: '14'
minor: '0'
patch: '5'

- user_agent_string: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36 AVG/121.0.0.0'
family: 'AVG'
major: '121'
minor: '0'
patch: '0'

- user_agent_string: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Avast/120.0.0.0'
family: 'Avast Secure Browser'
major: '120'
minor: '0'
patch: '0'

- user_agent_string: 'Mozilla/5.0 (Linux; Android 8.1.0; B43du7I2fV; U; in) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.5563.115 Mobile AvastSecureBrowser/7.5.2 Safari/537.36'
family: 'Avast Secure Browser'
major: '7'
minor: '5'
patch: '2'


- user_agent_string: 'Mozilla/5.0 (Linux; Android 13; 0LpRiWjrpo; U; en) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.5938.153 Mobile Avast/7.7.5 Safari/537.36'
family: 'Avast Secure Browser'
major: '7'
minor: '7'
patch: '5'

- user_agent_string: 'Mozilla/5.0 (iPhone; CPU iPhone OS 17_2_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) AvastSecureBrowser/5.3.1 Mobile/15E148 Version/17.0 Safari/605.1.15'
family: 'Avast Secure Browser'
major: '5'
minor: '3'
patch: '1'

- user_agent_string: 'Mozilla/5.0 (Linux; Android 11; SM-A225M) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/85.0.4183.127 Mobile Safari/537.36 Instabridge/22'
family: 'Instabridge'
major: '22'
minor:
patch:

- user_agent_string: 'Mozilla/5.0 (Linux; Android 11; SM-J400F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.127 Mobile Safari/537.36 Instabridge/21.9.0'
family: 'Instabridge'
major: '21'
minor: '9'
patch: '0'

- user_agent_string: 'Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Mobile Safari/537.36 AlohaBrowser/5.6.1'
family: 'Aloha Browser'
major: '5'
minor: '6'
patch: '1'

- user_agent_string: 'Mozilla/5.0 (iPhone; CPU iPhone OS 17_2_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 Version/17.2.1 Safari/605.1.15 AlohaBrowser/5.4.1'
family: 'Aloha Browser'
major: '5'
minor: '4'
patch: '1'

- user_agent_string: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 AlohaBrowser/1.3.0.0 Safari/537.36'
family: 'Aloha Browser'
major: '1'
minor: '3'
patch: '0'
Loading