mirror of
https://github.com/faisalman/ua-parser-js.git
synced 2025-09-27 07:58:45 +03:00
Fix issue #7
This commit is contained in:
parent
4703137b79
commit
a6610646ca
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"title": "UA-Parser.JS",
|
"title": "UA-Parser.JS",
|
||||||
"name": "ua-parser-js",
|
"name": "ua-parser-js",
|
||||||
"version": "0.4.18",
|
"version": "0.5.0",
|
||||||
"author": "Faisal Salman <fyzlman@gmail.com> (http://faisalman.com)",
|
"author": "Faisal Salman <fyzlman@gmail.com> (http://faisalman.com)",
|
||||||
"description": "Lightweight JavaScript-based user-agent string parser",
|
"description": "Lightweight JavaScript-based user-agent string parser",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
17
test.js
17
test.js
@ -1122,12 +1122,21 @@ var os = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
desc : 'iOS',
|
desc : 'iOS with Chrome',
|
||||||
ua : '',
|
ua : 'Mozilla/5.0 (iPhone; U; CPU iPhone OS 5_1_1 like Mac OS X; en) AppleWebKit/534.46.0 (KHTML, like Gecko) CriOS/19.0.1084.60 Mobile/9B206 Safari/7534.48.3',
|
||||||
expect :
|
expect :
|
||||||
{
|
{
|
||||||
name : '',
|
name : 'iOS',
|
||||||
version : ''
|
version : '5.1.1'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
desc : 'iOS with Opera Mini',
|
||||||
|
ua : 'Opera/9.80 (iPhone; Opera Mini/7.1.32694/27.1407; U; en) Presto/2.8.119 Version/11.10',
|
||||||
|
expect :
|
||||||
|
{
|
||||||
|
name : 'iOS',
|
||||||
|
version : undefined
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// UA-Parser.JS v0.4.18
|
// UA-Parser.JS v0.5.0
|
||||||
// Lightweight JavaScript-based User-Agent string parser
|
// Lightweight JavaScript-based User-Agent string parser
|
||||||
// https://github.com/faisalman/ua-parser-js
|
// https://github.com/faisalman/ua-parser-js
|
||||||
//
|
//
|
||||||
@ -329,7 +329,7 @@
|
|||||||
/\s(\w*bsd|dragonfly)\s?([\w\.]+)*/i, // FreeBSD/NetBSD/OpenBSD/DragonFly
|
/\s(\w*bsd|dragonfly)\s?([\w\.]+)*/i, // FreeBSD/NetBSD/OpenBSD/DragonFly
|
||||||
], [NAME, VERSION],[
|
], [NAME, VERSION],[
|
||||||
|
|
||||||
/(ip[honead]+).*os\s*([\w]+)*\slike\smac/i // iOS
|
/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i, // iOS
|
||||||
], [[NAME, 'iOS'], [VERSION, /_/g, '.']], [
|
], [[NAME, 'iOS'], [VERSION, /_/g, '.']], [
|
||||||
|
|
||||||
/(mac\sos\sx)\s?([\w\s\.]+\w)*/i, // Mac OS
|
/(mac\sos\sx)\s?([\w\s\.]+\w)*/i, // Mac OS
|
||||||
|
4
ua-parser.min.js
vendored
4
ua-parser.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user