Test for Firefox UAs, add new browser: Klar, add new OS: Maemo

Source: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent/Firefox
This commit is contained in:
Faisal Salman 2021-04-08 22:33:23 +07:00
parent 9200e53787
commit c39590b673
6 changed files with 211 additions and 21 deletions

View File

@ -41,7 +41,7 @@ Chrome Headless, Chrome WebView, Chrome, Chromium, Comodo Dragon, Dillo,
Dolphin, Doris, Edge, Electron, Epiphany, Facebook, Falkon, Fennec, Firebird, Dolphin, Doris, Edge, Electron, Epiphany, Facebook, Falkon, Fennec, Firebird,
Firefox [Reality], Flock, Flow, GSA, GoBrowser, ICE Browser, IE, IEMobile, IceApe, Firefox [Reality], Flock, Flow, GSA, GoBrowser, ICE Browser, IE, IEMobile, IceApe,
IceCat, IceDragon, Iceweasel, Instagram, Iridium, Iron, Jasmine, K-Meleon, IceCat, IceDragon, Iceweasel, Instagram, Iridium, Iron, Jasmine, K-Meleon,
Kindle, Konqueror, LBBROWSER, Line, Links, Lunascape, Lynx, MIUI Browser, Kindle, Klar, Konqueror, LBBROWSER, Line, Links, Lunascape, Lynx, MIUI Browser,
Maemo Browser, Maemo, Maxthon, MetaSr Midori, Minimo, Mobile Safari, Mosaic, Maemo Browser, Maemo, Maxthon, MetaSr Midori, Minimo, Mobile Safari, Mosaic,
Mozilla, NetFront, NetSurf, Netfront, Netscape, NokiaBrowser, Oculus Browser, Mozilla, NetFront, NetSurf, Netfront, Netscape, NokiaBrowser, Oculus Browser,
OmniWeb, Opera Coast, Opera [Mini/Mobi/Tablet], PaleMoon, PhantomJS, Phoenix, OmniWeb, Opera Coast, Opera [Mini/Mobi/Tablet], PaleMoon, PhantomJS, Phoenix,
@ -88,11 +88,11 @@ NetSurf, Presto, Tasman, Trident, w3m, WebKit
# Possible 'os.name' # Possible 'os.name'
AIX, Amiga OS, Android, Arch, Bada, BeOS, BlackBerry, CentOS, Chromium OS, AIX, Amiga OS, Android, Arch, Bada, BeOS, BlackBerry, CentOS, Chromium OS,
Contiki, Fedora, Firefox OS, FreeBSD, Debian, DragonFly, Fuchsia, Gentoo, GNU, Contiki, Fedora, Firefox OS, FreeBSD, Debian, DragonFly, Fuchsia, Gentoo, GNU,
Haiku, Hurd, iOS, Joli, KaiOS, Linpus, Linux, Mac OS, Mageia, Mandriva, MeeGo, Haiku, Hurd, iOS, Joli, KaiOS, Linpus, Linux, Mac OS, Maemo, Mageia, Mandriva,
Minix, Mint, Morph OS, NetBSD, Nintendo, OpenBSD, OpenVMS, OS/2, Palm, PC-BSD, MeeGo, Minix, Mint, Morph OS, NetBSD, Nintendo, OpenBSD, OpenVMS, OS/2, Palm,
PCLinuxOS, Plan9, PlayStation, QNX, Raspbian, RedHat, RIM Tablet OS, RISC OS, PC-BSD, PCLinuxOS, Plan9, PlayStation, QNX, Raspbian, RedHat, RIM Tablet OS,
Sailfish, Series40, Slackware, Solaris, SUSE, Symbian, Tizen, Ubuntu, Unix, RISC OS, Sailfish, Series40, Slackware, Solaris, SUSE, Symbian, Tizen, Ubuntu,
VectorLinux, WebOS, Windows [Phone/Mobile], Zenwalk, ... Unix, VectorLinux, WebOS, Windows [Phone/Mobile], Zenwalk, ...
# 'os.version' determined dynamically # 'os.version' determined dynamically
``` ```

View File

