Skip to content

Commit

Permalink
Backport - Improve browser detection: Maxthon
Browse files Browse the repository at this point in the history
(cherry picked from commit 246c038)
  • Loading branch information
faisalman committed Dec 21, 2024
1 parent d9c68a7 commit dcca2eb
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/ua-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,8 @@
// Mixed
/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i // Baidu
], [VERSION, [NAME, 'Baidu']], [
/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i // Maxthon
], [VERSION, [NAME, 'Maxthon']], [
/(kindle)\/([\w\.]+)/i, // Kindle
/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,
// Lunascape/Maxthon/Netfront/Jasmine/Blazer/Sleipnir
Expand Down
62 changes: 61 additions & 1 deletion test/browser-test.json
Original file line number Diff line number Diff line change
Expand Up @@ -1099,7 +1099,57 @@
}
},
{
"desc" : "Maxthon",
"desc" : "Maxthon on Android",
"ua" : "Mozilla/5.0 (Linux; Android 5.1.1; KFAUWI Build/LVY48F; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/100.0.4896.127 Safari/537.36 MxBrowser/4.3.5.2000",
"expect" :
{
"name" : "Maxthon",
"version" : "4.3.5.2000",
"major" : "4"
}
},
{
"desc" : "Maxthon on iOS",
"ua" : "Mozilla/5.0 (iPad; CPU OS 13_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/10.0 Mobile/15E148 Safari/602.1 MXiOS/5.4.5.2",
"expect" :
{
"name" : "Maxthon",
"version" : "5.4.5.2",
"major" : "5"
}
},
{
"desc" : "Maxthon on Linux",
"ua" : "Mozilla/5.0 (X11; Linux i686; Ubuntu 14.04.3 LTS) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.0 Maxthon/1.0.5.3 Safari/537.36",
"expect" :
{
"name" : "Maxthon",
"version" : "1.0.5.3",
"major" : "1"
}
},
{
"desc" : "Maxthon on macOS",
"ua" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/604.5.6 (KHTML, like Gecko) Version/11.0.3 Safari/604.5.6 Maxthon/5.1.102",
"expect" :
{
"name" : "Maxthon",
"version" : "5.1.102",
"major" : "5"
}
},
{
"desc" : "Maxthon on Windows Server 2003",
"ua" : "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; MyIE2; .NET CLR 1.1.4322)",
"expect" :
{
"name" : "Maxthon",
"version" : "undefined",
"major" : "undefined"
}
},
{
"desc" : "Maxthon on Windows XP",
"ua" : "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; SV1; Maxthon; .NET CLR 1.1.4322)",
"expect" :
{
Expand All @@ -1108,6 +1158,16 @@
"major" : "undefined"
}
},
{
"desc" : "Maxthon on Windows 10",
"ua" : "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.79 Safari/537.36 Maxthon/5.2.7.2000",
"expect" :
{
"name" : "Maxthon",
"version" : "5.2.7.2000",
"major" : "5"
}
},
{
"desc" : "Midori",
"ua" : "Midori/0.2.2 (X11; Linux i686; U; en-us) WebKit/531.2+",
Expand Down

0 comments on commit dcca2eb

Please sign in to comment.