Skip to content

Commit

Permalink
feat(client) detect browser: OH Private Browser
Browse files Browse the repository at this point in the history
  • Loading branch information
sanchezzzhak committed Mar 17, 2022
1 parent ec586b1 commit 0cc98ba
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Parser/Client/Browser.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class Browser extends AbstractClientParser
'1I' => 'IE Browser Fast',
'1V' => 'Vegas Browser',
'1O' => 'OH Browser',
'3O' => 'OH Private Browser',
'1X' => 'XBrowser Mini',
'1S' => 'Sharkee Browser',
'2L' => 'Lark Browser',
Expand Down Expand Up @@ -672,11 +673,10 @@ 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 = $family ?? 'Chrome';
$family = self::getBrowserFamily((string) $short) ?? 'Chrome';
$engineVersion = '';
}

Expand Down
11 changes: 11 additions & 0 deletions Tests/Parser/Client/fixtures/browser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4988,3 +4988,14 @@
family: Firefox
headers:
X-Requested-With: org.mozilla.rocket
-
user_agent: Mozilla/5.0 (Linux; Android 11; Android_Device) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/96.0.4664.92 Mobile Safari/537.36
client:
type: browser
name: OH Private Browser
version: ""
engine: Blink
engine_version: ""
family: Chrome
headers:
X-Requested-With: com.oh.brop
1 change: 1 addition & 0 deletions regexes/client/hints/browsers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
'com.internet.browser.secure': 'Internet Browser Secure'
'acr.browser.linxy': 'Vegas Browser'
'com.oh.bro': 'OH Browser'
'com.oh.brop': 'OH Private Browser'
'com.duckduckgo.mobile.android': 'DuckDuckGo Privacy Browser'
'net.onecook.browser': 'Stargon'
'com.mi.globalbrowser.mini': 'Mint Browser'
Expand Down

0 comments on commit 0cc98ba

Please sign in to comment.