Skip to content

Commit 8bea5c5

Browse files
committed
Add new Engine & Browser: Flow
1 parent 3843578 commit 8bea5c5

4 files changed

Lines changed: 24 additions & 4 deletions

File tree

readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ JavaScript library to detect Browser, Engine, OS, CPU, and Device type/model fro
3939
BIDUBrowser, Baidu, Basilisk, Blazer, Bolt, Brave, Bowser, Camino, Chimera,
4040
Chrome Headless, Chrome WebView, Chrome, Chromium, Comodo Dragon, Dillo,
4141
Dolphin, Doris, Edge, Electron, Epiphany, Facebook, Falkon, Fennec, Firebird,
42-
Firefox, Flock, GSA, GoBrowser, ICE Browser, IE, IEMobile, IceApe, IceCat,
42+
Firefox, Flock, Flow, GSA, GoBrowser, ICE Browser, IE, IEMobile, IceApe, IceCat,
4343
IceDragon, Iceape, Iceweasel, Instagram, Iridium, Iron, Jasmine, K-Meleon,
4444
Kindle, Konqueror, LBBROWSER, Line, Links, Lunascape, Lynx, MIUI Browser,
4545
Maemo Browser, Maemo, Maxthon, MetaSr Midori, Minimo, Mobile Safari, Mosaic,
@@ -75,7 +75,7 @@ Sony[Ericsson], Sprint, Vivo, Vodafone, Xbox, Xiaomi, Zebra, ZTE, ...
7575

7676
```sh
7777
# Possible 'engine.name'
78-
Amaya, Blink, EdgeHTML, Gecko, Goanna, iCab, KHTML, Links, Lynx, NetFront,
78+
Amaya, Blink, EdgeHTML, Flow, Gecko, Goanna, iCab, KHTML, Links, Lynx, NetFront,
7979
NetSurf, Presto, Tasman, Trident, w3m, WebKit
8080

8181
# 'engine.version' determined dynamically

src/ua-parser.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@
321321
// Gecko based
322322
/(navigator|netscape)\/([\w\.-]+)/i // Netscape
323323
], [[NAME, 'Netscape'], VERSION], [
324+
/ekiohf.+(flow)\/([\w\.]+)/i, // Flow
324325
/(swiftfox)/i, // Swiftfox
325326
/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,
326327
// IceDragon/Iceweasel/Camino/Chimera/Fennec/Maemo/Minimo/Conkeror
@@ -663,8 +664,8 @@
663664
], [VERSION, [NAME, 'Blink']], [
664665

665666
/(presto)\/([\w\.]+)/i, // Presto
666-
/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,
667-
// WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m/Goanna
667+
/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i, // WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m/Goanna
668+
/ekioh(flow)\/([\w\.]+)/i, // Flow
668669
/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i, // KHTML/Tasman/Links
669670
/(icab)[\/\s]([23]\.[\d\.]+)/i // iCab
670671
], [NAME, VERSION], [

test/browser-test.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,16 @@
289289
"major" : "1"
290290
}
291291
},
292+
{
293+
"desc" : "Flow",
294+
"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)",
295+
"expect" :
296+
{
297+
"name" : "Flow",
298+
"version" : "5.7.4",
299+
"major" : "5"
300+
}
301+
},
292302
{
293303
"desc" : "Waterfox",
294304
"ua" : "Mozilla/5.0 (X11; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.2.2 Waterfox/55.2.2",

test/engine-test.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@
1717
"version" : "12.0"
1818
}
1919
},
20+
{
21+
"desc" : "Flow",
22+
"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)",
23+
"expect" :
24+
{
25+
"name" : "Flow",
26+
"version" : "5.7.4.30559"
27+
}
28+
},
2029
{
2130
"desc" : "Gecko",
2231
"ua" : "Mozilla/5.0 (X11; Linux x86_64; rv:2.0b9pre) Gecko/20110111 Firefox/4.0b9pre",

0 commit comments

Comments
 (0)