mirror of
https://github.com/faisalman/ua-parser-js.git
synced 2025-09-28 00:18:45 +03:00
Merge branch 'mobile-browsers' of https://github.com/shaharmor/ua-parser-js
This commit is contained in:
commit
08436ce4f5
16
readme.md
16
readme.md
@ -102,19 +102,19 @@ The methods are self explanatory, here's a small overview on all the available m
|
||||
# Possible 'browser.name':
|
||||
2345Explorer, 360 Browser, Amaya, Android Browser, Arora, Avant, Avast, AVG,
|
||||
BIDUBrowser, Baidu, Basilisk, Blazer, Bolt, Brave, Bowser, Camino, Chimera,
|
||||
Chrome Headless, Chrome WebView, Chrome, Chromium, Cobalt, Comodo Dragon, Dillo,
|
||||
Chrome [Mobile/Headless/WebView], Chromium, Cobalt, Comodo Dragon, Dillo,
|
||||
Dolphin, Doris, DuckDuckGo, Edge, Electron, Epiphany, Facebook, Falkon, Fennec,
|
||||
Firebird, Firefox [Focus/Reality], Flock, Flow, GSA, GoBrowser, Huawei Browser,
|
||||
ICE Browser, IE, IEMobile, IceApe, IceCat, IceDragon, Iceweasel, Instagram,
|
||||
Iridium, Iron, Jasmine, Kakao[Story/Talk], K-Meleon, Kindle, Klar, Konqueror,
|
||||
LBBROWSER, Line, LinkedIn, Links, Lunascape, Lynx, MIUI Browser, Maemo Browser,
|
||||
Maemo, Maxthon, MetaSr Midori, Minimo, Mobile Safari, Mosaic, Mozilla, NetFront,
|
||||
Firebird, Firefox [Mobile/Focus/Reality], Flock, Flow, GSA, GoBrowser,
|
||||
Huawei Browser, ICE Browser, IE, IEMobile, IceApe, IceCat, IceDragon, Iceweasel,
|
||||
Instagram, Iridium, Iron, Jasmine, Kakao[Story/Talk], K-Meleon, Kindle, Klar,
|
||||
Konqueror, LBBROWSER, Line, LinkedIn, Links, Lunascape, Lynx, MIUI Browser,
|
||||
Maemo Browser, Maemo, Maxthon, MetaSr Midori, Minimo, Mosaic, Mozilla, NetFront,
|
||||
NetSurf, Netfront, Netscape, NokiaBrowser, Obigo, Oculus Browser, OmniWeb,
|
||||
Opera Coast, Opera [Mini/Mobi/Tablet], PaleMoon, PhantomJS, Phoenix, Polaris,
|
||||
Puffin, QQ, QQBrowser, QQBrowserLite, Quark, QupZilla, RockMelt, Safari,
|
||||
Puffin, QQ, QQBrowser, QQBrowserLite, Quark, QupZilla, RockMelt, Safari [Mobile],
|
||||
Sailfish Browser, Samsung Browser, SeaMonkey, Silk, Skyfire, Sleipnir, Slim,
|
||||
SlimBrowser, Swiftfox, Tesla, Tizen Browser, UCBrowser, UP.Browser, Viera,
|
||||
Vivaldi, Waterfox, WeChat, Weibo, Yandex, baidu, iCab, w3m, Whale Browser...
|
||||
Vivaldi, Waterfox, WeChat, Weibo, Yandex, baidu, iCab, w3m, Whale Browser, ...
|
||||
|
||||
# 'browser.version' determined dynamically
|
||||
```
|
||||
|
@ -58,9 +58,8 @@
|
||||
UA_DEVICE = 'device',
|
||||
UA_ENGINE = 'engine',
|
||||
UA_OS = 'os',
|
||||
UA_RESULT = 'result';
|
||||
|
||||
var AMAZON = 'Amazon',
|
||||
UA_RESULT = 'result',
|
||||
AMAZON = 'Amazon',
|
||||
APPLE = 'Apple',
|
||||
ASUS = 'ASUS',
|
||||
BLACKBERRY = 'BlackBerry',
|
||||
@ -76,14 +75,13 @@
|
||||
XIAOMI = 'Xiaomi',
|
||||
ZEBRA = 'Zebra',
|
||||
ZTE = 'ZTE',
|
||||
|
||||
BROWSER = 'Browser',
|
||||
SUFFIX_BROWSER = 'Browser',
|
||||
SUFFIX_MOBILE = 'Mobile',
|
||||
CHROME = 'Chrome',
|
||||
EDGE = 'Edge',
|
||||
FIREFOX = 'Firefox',
|
||||
OPERA = 'Opera',
|
||||
FACEBOOK = 'Facebook',
|
||||
|
||||
WINDOWS = 'Windows';
|
||||
|
||||
var NAVIGATOR = (typeof window !== UNDEF_TYPE && window.navigator) ?
|
||||
@ -305,7 +303,7 @@
|
||||
/(weibo)__([\d\.]+)/i // Weibo
|
||||
], [NAME, VERSION], [
|
||||
/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i // UCBrowser
|
||||
], [VERSION, [NAME, 'UC'+BROWSER]], [
|
||||
], [VERSION, [NAME, 'UC'+SUFFIX_BROWSER]], [
|
||||
/microm.+\bqbcore\/([\w\.]+)/i, // WeChat Desktop for Windows Built-in Browser
|
||||
/\bqbcore\/([\w\.]+).+microm/i
|
||||
], [VERSION, [NAME, 'WeChat(Win) Desktop']], [
|
||||
@ -318,7 +316,7 @@
|
||||
/yabrowser\/([\w\.]+)/i // Yandex
|
||||
], [VERSION, [NAME, 'Yandex']], [
|
||||
/(avast|avg)\/([\w\.]+)/i // Avast/AVG Secure Browser
|
||||
], [[NAME, /(.+)/, '$1 Secure '+BROWSER], VERSION], [
|
||||
], [[NAME, /(.+)/, '$1 Secure '+SUFFIX_BROWSER], VERSION], [
|
||||
/\bfocus\/([\w\.]+)/i // Firefox Focus
|
||||
], [VERSION, [NAME, FIREFOX+' Focus']], [
|
||||
/\bopt\/([\w\.]+)/i // Opera Touch
|
||||
@ -330,13 +328,13 @@
|
||||
/coast\/([\w\.]+)/i // Opera Coast
|
||||
], [VERSION, [NAME, OPERA+' Coast']], [
|
||||
/miuibrowser\/([\w\.]+)/i // MIUI Browser
|
||||
], [VERSION, [NAME, 'MIUI '+BROWSER]], [
|
||||
/fxios\/([-\w\.]+)/i // Firefox for iOS
|
||||
], [VERSION, [NAME, FIREFOX]], [
|
||||
], [VERSION, [NAME, 'MIUI '+SUFFIX_BROWSER]], [
|
||||
/fxios\/([\w\.-]+)/i // Firefox for iOS
|
||||
], [VERSION, [NAME, 'Firefox '+SUFFIX_MOBILE]], [
|
||||
/\bqihu|(qi?ho?o?|360)browser/i // 360
|
||||
], [[NAME, '360 '+BROWSER]], [
|
||||
], [[NAME, '360 '+SUFFIX_BROWSER]], [
|
||||
/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i
|
||||
], [[NAME, /(.+)/, '$1 '+BROWSER], VERSION], [ // Oculus/Samsung/Sailfish/Huawei Browser
|
||||
], [[NAME, /(.+)/, '$1 '+SUFFIX_BROWSER], VERSION], [ // Oculus/Samsung/Sailfish/Huawei Browser
|
||||
/(comodo_dragon)\/([\w\.]+)/i // Comodo Dragon
|
||||
], [[NAME, /_/g, ' '], VERSION], [
|
||||
/(electron)\/([\w\.]+) safari/i, // Electron-based App
|
||||
@ -367,14 +365,18 @@
|
||||
], [[NAME, CHROME+' WebView'], VERSION], [
|
||||
|
||||
/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i // Android Browser
|
||||
], [VERSION, [NAME, 'Android '+BROWSER]], [
|
||||
], [VERSION, [NAME, 'Android '+SUFFIX_BROWSER]], [
|
||||
|
||||
/chrome\/([\w\.]+) mobile/i, // Chrome Mobile
|
||||
/(?:(?:android.+)crmo|crios)\/([\w\.]+)/i // Chrome for Android/iOS
|
||||
], [VERSION, [NAME, 'Chrome '+SUFFIX_MOBILE]], [
|
||||
|
||||
/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i // Chrome/OmniWeb/Arora/Tizen/Nokia
|
||||
], [NAME, VERSION], [
|
||||
|
||||
/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i // Mobile Safari
|
||||
], [VERSION, [NAME, 'Mobile Safari']], [
|
||||
/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i // Safari & Safari Mobile
|
||||
/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i // Safari Mobile
|
||||
], [VERSION, [NAME, 'Safari '+SUFFIX_MOBILE]], [
|
||||
/version\/([\w\.\,]+) .*(safari)/i // Safari
|
||||
], [VERSION, NAME], [
|
||||
/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i // Safari < 3.0
|
||||
], [NAME, [VERSION, strMapper, oldSafariMap]], [
|
||||
@ -383,6 +385,8 @@
|
||||
], [NAME, VERSION], [
|
||||
|
||||
// Gecko based
|
||||
/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i // Firefox Mobile
|
||||
], [[NAME, 'Firefox '+SUFFIX_MOBILE], VERSION], [
|
||||
/(navigator|netscape\d?)\/([-\w\.]+)/i // Netscape
|
||||
], [[NAME, 'Netscape'], VERSION], [
|
||||
/mobile vr; rv:([\w\.]+)\).+firefox/i // Firefox Reality
|
||||
|
@ -753,7 +753,7 @@
|
||||
"ua" : "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7",
|
||||
"expect" :
|
||||
{
|
||||
"name" : "Mobile Safari",
|
||||
"name" : "Safari Mobile",
|
||||
"version" : "4.0.5",
|
||||
"major" : "4"
|
||||
}
|
||||
@ -1393,7 +1393,7 @@
|
||||
"ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) FxiOS/1.1 Mobile/13B143 Safari/601.1.46",
|
||||
"expect" :
|
||||
{
|
||||
"name" : "Firefox",
|
||||
"name" : "Firefox Mobile",
|
||||
"version" : "1.1",
|
||||
"major" : "1"
|
||||
}
|
||||
@ -1403,7 +1403,7 @@
|
||||
"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",
|
||||
"name" : "Firefox Mobile",
|
||||
"version" : "1.0",
|
||||
"major" : "1"
|
||||
}
|
||||
@ -1597,7 +1597,7 @@
|
||||
"ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 15_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.6,2 Mobile/15E148 Safari/604.1",
|
||||
"expect" :
|
||||
{
|
||||
"name" : "Mobile Safari",
|
||||
"name" : "Safari Mobile",
|
||||
"version" : "15.6,2",
|
||||
"major" : "15"
|
||||
}
|
||||
@ -1682,5 +1682,35 @@
|
||||
"version": "10.25.0",
|
||||
"major" : "10"
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc" : "Chrome Mobile",
|
||||
"ua" : "Mozilla/5.0 (Linux; Android 7.1.2; Nexus 5X Build/N2G47W) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.83 Mobile Safari/537.36",
|
||||
"expect" :
|
||||
{
|
||||
"name" : "Chrome Mobile",
|
||||
"version" : "58.0.3029.83",
|
||||
"major" : "58"
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc" : "Firefox Mobile",
|
||||
"ua" : "Mozilla/5.0 (Linux; Android 7.1.2; Nexus 5X Build/N2G47W) AppleWebKit/537.36 (KHTML, like Gecko) FxiOS/7.5b3349 Mobile/14F89 Safari/603.2.4",
|
||||
"expect" :
|
||||
{
|
||||
"name" : "Firefox Mobile",
|
||||
"version" : "7.5b3349",
|
||||
"major" : "7"
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc" : "Firefox Mobile",
|
||||
"ua" : "Mozilla/5.0 (Android 5.0; Mobile; rv:41.0) Gecko/41.0 Firefox/41.0",
|
||||
"expect" :
|
||||
{
|
||||
"name" : "Firefox Mobile",
|
||||
"version" : "41.0",
|
||||
"major" : "41"
|
||||
}
|
||||
}
|
||||
]
|
Loading…
x
Reference in New Issue
Block a user