Skip to content

Commit 1747707

Browse files
committed
Backport - Fix #678 - Improve Yandex detection
(cherry picked from commit 33f0209)
1 parent d414045 commit 1747707

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/ua-parser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@
251251
], [VERSION, [NAME, 'Konqueror']], [
252252
/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i // IE11
253253
], [VERSION, [NAME, 'IE']], [
254-
/yabrowser\/([\w\.]+)/i // Yandex
254+
/ya(?:search)?browser\/([\w\.]+)/i // Yandex
255255
], [VERSION, [NAME, 'Yandex']], [
256256
/(avast|avg)\/([\w\.]+)/i // Avast/AVG Secure Browser
257257
], [[NAME, /(.+)/, '$1 Secure '+BROWSER], VERSION], [

test/browser-test.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1298,6 +1298,16 @@
12981298
"major" : "1"
12991299
}
13001300
},
1301+
{
1302+
"desc" : "Yandex",
1303+
"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",
1304+
"expect" :
1305+
{
1306+
"name" : "Yandex",
1307+
"version" : "22.70",
1308+
"major" : "22"
1309+
}
1310+
},
13011311
{
13021312
"desc" : "Puffin",
13031313
"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)