From 3489f9d374b29b1a3ccd06a267be928583d11609 Mon Sep 17 00:00:00 2001 From: Denis Demchenko Date: Sun, 9 Sep 2018 15:07:40 +0300 Subject: [PATCH] Support Swing browser fixes #248 --- src/parser-browsers.js | 15 +++++++++++++++ test/acceptance/useragentstrings.yml | 15 +++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/src/parser-browsers.js b/src/parser-browsers.js index 187f1bf..024f1b2 100644 --- a/src/parser-browsers.js +++ b/src/parser-browsers.js @@ -124,6 +124,21 @@ const browsersList = [ return browser; }, }, + { + test: [/swing/i], + describe(ua) { + const browser = { + name: 'Swing', + }; + const version = getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i, ua) || getFirstMatch(commonVersionIdentifier, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, { test: [/coast/i], describe(ua) { diff --git a/test/acceptance/useragentstrings.yml b/test/acceptance/useragentstrings.yml index a874af3..8acc3cc 100644 --- a/test/acceptance/useragentstrings.yml +++ b/test/acceptance/useragentstrings.yml @@ -2444,3 +2444,18 @@ type: "tablet" engine: name: "Blink" + Swing: + - + ua: "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.105 Safari/537.36 Swing/4.2.4.0" + spec: + browser: + name: "Swing" + version: "4.2.4.0" + os: + name: "Windows" + version: "NT 10.0" + versionName: "10" + platform: + type: "desktop" + engine: + name: "Blink"