Skip to content

Commit

Permalink
Merge pull request #171 from loclv/feature/add_coc_coc_browser
Browse files Browse the repository at this point in the history
Added Coc Coc browser
  • Loading branch information
jenssegers authored Jun 13, 2020
2 parents 4168116 + 3185d9b commit b522536
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Agent.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class Agent extends Mobile_Detect
'Opera Mini' => 'Opera Mini',
'Opera' => 'Opera|OPR',
'Edge' => 'Edge|Edg',
'Coc Coc' => 'coc_coc_browser',
'UCBrowser' => 'UCBrowser',
'Vivaldi' => 'Vivaldi',
'Chrome' => 'Chrome',
Expand Down Expand Up @@ -71,6 +72,7 @@ class Agent extends Mobile_Detect
'IE' => ['IEMobile/[VER];', 'IEMobile [VER]', 'MSIE [VER];', 'rv:[VER]'],
'Edge' => ['Edge/[VER]', 'Edg/[VER]'],
'Vivaldi' => 'Vivaldi/[VER]',
'Coc Coc' => 'coc_coc_browser/[VER]',
];

/**
Expand Down Expand Up @@ -298,7 +300,7 @@ public function isRobot($userAgent = null)
{
return $this->getCrawlerDetect()->isCrawler($userAgent ?: $this->userAgent);
}

/**
* Get the device type
* @param null $userAgent
Expand Down
2 changes: 2 additions & 0 deletions tests/AgentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class AgentTest extends TestCase
'Mozilla/5.0 (Linux; U; Android 4.0.4; en-US; LT28h Build/6.1.E.3.7) AppleWebKit/534.31 (KHTML, like Gecko) UCBrowser/9.2.2.323 U3/0.8.0 Mobile Safari/534.31' => 'UCBrowser',
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36 Edge/15.15063' => 'Edge',
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.29 Safari/537.36 Edg/79.0.309.18' => 'Edge',
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) coc_coc_browser/86.0.180 Chrome/80.0.3987.180 Safari/537.36' => 'Coc Coc',
];

private $robots = [
Expand Down Expand Up @@ -67,6 +68,7 @@ class AgentTest extends TestCase
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12' => '12',
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.29 Safari/537.36 Edg/79.0.309.18' => '79.0.309.18',
'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36 Vivaldi/1.2.490.43' => '1.2.490.43',
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) coc_coc_browser/86.0.180 Chrome/80.0.3987.180 Safari/537.36' => '86.0.180',
];

private $operatingSystemVersions = [
Expand Down

0 comments on commit b522536

Please sign in to comment.