Comparing version 2.1.1 to 2.1.2
@@ -7,2 +7,5 @@ | ||
var re_msie = /\b(?:msie |ie |trident\/[0-9].*rv[ :])([0-9.]+)/; | ||
var re_blackberry_10 = /\bbb10\b.+?\bversion\/([\d.]+)/; | ||
var re_blackberry_6_7 = /\bblackberry\b.+\bversion\/([\d.]+)/; | ||
var re_blackberry_4_5 = /\bblackberry\d+\/([\d.]+)/; | ||
@@ -102,3 +105,8 @@ function toString(object){ | ||
["android", /\bandroid\b|\badr\b/], | ||
["blackberry", "blackberry"] | ||
["blackberry", function(ua){ | ||
if (ua.indexOf("blackberry") >= 0) { | ||
return /\bblackberry\s?(\d+)/; | ||
} | ||
return "bb10"; | ||
}] | ||
]; | ||
@@ -147,3 +155,8 @@ | ||
["symbian", /\bsymbian(?:os)?\/([0-9.]+)/], | ||
["blackberry", "blackberry"] | ||
["blackberry", function(ua){ | ||
var m = ua.match(re_blackberry_10) || | ||
ua.match(re_blackberry_6_7) || | ||
ua.match(re_blackberry_4_5); | ||
return m ? {version: m[1]} : "blackberry"; | ||
}] | ||
]; | ||
@@ -220,3 +233,10 @@ | ||
["webkit", /\bapplewebkit[\/]?([0-9.+]+)/], | ||
["gecko", /\bgecko\/(\d+)/], | ||
["gecko", function(ua){ | ||
var match; | ||
if (match = ua.match(/\brv:([\d\w.]+).*\bgecko\/(\d+)/)) { | ||
return { | ||
version: match[1] + "." + match[2] | ||
} | ||
} | ||
}], | ||
["presto", /\bpresto\/([0-9.]+)/], | ||
@@ -344,2 +364,8 @@ ["androidwebkit", /\bandroidwebkit\/([0-9.]+)/], | ||
}], | ||
["blackberry", function(ua){ | ||
var m = ua.match(re_blackberry_10) || | ||
ua.match(re_blackberry_6_7) || | ||
ua.match(re_blackberry_4_5); | ||
return m ? {version: m[1]} : "blackberry"; | ||
}], | ||
["safari", /\bversion\/([0-9.]+(?: beta)?)(?: mobile(?:\/[a-z0-9]+)?)? safari\//], | ||
@@ -346,0 +372,0 @@ // 如果不能被识别为 Safari,则猜测是 WebView。 |
@@ -10,3 +10,3 @@ # 演示文档 | ||
* 如果上面识别的信息不正确,<a id="issues" | ||
href="https://github.com/aralejs/detector/issues/new" | ||
href="https://github.com/hotoo/detector/issues/new" | ||
target="_blank"><strong>请给我们提 Issues 反馈</strong></a>。 | ||
@@ -153,3 +153,3 @@ * 如果没有 Github 账户,请向我们 <a id="email" href="mailto:hotoo.cn@gmail.com" | ||
document.getElementById("issues").href = "https://github.com/aralejs/detector/issues/new" + | ||
document.getElementById("issues").href = "https://github.com/hotoo/detector/issues/new" + | ||
"?title=detector%20识别信息"+ | ||
@@ -156,0 +156,0 @@ "&body=" + |
@@ -6,2 +6,6 @@ | ||
<style> | ||
table,th,td{border: 1px solid #ccc;} | ||
</style> | ||
## 输入 | ||
@@ -8,0 +12,0 @@ |
{ | ||
"name": "detector", | ||
"version": "2.1.1", | ||
"version": "2.1.2", | ||
"description": "客户端信息识别模块", | ||
@@ -5,0 +5,0 @@ "homepage": "http://spmjs.io/docs/detector/", |
@@ -185,3 +185,3 @@ # detector | ||
* `symbian`: Symbian OS. | ||
* `blackberry`: Blackberry. | ||
* `blackberry`: Blackberry 操作系统。 | ||
* `yunos`: 阿里云系统。 | ||
@@ -246,2 +246,3 @@ * `meego`: Meego. `NODE ONLY` | ||
* `nokia`: 诺基亚浏览器。 | ||
* `blackberry`: 黑莓默认浏览器,版本号与系统版本相同。 | ||
* `webview`: iOS 系统的提供的 WebView。 | ||
@@ -248,0 +249,0 @@ * `yandex`: Yandex YaBrowser. |
@@ -148,3 +148,3 @@ | ||
browser: "firefox/19.0;19.0;o", | ||
engine: "gecko/20100101;20100101;o" | ||
engine: "gecko/19.0.20100101;19.0.20100101;o" | ||
}], | ||
@@ -618,3 +618,3 @@ // Macintosh Opera. | ||
browser: "na/-1;-1;o", | ||
engine: "gecko/20060610;20060610;o" | ||
engine: "gecko/1.8.1a3.20060610;1.8.1a3.20060610;o" | ||
}], | ||
@@ -909,2 +909,34 @@ ["Mozilla/4.0 (compatible; MSIE 4.01; Windows CE; 176x220)", { | ||
engine: "webkit/534.46;534.46;o" | ||
}], | ||
// Blackberry | ||
["Mozilla/5.0 (BB10; Touch) AppleWebKit/537.10+ (KHTML, like Gecko) Version/10.1.0.4633 Mobile Safari/537.10+", | ||
{ | ||
device: "blackberry/-1", | ||
os: "blackberry/10.1.0.4633", | ||
browser: "blackberry/10.1.0.4633;10.1.0.4633;o", | ||
engine: "webkit/537.10+;537.10+;o" | ||
}], | ||
["Mozilla/5.0 (BlackBerry; U; BlackBerry 9810; en-US) AppleWebKit/534.11+ (KHTML, like Gecko) Version/7.1.0.912 Mobile Safari/534.11+", | ||
{ | ||
device: "blackberry/9810", | ||
os: "blackberry/7.1.0.912", | ||
browser: "blackberry/7.1.0.912;7.1.0.912;o", | ||
engine: "webkit/534.11+;534.11+;o" | ||
}], | ||
["BlackBerry9000/5.0.0.93 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/179", | ||
{ | ||
device: "blackberry/9000", | ||
os: "blackberry/5.0.0.93", | ||
browser: "blackberry/5.0.0.93;5.0.0.93;o", | ||
engine: "na/-1;-1;o" | ||
}], | ||
// NA | ||
["", | ||
{ | ||
device: "na/-1", | ||
os: "na/-1", | ||
browser: "na/-1;-1;o", | ||
engine: "na/-1;-1;o" | ||
}] | ||
@@ -911,0 +943,0 @@ ]; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1599
322
89392
15