Skip to content

Commit 33f0209

Browse files
committed
Fix #678 - Improve Yandex detection
1 parent 33df5dc commit 33f0209

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

src/ua-parser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@
319319
], [VERSION, [NAME, 'Konqueror']], [
320320
/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i // IE11
321321
], [VERSION, [NAME, 'IE']], [
322-
/yabrowser\/([\w\.]+)/i // Yandex
322+
/ya(?:search)?browser\/([\w\.]+)/i // Yandex
323323
], [VERSION, [NAME, 'Yandex']], [
324324
/(avast|avg)\/([\w\.]+)/i // Avast/AVG Secure Browser
325325
], [[NAME, /(.+)/, '$1 Secure '+SUFFIX_BROWSER], VERSION], [

test/browser-test.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1308,6 +1308,16 @@
13081308
"major" : "1"
13091309
}
13101310
},
1311+
{
1312+
"desc" : "Yandex",
1313+
"ua" : "Mozilla/5.0 (Linux; arm_64; Android 11; M2101K7AG) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.125 YaApp_Android/22.70 YaSearchBrowser/22.70 BroPP/1.0 SA/3 Mobile Safari/537.36",
1314+
"expect" :
1315+
{
1316+
"name" : "Yandex",
1317+
"version" : "22.70",
1318+
"major" : "22"
1319+
}
1320+
},
13111321
{
13121322
"desc" : "Puffin",
13131323
"ua" : "Mozilla/5.0 (Linux; Android 6.0.1; Lenovo P2a42 Build/MMB29M; en-us) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Mobile Safari/537.36 Puffin/6.0.8.15804AP",

0 commit comments

Comments
 (0)