From c937400e8ec5c686824875bad172a316769bed12 Mon Sep 17 00:00:00 2001 From: Faisal Salman Date: Fri, 2 Apr 2021 01:00:50 +0700 Subject: [PATCH] Add new browser: Firefox Reality --- readme.md | 14 +++++++------- src/ua-parser.js | 2 ++ test/browser-test.json | 10 ++++++++++ 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/readme.md b/readme.md index 9582d5f12..7ade87f53 100644 --- a/readme.md +++ b/readme.md @@ -39,16 +39,16 @@ 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, Flow, GSA, GoBrowser, ICE Browser, IE, IEMobile, IceApe, IceCat, -IceDragon, Iceape, Iceweasel, Instagram, Iridium, Iron, Jasmine, K-Meleon, +Firefox [Reality], Flock, Flow, GSA, GoBrowser, ICE Browser, IE, IEMobile, IceApe, +IceCat, IceDragon, 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, Mozilla, NetFront, NetSurf, Netfront, Netscape, NokiaBrowser, Oculus Browser, -OmniWeb, Opera Coast, Opera Mini, Opera Mobi, Opera Tablet, Opera, PaleMoon, -PhantomJS, Phoenix, Polaris, Puffin, QQ, QQBrowser, QQBrowserLite, Quark, -QupZilla, RockMelt, Safari, Sailfish Browser, Samsung Browser, SeaMonkey, Silk, -Skyfire, Sleipnir, Slim, SlimBrowser, Swiftfox, Tizen Browser, UCBrowser, -Vivaldi, Waterfox, WeChat, Weibo, Yandex, baidu, iCab, w3m, Whale Browser... +OmniWeb, Opera Coast, Opera [Mini/Mobi/Tablet], PaleMoon, PhantomJS, Phoenix, +Polaris, Puffin, QQ, QQBrowser, QQBrowserLite, Quark, QupZilla, RockMelt, Safari, +Sailfish Browser, Samsung Browser, SeaMonkey, Silk, Skyfire, Sleipnir, Slim, +SlimBrowser, Swiftfox, Tizen Browser, UCBrowser, Vivaldi, Waterfox, WeChat, Weibo, +Yandex, baidu, iCab, w3m, Whale Browser... # 'browser.version' determined dynamically ``` diff --git a/src/ua-parser.js b/src/ua-parser.js index 3e5f0ac4e..fb1af22ba 100755 --- a/src/ua-parser.js +++ b/src/ua-parser.js @@ -321,6 +321,8 @@ // Gecko based /(navigator|netscape)\/([\w\.-]+)/i // Netscape ], [[NAME, 'Netscape'], VERSION], [ + /ile\svr;\srv:([\w\.]+)\).+firefox/i // Firefox Reality + ], [VERSION, [NAME, 'Firefox Reality']], [ /ekiohf.+(flow)\/([\w\.]+)/i, // Flow /(swiftfox)/i, // Swiftfox /(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i, diff --git a/test/browser-test.json b/test/browser-test.json index 99f9d08ed..01d7abb58 100644 --- a/test/browser-test.json +++ b/test/browser-test.json @@ -399,6 +399,16 @@ "major" : "15" } }, + { + "desc" : "Firefox Reality", + "ua" : "Mozilla/5.0 (Android 7.1.2; Mobile VR; rv:65.0) Gecko/65.0 Firefox/65.0", + "expect" : + { + "name" : "Firefox Reality", + "version" : "65.0", + "major" : "65" + } + }, { "desc" : "Firefox-based browser", "ua" : "Mozilla/5.0 (X11; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0 AppName/1.0",