Skip to content

Commit

Permalink
Improves engine version detection for Blink
Browse files Browse the repository at this point in the history
  • Loading branch information
liviuconcioiu committed Nov 2, 2024
1 parent 1207a30 commit 2eae5c3
Show file tree
Hide file tree
Showing 6 changed files with 138 additions and 131 deletions.
7 changes: 7 additions & 0 deletions Parser/Client/Browser.php
Original file line number Diff line number Diff line change
Expand Up @@ -1044,6 +1044,13 @@ public function parse(): ?array
if ('DuckDuckGo Privacy Browser' === $name) {
$version = '';
}

// In case client hints report a more detailed engine version, we try to use this instead
if ('Blink' === $engine && 'Iridium' !== $name
&& \version_compare($engineVersion, $browserFromClientHints['version'], '<')
) {
$engineVersion = $browserFromClientHints['version'];
}
} else {
$name = $browserFromUserAgent['name'];
$version = $browserFromUserAgent['version'];
Expand Down
20 changes: 10 additions & 10 deletions Tests/Parser/Client/fixtures/browser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6066,7 +6066,7 @@
name: CCleaner
version: 99.0.15185.77
engine: Blink
engine_version: 99.0.4844.74
engine_version: 99.0.15185.77
family: Chrome
headers:
Sec-CH-UA: '" Not A;Brand";v="99.0.0.0", "Chromium";v="99.0.15185.77", "CCleaner Browser";v="99.0.15185.77"'
Expand Down Expand Up @@ -7521,7 +7521,7 @@
name: Avira Secure Browser
version: 116.0.22144.111
engine: Blink
engine_version: 116.0.0.0
engine_version: 116.0.22144.111
family: Chrome
headers:
Sec-CH-UA: '"Chromium";v="116.0.22144.111", "Not)A;Brand";v="24.0.0.0", "Avira Secure Browser";v="116.0.22144.111"'
Expand Down Expand Up @@ -7555,7 +7555,7 @@
name: Norton Private Browser
version: 115.0.21984.175
engine: Blink
engine_version: 115.0.0.0
engine_version: 115.0.21984.175
family: Chrome
headers:
Sec-CH-UA: '"Not/A)Brand";v="99.0.0.0", "Norton Secure Browser";v="115.0.21984.175", "Chromium";v="115.0.21984.175"'
Expand All @@ -7566,7 +7566,7 @@
name: Norton Private Browser
version: 121.0.23861.160
engine: Blink
engine_version: 121.0.0.0
engine_version: 121.0.23861.160
family: Chrome
headers:
Sec-CH-UA: '"Not A(Brand";v="99.0.0.0", "Norton Private Browser";v="121.0.23861.160", "Chromium";v="121.0.23861.160"'
Expand All @@ -7577,7 +7577,7 @@
name: ALVA
version: 113.0.0.0
engine: Blink
engine_version: 113.0.0.0
engine_version: 113.0.5643.0
family: Chrome
headers:
Sec-CH-UA: '"Chromium";v="113.0.5643.0", "Not-A.Brand";v="24.0.0.0"'
Expand All @@ -7588,7 +7588,7 @@
name: Yandex Browser
version: 23.3.1.895
engine: Blink
engine_version: 110.0.0.0
engine_version: 110.0.5481.208
family: ""
headers:
Sec-CH-UA: '"Chromium";v="110.0.5481.208", "Not A(Brand";v="24.0.0.0", "YaBrowser";v="23.3.1.895"'
Expand Down Expand Up @@ -8406,7 +8406,7 @@
name: Chrome Webview
version: 116.0.5845.164
engine: Blink
engine_version: 116.0.0.0
engine_version: 116.0.5845.164
family: Chrome
headers:
Sec-CH-UA: '"Chromium";v="116.0.5845.164", "Not)A;Brand";v="24.0.0.0", "Android WebView";v="116.0.5845.164"'
Expand Down Expand Up @@ -9663,7 +9663,7 @@
name: Total Browser
version: 116.0.5845.10014
engine: Blink
engine_version: 116.0.0.0
engine_version: 116.0.5845.10014
family: Chrome
headers:
Sec-CH-UA: '"Not)A;Brand";v="24.0.0.0", "Total Browser";v="116.0.5845.10014"'
Expand All @@ -9686,7 +9686,7 @@
name: Spark
version: 107.0.5304.122
engine: Blink
engine_version: 107.0.0.0
engine_version: 107.0.5304.122
family: Chrome
headers:
Sec-CH-UA: '"Spark";v="107.0.5304.122", "Not=A?Brand";v="24.0.0.0"'
Expand Down Expand Up @@ -9754,7 +9754,7 @@
name: Presearch
version: ""
engine: Blink
engine_version: 123.0.0.0
engine_version: 123.0.6312.121
family: Chrome
headers:
Sec-CH-UA: '"Chromium";v="123.0.6312.121", "Not:A-Brand";v="8.0.0.0"'
Expand Down
Loading

0 comments on commit 2eae5c3

Please sign in to comment.