From 47678762bd7a42f8f9ef45161dcdd5dee67c8f69 Mon Sep 17 00:00:00 2001 From: Aleksandr Beshkenadze Date: Wed, 27 May 2015 15:51:04 +0300 Subject: [PATCH] Added support for detection of Yandex.Browser. --- src/bowser.js | 8 ++++++++ src/useragents.js | 17 +++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/src/bowser.js b/src/bowser.js index 5dd653e..dcbcca5 100644 --- a/src/bowser.js +++ b/src/bowser.js @@ -37,6 +37,13 @@ , version: versionIdentifier || getFirstMatch(/(?:opera|opr)[\s\/](\d+(\.\d+)?)/i) } } + else if (/yabrowser/i.test(ua)) { + result = { + name: 'Yandex Browser' + , yandexbrowser: t + , version: versionIdentifier || getFirstMatch(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i) + } + } else if (/windows phone/i.test(ua)) { result = { name: 'Windows Phone' @@ -223,6 +230,7 @@ // http://developer.yahoo.com/yui/articles/gbs if (result.msedge || (result.msie && result.version >= 10) || + (result.yandexbrowser && result.version >= 15) || (result.chrome && result.version >= 20) || (result.firefox && result.version >= 20.0) || (result.safari && result.version >= 6) || diff --git a/src/useragents.js b/src/useragents.js index 08dd44c..a4c518e 100644 --- a/src/useragents.js +++ b/src/useragents.js @@ -252,6 +252,23 @@ module.exports.useragents = { , c: true } } + , 'Yandex Browser': { + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 YaBrowser/15.4.2272.3420 (beta) Yowser/2.0 Safari/537.36': { + yandexbrowser: true + , webkit: true + , version: '15.4' + , a: true + }, + 'Mozilla/5.0 (Linux; Android 5.1.1; Nexus 5 Build/LMY48B) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 YaBrowser/15.4.2272.3608.00 Mobile Safari/537.36': { + yandexbrowser: true + , android: true + , osversion: '5.1.1' + , mobile: true + , version: '15.4' + , webkit: true + , a: true + } + } , Safari: { 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.13+ (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2': { safari: true