From 343b748986ead25b04a862ad2ee5cad158539672 Mon Sep 17 00:00:00 2001 From: Julian Doucette Date: Wed, 29 Aug 2018 22:44:50 +0100 Subject: [PATCH] Added maxthon desktop support --- src/parser-browsers.js | 4 ++-- test/acceptance/useragentstrings.yml | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/parser-browsers.js b/src/parser-browsers.js index 1a3ca28..187f1bf 100644 --- a/src/parser-browsers.js +++ b/src/parser-browsers.js @@ -170,12 +170,12 @@ const browsersList = [ }, }, { - test: [/mxios/i], + test: [/Maxthon|mxios/i], describe(ua) { const browser = { name: 'Maxthon', }; - const version = getFirstMatch(commonVersionIdentifier, ua) || getFirstMatch(/(?:mxios)[\s/](\d+(\.?_?\d+)+)/i, ua); + const version = getFirstMatch(commonVersionIdentifier, ua) || getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i, ua); if (version) { browser.version = version; diff --git a/test/acceptance/useragentstrings.yml b/test/acceptance/useragentstrings.yml index 56976aa..1781c34 100644 --- a/test/acceptance/useragentstrings.yml +++ b/test/acceptance/useragentstrings.yml @@ -2261,6 +2261,21 @@ engine: name: "WebKit" version: "601.1.46" + - + ua: "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Maxthon/4.1.0.4000 Chrome/26.0.1410.43 Safari/537.1" + spec: + browser: + name: "Maxthon" + version: "4.1.0.4000" + os: + name: "Windows" + version: "NT 6.1" + versionName: "7" + platform: + type: "desktop" + engine: + name: "WebKit" + version: "537.1" Epiphany: - ua: "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/602.1 (KHTML, like Gecko) Version/8.0 Safari/602.1 Debian/buildd-unstable (3.18.5-1) Epiphany/3.18.5"