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

Adds detection for Spark, Total Browser, improves detection for Belva Browser, Phoenix and rename MIUI Browser to Mi Browser #7741

Merged
merged 15 commits into from
Jul 31, 2024
Merged
9 changes: 6 additions & 3 deletions Parser/Client/Browser.php
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ class Browser extends AbstractClientParser
'M3' => 'Midori Lite',
'M6' => 'MixerBox AI',
'MO' => 'Mobicip',
'MU' => 'MIUI Browser',
'MU' => 'Mi Browser',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sgiehl Do you agree to change the name?

'MS' => 'Mobile Silk',
'MK' => 'Mogok Browser',
'M8' => 'Motorola Internet Browser',
Expand Down Expand Up @@ -570,6 +570,7 @@ class Browser extends AbstractClientParser
'LE' => 'Smart Lenovo Browser',
'OZ' => 'Smooz',
'SN' => 'Snowshoe',
'K5' => 'Spark',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Googling seems to suggest that there have been only "Baidu Spark" browser (which we do have already). Is this the one or is it something different?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'B1' => 'Spectre Browser',
'S2' => 'Splash',
'SI' => 'Sputnik Browser',
Expand Down Expand Up @@ -609,6 +610,7 @@ class Browser extends AbstractClientParser
'TC' => 'TUC Mini Browser',
'TU' => 'Tungsten',
'TG' => 'ToGate',
'T3' => 'Total Browser',
'TS' => 'TweakStyle',
'TV' => 'TV Bro',
'U0' => 'U Browser',
Expand Down Expand Up @@ -695,7 +697,7 @@ class Browser extends AbstractClientParser
* @var array
*/
protected static $browserFamilies = [
'Android Browser' => ['AN', 'MU'],
'Android Browser' => ['AN'],
'BlackBerry Browser' => ['BB'],
'Baidu' => ['BD', 'BS'],
'Amiga' => ['AV', 'AW'],
Expand Down Expand Up @@ -728,7 +730,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',
'K4', 'WK', 'T3', 'K5', 'MU',
],
'Firefox' => [
'FF', 'BI', 'BF', 'BH', 'BN', 'C0', 'CU', 'EI', 'F1',
Expand Down Expand Up @@ -787,6 +789,7 @@ class Browser extends AbstractClientParser
'Chrome Webview' => ['Android WebView'],
'DuckDuckGo Privacy Browser' => ['DuckDuckGo'],
'Edge WebView' => ['Microsoft Edge WebView2'],
'Mi Browser' => ['Miui Browser'],
'Microsoft Edge' => ['Edge'],
'Norton Private Browser' => ['Norton Secure Browser'],
'Vewd Browser' => ['Vewd Core'],
Expand Down
63 changes: 59 additions & 4 deletions Tests/Parser/Client/fixtures/browser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1047,11 +1047,11 @@
user_agent: Mozilla/5.0 (Linux; U; Android 4.3; zh-cn; MI 3W Build/JLS36C) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30 XiaoMi/MiuiBrowser/1.0
client:
type: browser
name: MIUI Browser
name: Mi Browser
version: "1.0"
engine: WebKit
engine_version: "534.30"
family: Android Browser
family: Chrome
-
user_agent: Mozilla/5.0 (iPhone; U; CPU iPhone OS 5_0_1 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Mobile/8C148
client:
Expand Down Expand Up @@ -7611,11 +7611,11 @@
user_agent: Mozilla/5.0 (Linux; U; Android 10; az-az; Mi 10 Build/QKQ1.191117.002) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/79.0.3945.147 Mobile Safari/537.36 XiaoMi/MiuiBrowser/12.6.2.2-gn
client:
type: browser
name: MIUI Browser
name: Mi Browser
version: 12.6.2.2
engine: Blink
engine_version: 79.0.3945.147
family: Android Browser
family: Chrome
headers:
http-x-requested-with: com.mi.globalbrowser
-
Expand Down Expand Up @@ -9613,3 +9613,58 @@
engine: WebKit
engine_version: 605.1.15
family: Chrome
-
user_agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36
client:
type: browser
name: Total Browser
version: 116.0.5845.10014
engine: Blink
engine_version: 116.0.0.0
family: Chrome
headers:
Sec-CH-UA: '"Not)A;Brand";v="24.0.0.0", "Total Browser";v="116.0.5845.10014"'
Sec-CH-UA-Full-Version: 116.0.5845.10014
-
user_agent: Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.6312.118 Mobile Safari/537.36 XiaoMi/MiuiBrowser/14.13.5-gn
client:
type: browser
name: Mi Browser
version: "123"
engine: Blink
engine_version: 123.0.6312.118
family: Chrome
headers:
Sec-CH-UA: '"Miui Browser";v="123", "Not:A-Brand";v="8", "Chromium";v="123"'
-
user_agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36
client:
type: browser
name: Spark
version: 107.0.5304.122
engine: Blink
engine_version: 107.0.0.0
family: Chrome
headers:
Sec-CH-UA: '"Spark";v="107.0.5304.122", "Not=A?Brand";v="24.0.0.0"'
Sec-CH-UA-Full-Version: 107.0.5304.122
-
user_agent: Mozilla/5.0 (Linux; Android 10) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/124.0.6367.179 Mobile DuckDuckGo/4 Safari/537.36
client:
type: browser
name: Belva Browser
version: ""
engine: Blink
engine_version: 124.0.6367.179
family: Chrome
headers:
http-x-requested-with: com.belva.browser
-
user_agent: com.test.app/1.2.3 (iphoneos17.2; iPhone13,1; en-US; America/Phoenix); Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1
client:
type: browser
name: Mobile Safari
version: "11.0"
engine: WebKit
engine_version: 604.1.38
family: Safari
6 changes: 6 additions & 0 deletions Tests/Parser/Client/fixtures/mobile_app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2081,6 +2081,12 @@
type: mobile app
name: TikTok
version: 34.9.0
-
user_agent: com.theepochtimes.mobile/2.37.1 b1 (iphoneos17.2; iPhone13,1; en-US; America/Phoenix); Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1
client:
type: mobile app
name: The Epoch Times
version: 2.37.1
-
user_agent: ReutersNews/6.0.3 iPad14,4 iPadOS/17.5.1 CFNetwork/1.0 Darwin/23.5.0
client:
Expand Down
Loading
Loading