@ -323,8 +323,8 @@
], [VERSION, [NAME, FIREFOX+' Reality']], [ ], [VERSION, [NAME, FIREFOX+' Reality']], [
/ekiohf.+(flow)\/([\w\.]+)/i, // Flow /ekiohf.+(flow)\/([\w\.]+)/i, // Flow
/(swiftfox)/i, // Swiftfox /(swiftfox)/i, // Swiftfox
/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i, /(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/\s]?([\w\.\+]+)/i,
// IceDragon/Iceweasel/Camino/Chimera/Fennec/Maemo/Minimo/Conkeror // IceDragon/Iceweasel/Camino/Chimera/Fennec/Maemo/Minimo/Conkeror/Klar
/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([\w\.-]+)$/i, /(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([\w\.-]+)$/i,
// Firefox/SeaMonkey/K-Meleon/IceCat/IceApe/Firebird/Phoenix // Firefox/SeaMonkey/K-Meleon/IceCat/IceApe/Firebird/Phoenix
/(firefox)\/([\w\.]+)/i, // Other Firefox-based /(firefox)\/([\w\.]+)/i, // Other Firefox-based
@ -626,7 +626,7 @@
], [MODEL, [VENDOR, 'Sharp'], [TYPE, SMARTTV]], [ ], [MODEL, [VENDOR, 'Sharp'], [TYPE, SMARTTV]], [
/hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i // HbbTV devices /hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i // HbbTV devices
], [[VENDOR, trim], [MODEL, trim], [TYPE, SMARTTV]], [ ], [[VENDOR, trim], [MODEL, trim], [TYPE, SMARTTV]], [
/[\s\/\(](android |smart[-\s]?|opera )tv[;\)\s]/i // SmartTV from Unidentified Vendors /\b(android tv|smart[-\s]?tv|opera tv|tv; rv:)\b/i // SmartTV from Unidentified Vendors
], [[TYPE, SMARTTV]], [ ], [[TYPE, SMARTTV]], [
/////////////////// ///////////////////
@ -655,13 +655,12 @@
], [MODEL, [TYPE, MOBILE]], [ ], [MODEL, [TYPE, MOBILE]], [
/droid .+?;\s([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i // Android Tablets from Unidentified Vendors /droid .+?;\s([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i // Android Tablets from Unidentified Vendors
], [MODEL, [TYPE, TABLET]], [ ], [MODEL, [TYPE, TABLET]], [
/\b(tablet|tab)[;\/]/i, // Unidentifiable Tablet /\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i, // Unidentifiable Tablet
/\b(mobile)(?:[;\/]| safari)/i // Unidentifiable Mobile ], [[TYPE, TABLET]], [
], [[TYPE, lowerize]], [ /(phone|mobile(?:[;\/]| safari))/i // Unidentifiable Mobile
], [[TYPE, MOBILE]], [
/(android[\w\.\s\-]{0,9});.+buil/i // Generic Android Device /(android[\w\.\s\-]{0,9});.+buil/i // Generic Android Device
], [MODEL, [VENDOR, 'Generic']], [ ], [MODEL, [VENDOR, 'Generic']]
/(phone)/i
], [[TYPE, MOBILE]]
], ],
engine : [[ engine : [[
@ -690,7 +689,7 @@
], [NAME, VERSION], [ ], [NAME, VERSION], [
/(windows) nt 6\.2; (arm)/i, // Windows RT /(windows) nt 6\.2; (arm)/i, // Windows RT
/(windows phone(?: os)*)[\s\/]?([\d\.\s\w]*)/i, // Windows Phone /(windows phone(?: os)*)[\s\/]?([\d\.\s\w]*)/i, // Windows Phone
/(windows mobile|windows)[\s\/]?([ntce\d\.\s]+\w)(?!.+xbox)/i /(windows mobile|windows)[\s\/]?([ntce\d\.\s]+[\w\.]+)(?!.+xbox)/i
], [NAME, [VERSION, strMapper, windowsVersionMap]], [ ], [NAME, [VERSION, strMapper, windowsVersionMap]], [
/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i /(win(?=3|9|n)|win 9x )([nt\d\.]+)/i
], [[NAME, 'Windows'], [VERSION, strMapper, windowsVersionMap]], [ ], [[NAME, 'Windows'], [VERSION, strMapper, windowsVersionMap]], [
@ -703,8 +702,8 @@
/(macintosh|mac(?=_powerpc) )(?!.+haiku)/i // Mac OS /(macintosh|mac(?=_powerpc) )(?!.+haiku)/i // Mac OS
], [[NAME, 'Mac OS'], [VERSION, /_/g, '.']], [ ], [[NAME, 'Mac OS'], [VERSION, /_/g, '.']], [
// Mobile OSes // Android/WebOS/Palm/QNX/Bada/RIM/MeeGo/Contiki/Sailfish OS // Mobile OSes // Android/WebOS/Palm/QNX/Bada/RIM/Maemo/MeeGo/Contiki/Sailfish OS
/(android|webos|palm os|qnx|bada|rim tablet os|meego|sailfish|contiki)[\/\s-]?([\w\.]*)/i, /(android|webos|palm os|qnx|bada|rim tablet os|maemo|meego|sailfish|contiki)[\/\s-]?([\w\.]*)/i,
/(blackberry)\w*\/([\w\.]*)/i, // Blackberry /(blackberry)\w*\/([\w\.]*)/i, // Blackberry
/(tizen|kaios)[\/\s]([\w\.]+)/i, // Tizen/KaiOS /(tizen|kaios)[\/\s]([\w\.]+)/i, // Tizen/KaiOS
/\((series40);/i // Series 40 /\((series40);/i // Series 40
@ -713,8 +712,8 @@
], [VERSION, [NAME, BLACKBERRY]], [ ], [VERSION, [NAME, BLACKBERRY]], [
/(?:symbian\s?os|symbos|s60(?=;)|series60)[\/\s-]?([\w\.]*)/i // Symbian /(?:symbian\s?os|symbos|s60(?=;)|series60)[\/\s-]?([\w\.]*)/i // Symbian
], [VERSION, [NAME, 'Symbian']], [ ], [VERSION, [NAME, 'Symbian']], [
/mozilla.+\(mobile;.+gecko.+firefox/i // Firefox OS /mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w\s]+); rv:.+ gecko\/([\w\.]+)/i // Firefox OS
], [[NAME, FIREFOX+' OS']], [ ], [VERSION, [NAME, FIREFOX+' OS']], [
/web0s;.+rt(tv)/i, /web0s;.+rt(tv)/i,
/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i // WebOS /\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i // WebOS
], [VERSION, [NAME, 'webOS']], [ ], [VERSION, [NAME, 'webOS']], [

View File

@ -159,6 +159,16 @@
"major" : "2" "major" : "2"
} }
}, },
{
"desc" : "Camino on Mac",
"ua" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:2.0.1) Gecko/20100101 Firefox/4.0.1 Camino/2.2.1",
"expect" :
{
"name" : "Camino",
"version" : "2.2.1",
"major" : "2"
}
},
{ {
"desc" : "Chimera", "desc" : "Chimera",
"ua" : "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; pl-PL; rv:1.0.1) Gecko/20021111 Chimera/0.6", "ua" : "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; pl-PL; rv:1.0.1) Gecko/20021111 Chimera/0.6",
@ -429,6 +439,16 @@
"major" : "1" "major" : "1"
} }
}, },
{
"desc" : "Firefox for Maemo (Nokia N900)",
"ua" : "Mozilla/5.0 (Maemo; Linux armv7l; rv:10.0.1) Gecko/20100101 Firefox/10.0.1 Fennec/10.0.1",
"expect" :
{
"name" : "Fennec",
"version" : "10.0.1",
"major" : "10"
}
},
{ {
"desc": "Firefox Focus", "desc": "Firefox Focus",
"ua": "Mozilla/5.0 (Linux; Android 7.0) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Focus/6.1.1 Chrome/68.0.3440.91 Mobile Safari/537.36", "ua": "Mozilla/5.0 (Linux; Android 7.0) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Focus/6.1.1 Chrome/68.0.3440.91 Mobile Safari/537.36",
@ -958,6 +978,16 @@
"major" : "2" "major" : "2"
} }
}, },
{
"desc" : "SeaMonkey on Mac",
"ua" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:10.0.1) Gecko/20100101 Firefox/10.0.1 SeaMonkey/2.7.1",
"expect" :
{
"name" : "SeaMonkey",
"version" : "2.7.1",
"major" : "2"
}
},
{ {
"desc" : "Silk Browser", "desc" : "Silk Browser",
"ua" : "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us; Silk/1.1.0-84)", "ua" : "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us; Silk/1.1.0-84)",
@ -1228,6 +1258,16 @@
"major" : "1" "major" : "1"
} }
}, },
{
"desc" : "Firefox iOS using iPad",
"ua" : "Mozilla/5.0 (iPad; CPU iPhone OS 8_3 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) FxiOS/1.0 Mobile/12F69 Safari/600.1.4",
"expect" :
{
"name" : "Firefox",
"version" : "1.0",
"major" : "1"
}
},
{ {
"desc" : "QQ on iOS", "desc" : "QQ on iOS",
"ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 10_0_2 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) Mobile/14A456 QQ/6.5.3.410 V1_IPH_SQ_6.5.3_1_APP_A Pixel/1080 Core/UIWebView NetType/WIFI Mem/26", "ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 10_0_2 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) Mobile/14A456 QQ/6.5.3.410 V1_IPH_SQ_6.5.3_1_APP_A Pixel/1080 Core/UIWebView NetType/WIFI Mem/26",

View File

@ -79,6 +79,14 @@
"architecture" : "arm" "architecture" : "arm"
} }
}, },
{
"desc" : "Nokia N900 Linux mobile",
"ua" : "Mozilla/5.0 (Maemo; Linux armv7l; rv:10.0) Gecko/20100101 Firefox/10.0 Fennec/10.0",
"expect" :
{
"architecture" : "arm"
}
},
{ {
"desc" : "ARMEABI", "desc" : "ARMEABI",
"ua" : "[FBAN/FB4A;FBAV/237.0.0.44.120;FBBV/170693408;FBDM/{density=1.75,width=720,height=1280};FBLC/en_US;FBRV/172067074;FBCR/ ;FBMF/samsung;FBBD/samsung;FBPN/com.facebook.katana;FBDV/SM-S367VL;FBSV/9;FBBK/1;FBOP/19;FBCA/armeabi-v7a:armeabi;]", "ua" : "[FBAN/FB4A;FBAV/237.0.0.44.120;FBBV/170693408;FBDM/{density=1.75,width=720,height=1280};FBLC/en_US;FBRV/172067074;FBCR/ ;FBMF/samsung;FBBD/samsung;FBPN/com.facebook.katana;FBDV/SM-S367VL;FBSV/9;FBBK/1;FBOP/19;FBCA/armeabi-v7a:armeabi;]",
@ -135,6 +143,14 @@
"architecture" : "ppc" "architecture" : "ppc"
} }
}, },
{
"desc" : "Mac OS X on PowerPC using Firefox",
"ua" : "Mozilla/5.0 (Macintosh; PPC Mac OS X x.y; rv:10.0) Gecko/20100101 Firefox/10.0",
"expect" :
{
"architecture" : "ppc"
}
},
{ {
"desc" : "UltraSPARC", "desc" : "UltraSPARC",
"ua" : "Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.9b5) Gecko/2008032620 Firefox/3.0b5", "ua" : "Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.9b5) Gecko/2008032620 Firefox/3.0b5",

View File

@ -2442,5 +2442,77 @@
"model": "V1916A", "model": "V1916A",
"type": "mobile" "type": "mobile"
} }
},
{
"desc": "Unknown Mobile using Firefox",
"ua": "Mozilla/5.0 (Android 4.4; Mobile; rv:41.0) Gecko/41.0 Firefox/41.0",
"expect": {
"vendor": "undefined",
"model": "undefined",
"type": "mobile"
}
},
{
"desc": "Unknown Tablet using Firefox",
"ua": "Mozilla/5.0 (Android 4.4; Tablet; rv:41.0) Gecko/41.0 Firefox/41.0",
"expect": {
"vendor": "undefined",
"model": "undefined",
"type": "tablet"
}
},
{
"desc": "Unknown Mobile using Focus for Android",
"ua": "Mozilla/5.0 (Linux; Android 7.0) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Focus/1.0 Chrome/59.0.3029.83 Mobile Safari/537.36",
"expect": {
"vendor": "undefined",
"model": "undefined",
"type": "mobile"
}
},
{
"desc": "Unknown Tablet using Focus for Android",
"ua": "Mozilla/5.0 (Linux; Android 7.0) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Focus/1.0 Chrome/59.0.3029.83 Safari/537.36",
"expect": {
"vendor": "undefined",
"model": "undefined",
"type": "tablet"
}
},
{
"desc": "Unknown Device using Focus for Android with GeckoView",
"ua": "Mozilla/5.0 (Android 7.0; Mobile; rv:62.0) Gecko/62.0 Firefox/62.0",
"expect": {
"vendor": "undefined",
"model": "undefined",
"type": "mobile"
}
},
{
"desc": "Unknown Mobile using Firefox OS",
"ua": "Mozilla/5.0 (Mobile; rv:26.0) Gecko/26.0 Firefox/26.0",
"expect": {
"vendor": "undefined",
"model": "undefined",
"type": "mobile"
}
},
{
"desc": "Unknown Tablet using Firefox OS",
"ua": "Mozilla/5.0 (Tablet; rv:26.0) Gecko/26.0 Firefox/26.0",
"expect": {
"vendor": "undefined",
"model": "undefined",
"type": "tablet"
}
},
{
"desc": "Unknown TV using Firefox OS",
"ua": "Mozilla/5.0 (TV; rv:44.0) Gecko/44.0 Firefox/44.0",
"expect": {
"vendor": "undefined",
"model": "undefined",
"type": "smarttv"
}
} }
] ]

