From 959e106754828ae557b0dbcfaf8eeee938d3c824 Mon Sep 17 00:00:00 2001 From: Carlos Azevedo Date: Tue, 9 Apr 2024 16:49:08 +0100 Subject: [PATCH] feat: add multiple new browsers (#576) * update vivaldi browser regex to match multiple versioning structures * feat: add Huawei Browser * feat: add AVG * feat: add Avast Secure Browser * feat: add Instabridge browser * feat: add Aloha Browser * fix AVG browser test * fix: remove unnecessary capturing group --------- Co-authored-by: Carlos Azevedo --- regexes.yaml | 21 ++++++++++++++- tests/test_ua.yaml | 67 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+), 1 deletion(-) diff --git a/regexes.yaml b/regexes.yaml index 27723d94..14412307 100644 --- a/regexes.yaml +++ b/regexes.yaml @@ -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+' + family_replacement: 'Huawei Browser' + + # AVG + - regex: '(AVG)/(\d+)\.(\d+)\.(\d+)\.\d+' + 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' + # Brave Browser https://brave.com/ , should go before Safari and Chrome Mobile - regex: '((?:B|b)rave(?:\sChrome)?)/(\d+)(?:\.(\d+)|)(?:\.(\d+)|)(?:\.(\d+)|)' family_replacement: 'Brave' @@ -619,7 +638,7 @@ user_agent_parsers: family_replacement: 'Superhuman' # Vivaldi - - regex: '(Vivaldi)/(\d+)(?:\.(\d+)|)(?:\.(\d+)|)(?:\.(\d+)|)' + - regex: '(Vivaldi)/(\d+)(?:\.(\d+)|)(?:\.(\d+)|)' # Edge/major_version.minor_version # Edge with chromium Edg/major_version.minor_version.patch.minor_patch diff --git a/tests/test_ua.yaml b/tests/test_ua.yaml index 27fd4b12..28d9d1c1 100644 --- a/tests/test_ua.yaml +++ b/tests/test_ua.yaml @@ -8795,3 +8795,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'