From 8bea5c552aa784bee06818a8dc8b21b5b33ff7e4 Mon Sep 17 00:00:00 2001 From: Faisal Salman Date: Fri, 2 Apr 2021 00:15:20 +0700 Subject: [PATCH] Add new Engine & Browser: Flow --- readme.md | 4 ++-- src/ua-parser.js | 5 +++-- test/browser-test.json | 10 ++++++++++ test/engine-test.json | 9 +++++++++ 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/readme.md b/readme.md index 62373d5..9582d5f 100644 --- a/readme.md +++ b/readme.md @@ -39,7 +39,7 @@ JavaScript library to detect Browser, Engine, OS, CPU, and Device type/model fro BIDUBrowser, Baidu, Basilisk, Blazer, Bolt, Brave, Bowser, Camino, Chimera, Chrome Headless, Chrome WebView, Chrome, Chromium, Comodo Dragon, Dillo, Dolphin, Doris, Edge, Electron, Epiphany, Facebook, Falkon, Fennec, Firebird, -Firefox, Flock, GSA, GoBrowser, ICE Browser, IE, IEMobile, IceApe, IceCat, +Firefox, Flock, Flow, GSA, GoBrowser, ICE Browser, IE, IEMobile, IceApe, IceCat, IceDragon, Iceape, Iceweasel, Instagram, Iridium, Iron, Jasmine, K-Meleon, Kindle, Konqueror, LBBROWSER, Line, Links, Lunascape, Lynx, MIUI Browser, Maemo Browser, Maemo, Maxthon, MetaSr Midori, Minimo, Mobile Safari, Mosaic, @@ -75,7 +75,7 @@ Sony[Ericsson], Sprint, Vivo, Vodafone, Xbox, Xiaomi, Zebra, ZTE, ... ```sh # Possible 'engine.name' -Amaya, Blink, EdgeHTML, Gecko, Goanna, iCab, KHTML, Links, Lynx, NetFront, +Amaya, Blink, EdgeHTML, Flow, Gecko, Goanna, iCab, KHTML, Links, Lynx, NetFront, NetSurf, Presto, Tasman, Trident, w3m, WebKit # 'engine.version' determined dynamically diff --git a/src/ua-parser.js b/src/ua-parser.js index ed14fe9..3e5f0ac 100755 --- a/src/ua-parser.js +++ b/src/ua-parser.js @@ -321,6 +321,7 @@ // Gecko based /(navigator|netscape)\/([\w\.-]+)/i // Netscape ], [[NAME, 'Netscape'], VERSION], [ + /ekiohf.+(flow)\/([\w\.]+)/i, // Flow /(swiftfox)/i, // Swiftfox /(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i, // IceDragon/Iceweasel/Camino/Chimera/Fennec/Maemo/Minimo/Conkeror @@ -663,8 +664,8 @@ ], [VERSION, [NAME, 'Blink']], [ /(presto)\/([\w\.]+)/i, // Presto - /(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i, - // WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m/Goanna + /(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i, // WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m/Goanna + /ekioh(flow)\/([\w\.]+)/i, // Flow /(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i, // KHTML/Tasman/Links /(icab)[\/\s]([23]\.[\d\.]+)/i // iCab ], [NAME, VERSION], [ diff --git a/test/browser-test.json b/test/browser-test.json index 3b38881..99f9d08 100644 --- a/test/browser-test.json +++ b/test/browser-test.json @@ -289,6 +289,16 @@ "major" : "1" } }, + { + "desc" : "Flow", + "ua" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_0) EkiohFlow/5.7.4.30559 Flow/5.7.4 (like Gecko Firefox/53.0 rv:53.0)", + "expect" : + { + "name" : "Flow", + "version" : "5.7.4", + "major" : "5" + } + }, { "desc" : "Waterfox", "ua" : "Mozilla/5.0 (X11; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.2.2 Waterfox/55.2.2", diff --git a/test/engine-test.json b/test/engine-test.json index 9f54d31..0630338 100644 --- a/test/engine-test.json +++ b/test/engine-test.json @@ -17,6 +17,15 @@ "version" : "12.0" } }, + { + "desc" : "Flow", + "ua" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_0) EkiohFlow/5.7.4.30559 Flow/5.7.4 (like Gecko Firefox/53.0 rv:53.0)", + "expect" : + { + "name" : "Flow", + "version" : "5.7.4.30559" + } + }, { "desc" : "Gecko", "ua" : "Mozilla/5.0 (X11; Linux x86_64; rv:2.0b9pre) Gecko/20110111 Firefox/4.0b9pre",