View File

@ -134,6 +134,24 @@
"version" : "8.0" "version" : "8.0"
} }
}, },
{
"desc" : "Windows NT on x86 or aarch64 CPU using Firefox",
"ua" : "Mozilla/5.0 (Windows NT x.y; rv:10.0) Gecko/20100101 Firefox/10.0",
"expect" :
{
"name" : "Windows",
"version" : "NT x.y"
}
},
{
"desc" : "Windows NT on x64 CPU using Firefox",
"ua" : "Mozilla/5.0 (Windows NT x.y; Win64; x64; rv:10.0) Gecko/20100101 Firefox/10.0",
"expect" :
{
"name" : "Windows",
"version" : "NT x.y"
}
},
{ {
"desc" : "BlackBerry", "desc" : "BlackBerry",
"ua" : "BlackBerry9300/5.0.0.912 Profile/MIDP-2.1 Configuration/CLDC-1.1 VendorID/378", "ua" : "BlackBerry9300/5.0.0.912 Profile/MIDP-2.1 Configuration/CLDC-1.1 VendorID/378",
@ -278,6 +296,15 @@
"version" : "2.1.0" "version" : "2.1.0"
} }
}, },
{
"desc" : "Nokia N900 Linux mobile, on the Fennec browser",
"ua" : "Mozilla/5.0 (Maemo; Linux armv7l; rv:10.0) Gecko/20100101 Firefox/10.0 Fennec/10.0",
"expect" :
{
"name" : "Maemo",
"version" : "undefined"
}
},
{ {
"desc" : "MeeGo", "desc" : "MeeGo",
"ua" : "Mozilla/5.0 (MeeGo; NokiaN9) AppleWebKit/534.13 (KHTML, like Gecko) NokiaBrowser/8.5.0 Mobile Safari/534.13", "ua" : "Mozilla/5.0 (MeeGo; NokiaN9) AppleWebKit/534.13 (KHTML, like Gecko) NokiaBrowser/8.5.0 Mobile Safari/534.13",
@ -320,7 +347,25 @@
"expect" : "expect" :
{ {
"name" : "Firefox OS", "name" : "Firefox OS",
"version" : "undefined" "version" : "14.0"
}
},
{
"desc" : "Firefox OS on Tablet",
"ua" : "Mozilla/5.0 (Tablet; rv:26.0) Gecko/26.0 Firefox/26.0",
"expect" :
{
"name" : "Firefox OS",
"version" : "26.0"
}
},
{
"desc" : "Firefox OS on TV",
"ua" : "Mozilla/5.0 (TV; rv:44.0) Gecko/44.0 Firefox/44.0",
"expect" :
{
"name" : "Firefox OS",
"version" : "44.0"
} }
}, },
{ {
@ -683,6 +728,24 @@
"version" : "undefined" "version" : "undefined"
} }
}, },
{
"desc" : "Mac OS X on x86, x86_64, or aarch64 using Firefox",
"ua" : "Mozilla/5.0 (Macintosh; Intel Mac OS X x.y; rv:10.0) Gecko/20100101 Firefox/10.0",
"expect" :
{
"name" : "Mac OS",
"version" : "x.y"
}
},
{
"desc" : "Mac OS X on PowerPC using Firefox",
"ua" : "Mozilla/5.0 (Macintosh; PPC Mac OS X x.y; rv:10.0) Gecko/20100101 Firefox/10.0",
"expect" :
{
"name" : "Mac OS",
"version" : "x.y"
}
},
{ {
"desc" : "Mac OS", "desc" : "Mac OS",
"ua" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36", "ua" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36",