Add new Webkit Opera

This commit is contained in:
Faisal Salman 2013-03-05 21:05:38 +07:00
parent 40ac5c5bc3
commit 615d6a2034
5 changed files with 20 additions and 5 deletions

View File

@ -1,7 +1,7 @@
{ {
"title": "UA-Parser.JS", "title": "UA-Parser.JS",
"name": "ua-parser-js", "name": "ua-parser-js",
"version": "0.5.14", "version": "0.5.15",
"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": [

10
test.js
View File

@ -462,6 +462,16 @@ var browsers = [
major : '11' major : '11'
} }
}, },
{
desc : 'Opera Webkit',
ua : 'Mozilla/5.0 AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.123 Mobile Safari/537.22 OPR/14.0.1025.52315',
expect :
{
name : 'Opera',
version : '14.0.1025.52315',
major : '14'
}
},
{ {
desc : 'Opera Mini', desc : 'Opera Mini',
ua : 'Opera/9.80 (J2ME/MIDP; Opera Mini/5.1.21214/19.916; U; en) Presto/2.5.25', ua : 'Opera/9.80 (J2ME/MIDP; Opera Mini/5.1.21214/19.916; U; en) Presto/2.5.25',

View File

@ -1,7 +1,7 @@
{ {
"title": "UA-Parser.JS", "title": "UA-Parser.JS",
"name": "ua-parser-js", "name": "ua-parser-js",
"version": "0.5.14", "version": "0.5.15",
"description": "Lightweight JavaScript-based user-agent string parser", "description": "Lightweight JavaScript-based user-agent string parser",
"keywords": [ "keywords": [
"user-agent", "user-agent",

View File

@ -1,4 +1,4 @@
// UA-Parser.JS v0.5.14 // UA-Parser.JS v0.5.15
// 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
// //
@ -157,6 +157,11 @@
/(opera).+version\/((\d+)?[\w\.]+)/i, // Opera > 9.80 /(opera).+version\/((\d+)?[\w\.]+)/i, // Opera > 9.80
/(opera)[\/\s]+((\d+)?[\w\.]+)/i, // Opera < 9.80 /(opera)[\/\s]+((\d+)?[\w\.]+)/i, // Opera < 9.80
], [NAME, VERSION, MAJOR], [
/\s(opr)\/((\d+)?[\w\.]+)/i // Opera Webkit
], [[NAME, 'Opera'], VERSION, MAJOR], [
// Mixed // Mixed
/(kindle)\/((\d+)?[\w\.]+)/i, // Kindle /(kindle)\/((\d+)?[\w\.]+)/i, // Kindle
/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?((\d+)?[\w\.]+)*/i, /(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?((\d+)?[\w\.]+)*/i,

4
ua-parser.min.js vendored

File diff suppressed because one or more lines are too long