From 6e438019324bf910d2ffc6ead31bce80d3fc6a0b Mon Sep 17 00:00:00 2001 From: Carlos Azevedo Date: Tue, 19 Mar 2024 11:06:26 +0000 Subject: [PATCH 1/8] update vivaldi browser regex to match multiple versioning structures --- regexes.yaml | 4 ++-- tests/test_ua.yaml | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/regexes.yaml b/regexes.yaml index 0a1c0b95..8bb317dd 100644 --- a/regexes.yaml +++ b/regexes.yaml @@ -606,8 +606,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 diff --git a/tests/test_ua.yaml b/tests/test_ua.yaml index 1a6c8f8e..e82d7eef 100644 --- a/tests/test_ua.yaml +++ b/tests/test_ua.yaml @@ -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' From 32bb5afce078618ba9741c64177be7dc83e6d3ed Mon Sep 17 00:00:00 2001 From: Carlos Azevedo Date: Tue, 19 Mar 2024 11:30:37 +0000 Subject: [PATCH 2/8] feat: add Huawei Browser --- regexes.yaml | 4 ++++ tests/test_ua.yaml | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/regexes.yaml b/regexes.yaml index 8bb317dd..d379ee54 100644 --- a/regexes.yaml +++ b/regexes.yaml @@ -378,6 +378,10 @@ 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' + # Amazon Silk, should go before Safari and Chrome Mobile - regex: '(Silk)/(\d+)\.(\d+)(?:\.([0-9\-]+)|)' family_replacement: 'Amazon Silk' diff --git a/tests/test_ua.yaml b/tests/test_ua.yaml index e82d7eef..33b57b7f 100644 --- a/tests/test_ua.yaml +++ b/tests/test_ua.yaml @@ -8735,3 +8735,9 @@ 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' From 1e845d770420e3f65108ab6ea11e47e60bf96579 Mon Sep 17 00:00:00 2001 From: Carlos Azevedo Date: Tue, 19 Mar 2024 11:32:43 +0000 Subject: [PATCH 3/8] feat: add AVG --- regexes.yaml | 4 ++++ tests/test_ua.yaml | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/regexes.yaml b/regexes.yaml index d379ee54..f240e467 100644 --- a/regexes.yaml +++ b/regexes.yaml @@ -382,6 +382,10 @@ user_agent_parsers: - regex: '(HuaweiBrowser)/(\d+)\.(\d+)\.(\d+)\.(\d+)' family_replacement: 'Huawei Browser' + # AVG + - regex: '(AVG)/(\d+)\.(\d+)\.(\d+)\.(\d+)' + family_replacement: 'AVG' + # Amazon Silk, should go before Safari and Chrome Mobile - regex: '(Silk)/(\d+)\.(\d+)(?:\.([0-9\-]+)|)' family_replacement: 'Amazon Silk' diff --git a/tests/test_ua.yaml b/tests/test_ua.yaml index 33b57b7f..25ff0ca0 100644 --- a/tests/test_ua.yaml +++ b/tests/test_ua.yaml @@ -8741,3 +8741,9 @@ test_cases: 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: 'Huawei Browser' + major: '121' + minor: '0' + patch: '0' From b339f767d56b57986fb7c1d29c675ddc35ba1ff0 Mon Sep 17 00:00:00 2001 From: Carlos Azevedo Date: Tue, 19 Mar 2024 11:40:50 +0000 Subject: [PATCH 4/8] feat: add Avast Secure Browser --- regexes.yaml | 4 ++++ tests/test_ua.yaml | 25 +++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/regexes.yaml b/regexes.yaml index f240e467..2be7bbf1 100644 --- a/regexes.yaml +++ b/regexes.yaml @@ -386,6 +386,10 @@ user_agent_parsers: - regex: '(AVG)/(\d+)\.(\d+)\.(\d+)\.(\d+)' family_replacement: 'AVG' + # Avast + - regex: '(AvastSecureBrowser|Avast)/(\d+)\.(\d+)\.(\d+)' + family_replacement: 'Avast Secure Browser' + # Amazon Silk, should go before Safari and Chrome Mobile - regex: '(Silk)/(\d+)\.(\d+)(?:\.([0-9\-]+)|)' family_replacement: 'Amazon Silk' diff --git a/tests/test_ua.yaml b/tests/test_ua.yaml index 25ff0ca0..beb42cc2 100644 --- a/tests/test_ua.yaml +++ b/tests/test_ua.yaml @@ -8747,3 +8747,28 @@ test_cases: 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' From 5eaf1368e308ec7c1ea8ff550c2ade80c343a9f9 Mon Sep 17 00:00:00 2001 From: Carlos Azevedo Date: Tue, 19 Mar 2024 11:44:34 +0000 Subject: [PATCH 5/8] feat: add Instabridge browser --- regexes.yaml | 3 +++ tests/test_ua.yaml | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/regexes.yaml b/regexes.yaml index 2be7bbf1..09dc2e98 100644 --- a/regexes.yaml +++ b/regexes.yaml @@ -390,6 +390,9 @@ user_agent_parsers: - regex: '(AvastSecureBrowser|Avast)/(\d+)\.(\d+)\.(\d+)' family_replacement: 'Avast Secure Browser' + # Instabridge + - regex: '(Instabridge)/(\d+)(?:\.(\d+)|)(?:\.(\d+)|)' + # Amazon Silk, should go before Safari and Chrome Mobile - regex: '(Silk)/(\d+)\.(\d+)(?:\.([0-9\-]+)|)' family_replacement: 'Amazon Silk' diff --git a/tests/test_ua.yaml b/tests/test_ua.yaml index beb42cc2..0c8bf9d5 100644 --- a/tests/test_ua.yaml +++ b/tests/test_ua.yaml @@ -8772,3 +8772,15 @@ test_cases: 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' From 07a7d60f1837f3ccd49654d3bf06b73e2bde5594 Mon Sep 17 00:00:00 2001 From: Carlos Azevedo Date: Tue, 19 Mar 2024 11:50:04 +0000 Subject: [PATCH 6/8] feat: add Aloha Browser --- regexes.yaml | 4 ++++ tests/test_ua.yaml | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/regexes.yaml b/regexes.yaml index 09dc2e98..500f772d 100644 --- a/regexes.yaml +++ b/regexes.yaml @@ -393,6 +393,10 @@ user_agent_parsers: # 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' diff --git a/tests/test_ua.yaml b/tests/test_ua.yaml index 0c8bf9d5..dc57233a 100644 --- a/tests/test_ua.yaml +++ b/tests/test_ua.yaml @@ -8784,3 +8784,21 @@ test_cases: 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' From bc586cbbee8ed774b56751ce0b7ff960bcfe189e Mon Sep 17 00:00:00 2001 From: Carlos Azevedo Date: Mon, 8 Apr 2024 17:18:01 +0100 Subject: [PATCH 7/8] fix AVG browser test --- tests/test_ua.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_ua.yaml b/tests/test_ua.yaml index dc57233a..61d4a8c7 100644 --- a/tests/test_ua.yaml +++ b/tests/test_ua.yaml @@ -8743,7 +8743,7 @@ test_cases: 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: 'Huawei Browser' + family: 'AVG' major: '121' minor: '0' patch: '0' From f6df6902c1e96f3a5a08f1588b99949573b8389f Mon Sep 17 00:00:00 2001 From: Carlos Azevedo Date: Tue, 9 Apr 2024 16:37:05 +0100 Subject: [PATCH 8/8] fix: remove unnecessary capturing group --- regexes.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/regexes.yaml b/regexes.yaml index ec0036bd..14412307 100644 --- a/regexes.yaml +++ b/regexes.yaml @@ -379,11 +379,11 @@ user_agent_parsers: family_replacement: 'NetFront NX' # Huawei Browser, should go before Safari and Chrome Mobile - - regex: '(HuaweiBrowser)/(\d+)\.(\d+)\.(\d+)\.(\d+)' + - regex: '(HuaweiBrowser)/(\d+)\.(\d+)\.(\d+)\.\d+' family_replacement: 'Huawei Browser' # AVG - - regex: '(AVG)/(\d+)\.(\d+)\.(\d+)\.(\d+)' + - regex: '(AVG)/(\d+)\.(\d+)\.(\d+)\.\d+' family_replacement: 'AVG' # Avast @@ -638,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