Skip to content

Commit

Permalink
Adds detection for Veera and improves detection for Mi Browser (#7787)
Browse files Browse the repository at this point in the history
* Adds detection for Veera
* Improves detection for Mi Browser
  • Loading branch information
liviuconcioiu authored Aug 19, 2024
1 parent 04e9074 commit 185a10a
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Parser/Client/Browser.php
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,7 @@ class Browser extends AbstractClientParser
'V0' => 'vBrowser',
'VA' => 'Vast Browser',
'V3' => 'VD Browser',
'VR' => 'Veera',
'VE' => 'Venus Browser',
'WD' => 'Vewd Browser',
'V5' => 'VibeMate',
Expand Down Expand Up @@ -735,7 +736,7 @@ class Browser extends AbstractClientParser
'N3', 'GD', 'O9', 'Q3', 'F7', 'K2', 'P5', 'H5', 'V3',
'K3', 'Q4', 'G2', 'R2', 'WX', 'XP', '3I', 'BG', 'R0',
'JO', 'OL', 'GN', 'W4', 'QI', 'E1', 'RI', '8B', '5B',
'K4', 'WK', 'T3', 'K5', 'MU', '9P', 'K6',
'K4', 'WK', 'T3', 'K5', 'MU', '9P', 'K6', 'VR',
],
'Firefox' => [
'FF', 'BI', 'BF', 'BH', 'BN', 'C0', 'CU', 'EI', 'F1',
Expand Down Expand Up @@ -782,7 +783,7 @@ class Browser extends AbstractClientParser
'M7', 'GN', 'D3', 'IG', 'HW', '4O', 'OU', '5P', 'KE',
'5A', 'TT', '6P', 'G3', '7P', 'VU', 'F8', 'L4', 'DK',
'DP', 'KL', 'K4', 'N6', 'KU', 'WK', 'M8', 'UP', 'ZT',
'9P', 'N8',
'9P', 'N8', 'VR',
];

/**
Expand All @@ -795,7 +796,7 @@ class Browser extends AbstractClientParser
'Chrome Webview' => ['Android WebView'],
'DuckDuckGo Privacy Browser' => ['DuckDuckGo'],
'Edge WebView' => ['Microsoft Edge WebView2'],
'Mi Browser' => ['Miui Browser'],
'Mi Browser' => ['Miui Browser', 'XiaoMiBrowser'],
'Microsoft Edge' => ['Edge'],
'Norton Private Browser' => ['Norton Secure Browser'],
'Vewd Browser' => ['Vewd Core'],
Expand Down Expand Up @@ -1008,7 +1009,7 @@ public function parse(): ?array

// If client hints report the following browsers, we use the version from useragent
if (!empty($browserFromUserAgent['version'])
&& \in_array($short, ['MU', 'OM', 'OP'])
&& \in_array($short, ['MU', 'OM', 'OP', 'VR'])
) {
$version = $browserFromUserAgent['version'];
}
Expand Down
22 changes: 22 additions & 0 deletions Tests/Parser/Client/fixtures/browser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9786,3 +9786,25 @@
engine: WebKit
engine_version: ""
family: ""
-
user_agent: Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Mobile Safari/537.36 Veera/1.2.40
client:
type: browser
name: Veera
version: 1.2.40
engine: Blink
engine_version: 122.0.0.0
family: Chrome
headers:
Sec-CH-UA: '"Chromium";v="122", "Not(A:Brand";v="24", "Veera";v="122"'
-
user_agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/122.0.6261.119 Safari/534.24 XiaoMi/MiuiBrowser/18.4.720715
client:
type: browser
name: Mi Browser
version: 18.4.720715
engine: Blink
engine_version: 122.0.6261.119
family: Chrome
headers:
Sec-CH-UA: '"Chromium";v="122", "Not(A:Brand";v="24", "XiaoMiBrowser";v="122"'
5 changes: 5 additions & 0 deletions regexes/client/browsers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
# @license http://www.gnu.org/licenses/lgpl.html LGPL v3 or later
###############

# Veera (https://www.veera.com/)
- regex: 'Veera/([\d\.]+)'
name: 'Veera'
version: '$1'

# Ninesky (https://web.archive.org/web/20120615040938/http://www.ninesky.com/index_en.html)
- regex: 'Ninesky(?:-android-mobile)?/([\d\.]+)'
name: 'Ninesky'
Expand Down

0 comments on commit 185a10a

Please # to comment.