Skip to content

Commit

Permalink
feat(browser): detect World Browser - Fast & Simple
Browse files Browse the repository at this point in the history
feat(browser): detect Every Browser

ref matomo-org#7039
  • Loading branch information
sanchezzzhak committed Nov 21, 2023
1 parent 4d945ba commit 13a3efa
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 1 deletion.
10 changes: 10 additions & 0 deletions Parser/Client/Browser.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ class Browser extends AbstractClientParser
'DD' => 'DuckDuckGo Privacy Browser',
'EC' => 'Ecosia',
'EW' => 'Edge WebView',
'EV' => 'Every Browser',
'EI' => 'Epic',
'EL' => 'Elinks',
'EN' => 'EinkBro',
Expand Down Expand Up @@ -538,6 +539,7 @@ class Browser extends AbstractClientParser
'WH' => 'Whale Browser',
'WO' => 'wOSBrowser',
'WT' => 'WeTab Browser',
'1W' => 'World Browser - Fast & Simple',
'WL' => 'Wolvic',
'YG' => 'YAGI',
'YJ' => 'Yahoo! Japan Browser',
Expand Down Expand Up @@ -601,6 +603,7 @@ class Browser extends AbstractClientParser
'F4', 'YG', 'WR', 'NA', 'DM', '1M', 'A7', 'XN', 'XT',
'XB', 'W1', 'HT', 'B8', 'F5', 'B9', 'WA', 'T0', 'HC',
'O6', 'P7', 'LJ', 'LC', 'O7', 'N2', 'A8', 'P8', 'RB',
'1W', 'EV',
],
'Firefox' => [
'AX', 'BI', 'BF', 'BH', 'BN', 'C0', 'CU', 'EI', 'F1',
Expand Down Expand Up @@ -639,6 +642,7 @@ class Browser extends AbstractClientParser
'B5', 'B6', 'TC', 'A6', '2X', 'F4', 'YG', 'WR', 'NA',
'DM', '1M', 'A7', 'XN', 'XT', 'XB', 'W1', 'HT', 'B7',
'B9', 'T0', 'I8', 'O6', 'P7', 'O8', '4B', 'A8', 'P8',
'1W', 'EV',
];

/**
Expand Down Expand Up @@ -878,6 +882,12 @@ public function parse(): ?array
if ('Blink' === $engine && 'Flow Browser' === $name) {
$engineVersion = '';
}
// the browser simulate ua for Android OS
if ('Every Browser' === $name) {
$family = 'Chrome';
$engine = 'Blink';
$engineVersion = '';
}

return [
'type' => 'browser',
Expand Down
5 changes: 4 additions & 1 deletion Parser/OperatingSystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,10 @@ public function parse(): ?array

$platform = $this->parsePlatform();
$family = self::getOsFamily($short);
$androidApps = ['com.hisense.odinbrowser', 'com.seraphic.openinet.pre', 'com.appssppa.idesktoppcbrowser'];
$androidApps = [
'com.hisense.odinbrowser', 'com.seraphic.openinet.pre', 'com.appssppa.idesktoppcbrowser',
'every.browser.inc'
];

if (null !== $this->clientHints) {
if (\in_array($this->clientHints->getApp(), $androidApps) && 'Android' !== $name) {
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 @@ -7639,3 +7639,25 @@
engine: Blink
engine_version: 84.0.4147.38
family: Chrome
-
user_agent: Mozilla/5.0 (Linux; Android 10; SM-J600G Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/81.0.4044.138 Mobile Safari/537.36
client:
type: browser
name: World Browser - Fast & Simple
version: ""
engine: Blink
engine_version: 81.0.4044.138
family: Chrome
headers:
http-x-requested-with: com.browser.elmurzaev
-
user_agent: Mozilla/5.0 (iPad; CPU OS 13_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0 Mobile/15E148 Safari/604.1
client:
type: browser
name: Every Browser
version: ""
engine: Blink
engine_version: ""
family: Chrome
headers:
http-x-requested-with: every.browser.inc
20 changes: 20 additions & 0 deletions Tests/fixtures/unknown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3285,3 +3285,23 @@
model: X98 S500
os_family: Android
browser_family: Unknown
-
user_agent: Mozilla/5.0 (iPad; CPU OS 13_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0 Mobile/15E148 Safari/604.1
os:
name: Android
version: ""
platform: ""
client:
type: browser
name: Every Browser
version: ""
engine: Blink
engine_version: ""
device:
type: ""
brand: ""
model: ""
os_family: Android
browser_family: Chrome
headers:
http-x-requested-with: every.browser.inc
2 changes: 2 additions & 0 deletions regexes/client/hints/browsers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -208,3 +208,5 @@
'com.opera.mini.native.beta': 'Opera Mini'
'com.sec.android.app.sbrowser': 'Samsung Browser'
'com.sec.android.app.sbrowser.lite': 'Samsung Browser Lite'
'com.browser.elmurzaev': 'World Browser - Fast & Simple'
'every.browser.inc': 'Every Browser'

0 comments on commit 13a3efa

Please sign in to comment.