Skip to content

Commit

Permalink
feat(client) detect browser: Firefox Rocket
Browse files Browse the repository at this point in the history
  • Loading branch information
sanchezzzhak committed Mar 17, 2022
1 parent 5776725 commit ec586b1
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Parser/Client/Browser.php
Original file line number Diff line number Diff line change
Expand Up @@ -672,10 +672,11 @@ public function parse(): ?array
$name = $appHash['name'];
$version = '';
$short = self::getBrowserShortName($name);
$family = self::getBrowserFamily((string) $short);

if (\preg_match('~Chrome/.+ Safari/537.36~i', $this->userAgent)) {
$engine = 'Blink';
$family = 'Chrome';
$family = $family ?? 'Chrome';
$engineVersion = '';
}

Expand Down
26 changes: 24 additions & 2 deletions Tests/Parser/Client/fixtures/browser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1877,8 +1877,8 @@
type: browser
name: Firefox Rocket
version: "1.6.2"
engine: WebKit
engine_version: "537.36"
engine: Blink
engine_version: ""
family: Firefox
-
user_agent: Mozilla/5.0 Linux; Android 8.0.0 AppleWebKit/537.36 KHTML, like Gecko Version/4.0 Web Explorer/2.6.6 Chrome/75.0.3770.143 Mobile Safari/537.36
Expand Down Expand Up @@ -4966,3 +4966,25 @@
family: Chrome
headers:
X-Requested-With: nextapp.atlas
-
user_agent: Mozilla/5.0 (Linux; Android 11; SM-T725 Build/RP1A.200720.012; rv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Rocket/2.6.0(20651) Chrome/87.0.4280.141 Safari/537.36
client:
type: browser
name: Firefox Rocket
version: 2.6.0
engine: Blink
engine_version: ""
family: Firefox
headers:
X-Requested-With: org.mozilla.rocket
-
user_agent: Mozilla/5.0 (Linux; Android 11; SM-A025F Build/RP1A.200720.012; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/94.0.4606.61 Mobile Safari/537.36
client:
type: browser
name: Firefox Rocket
version: ""
engine: Blink
engine_version: ""
family: Firefox
headers:
X-Requested-With: org.mozilla.rocket
2 changes: 1 addition & 1 deletion regexes/client/browsers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1809,7 +1809,7 @@
name: 'Firefox Rocket'
version: '$1'
engine:
default: 'WebKit'
default: 'Blink'

# Web Explorer
- regex: 'Web Explorer/(\d+[\.\d]+).*Chrome'
Expand Down
1 change: 1 addition & 0 deletions regexes/client/hints/browsers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@
'com.dolphin.browser.zero': 'Dolphin Zero'
'mobi.mgeek.TunnyBrowser': 'Dolphin' # Dolphin + AdBlock
'nextapp.atlas': 'Atlas'
'org.mozilla.rocket': 'Firefox Rocket' # Firefox Lite

0 comments on commit ec586b1

Please sign in to comment.