Detect new IE 11 user-agent

This commit is contained in:
Faisal Salman 2013-03-26 13:22:58 +07:00
parent 84a8eedad4
commit 9cad6a0f2d
6 changed files with 20 additions and 10 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "ua-parser-js", "name": "ua-parser-js",
"version": "0.5.26", "version": "0.5.27",
"description": "Lightweight JavaScript-based user-agent string parser", "description": "Lightweight JavaScript-based user-agent string parser",
"keywords": ["user-agent", "parser", "browser", "engine", "os", "device"], "keywords": ["user-agent", "parser", "browser", "engine", "os", "device"],
"scripts": ["src/ua-parser.js"], "scripts": ["src/ua-parser.js"],

View File

@ -1,7 +1,7 @@
{ {
"title": "UAParser.js", "title": "UAParser.js",
"name": "ua-parser-js", "name": "ua-parser-js",
"version": "0.5.26", "version": "0.5.27",
"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": [

View File

@ -1,4 +1,4 @@
// UAParser.js v0.5.26 // UAParser.js v0.5.27
// 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
// //
@ -209,7 +209,7 @@
// Trident based // Trident based
/(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?((\d+)?[\w\.]*)/i, /(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?((\d+)?[\w\.]*)/i,
// Avant/IEMobile/SlimBrowser/Baidu // Avant/IEMobile/SlimBrowser/Baidu
/ms(ie)\s((\d+)?[\w\.]+)/i, // Internet Explorer /(?:ms|\()(ie)\s((\d+)?[\w\.]+)/i, // Internet Explorer
// Webkit/KHTML based // Webkit/KHTML based
/(rekonq)((?:\/)[\w\.]+)*/i, // Rekonq /(rekonq)((?:\/)[\w\.]+)*/i, // Rekonq
@ -448,7 +448,7 @@
device : this.getDevice() device : this.getDevice()
}; };
}; };
this.getUA = function() { this.getUA = function () {
return ua; return ua;
}; };
this.setUA = function (uastring) { this.setUA = function (uastring) {
@ -476,7 +476,7 @@
window.UAParser = UAParser; window.UAParser = UAParser;
// requirejs env (optional) // requirejs env (optional)
if (typeof(define) === FUNC_TYPE && define.amd) { if (typeof(define) === FUNC_TYPE && define.amd) {
define(function() { define(function () {
return UAParser; return UAParser;
}); });
} }
@ -488,7 +488,7 @@
$.ua.get = function() { $.ua.get = function() {
return parser.getUA(); return parser.getUA();
}; };
$.ua.set = function(uastring) { $.ua.set = function (uastring) {
parser.setUA(uastring); parser.setUA(uastring);
var result = parser.getResult(); var result = parser.getResult();
for (var prop in result) { for (var prop in result) {

File diff suppressed because one or more lines are too long

View File

@ -239,6 +239,16 @@
"major" : "7" "major" : "7"
} }
}, },
{
"desc" : "IE 11",
"ua" : "Mozilla/5.0 (IE 11.0; Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko",
"expect" :
{
"name" : "IE",
"version" : "11.0",
"major" : "11"
}
},
{ {
"desc" : "K-Meleon", "desc" : "K-Meleon",
"ua" : "Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.5) Gecko/20031016 K-Meleon/0.8.2", "ua" : "Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.5) Gecko/20031016 K-Meleon/0.8.2",

View File

@ -1,7 +1,7 @@
{ {
"title": "UAParser.js", "title": "UAParser.js",
"name": "ua-parser-js", "name": "ua-parser-js",
"version": "0.5.26", "version": "0.5.27",
"description": "Lightweight JavaScript-based user-agent string parser", "description": "Lightweight JavaScript-based user-agent string parser",
"keywords": [ "keywords": [
"user-agent", "user-agent",