Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yandex Browser detection #98

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
language: php

dist: trusty

php:
- 5.4
- 5.5
Expand Down
2 changes: 2 additions & 0 deletions src/Agent.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class Agent extends Mobile_Detect
'Opera' => 'Opera|OPR',
'Edge' => 'Edge',
'UCBrowser' => 'UCBrowser',
'YandexBrowser' => 'YaBrowser',
'Vivaldi' => 'Vivaldi',
'Chrome' => 'Chrome',
'Firefox' => 'Firefox',
Expand Down Expand Up @@ -74,6 +75,7 @@ class Agent extends Mobile_Detect
'IE' => ['IEMobile/[VER];', 'IEMobile [VER]', 'MSIE [VER];', 'rv:[VER]'],
'Edge' => 'Edge/[VER]',
'Vivaldi' => 'Vivaldi/[VER]',
'YandexBrowser' => 'YaBrowser/[VER]',
];

/**
Expand Down
2 changes: 2 additions & 0 deletions tests/AgentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class AgentTest extends TestCase
'Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25' => 'Safari',
'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' => 'Vivaldi',
'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 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 YaBrowser/17.3.0.1896 Yowser/2.5 Safari/537.36' => 'YandexBrowser',
];

private $robots = [
Expand Down Expand Up @@ -63,6 +64,7 @@ class AgentTest extends TestCase
'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; de) Opera 11.51' => '11.51',
'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; 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_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 YaBrowser/17.3.0.1896 Yowser/2.5 Safari/537.36' => '17.3.0.1896',
];

private $operatingSystemVersions = [
Expand Down