Skip to content

Commit

Permalink
- update browser grades.
Browse files Browse the repository at this point in the history
- grade A now requires (minimum) Chrome 10, Firefox 4, and Opera 10
- bump minor package version
  • Loading branch information
ded committed Oct 11, 2011
1 parent ba36636 commit 62a5525
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 14 deletions.
22 changes: 16 additions & 6 deletions bowser.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* IE: "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C)"
* Firefox: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0) Gecko/20100101 Firefox/4.0"
* iPhone: "Mozilla/5.0 (iPhone Simulator; U; CPU iPhone OS 4_3_2 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8H7 Safari/6533.18.5"
* iPad: "Mozilla/5.0 (iPad; U; CPU OS 4_3_2 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8H7 Safari/6533.18.5",
* Android: "Mozilla/5.0 (Linux; U; Android 2.3.4; en-us; T-Mobile G2 Build/GRJ22) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1"
*/

Expand All @@ -25,6 +26,7 @@
, chrome = /chrome/i.test(ua)
, safari = /safari/i.test(ua) && !chrome
, iphone = /iphone/i.test(ua)
, ipad = /ipad/i.test(ua)
, android = /android/i.test(ua)
, opera = /opera/i.test(ua)
, firefox = /firefox/i.test(ua)
Expand All @@ -46,6 +48,14 @@
webkit: t
, iphone: t
, mobile: t
, ios: t
, version: ua.match(webkitVersion)[1]
}
if (ipad) return {
webkit: t
, ipad: t
, mobile: t
, ios: t
, version: ua.match(webkitVersion)[1]
}
if (android) return {
Expand Down Expand Up @@ -79,18 +89,18 @@
// Graded Browser Support
// http://developer.yahoo.com/yui/articles/gbs
if ((bowser.msie && bowser.version >= 6) ||
(bowser.chrome && bowser.version >= 8) ||
(bowser.firefox && bowser.version >= 3.6) ||
(bowser.chrome && bowser.version >= 10) ||
(bowser.firefox && bowser.version >= 4.0) ||
(bowser.safari && bowser.version >= 5) ||
(bowser.opera && bowser.version >= 9.5)) {
(bowser.opera && bowser.version >= 10.0)) {
bowser.a = t;
}

else if ((bowser.msie && bowser.version < 6) ||
(bowser.chrome && bowser.version < 8) ||
(bowser.firefox && bowser.version < 3.6) ||
(bowser.chrome && bowser.version < 10) ||
(bowser.firefox && bowser.version < 4.0) ||
(bowser.safari && bowser.version < 5) ||
(bowser.opera && bowser.version < 9.5)) {
(bowser.opera && bowser.version < 10.0)) {
bowser.c = t
} else bowser.x = t

Expand Down
2 changes: 1 addition & 1 deletion bowser.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "bowser"
, "description": "a browser detector"
, "keywords": ["ender", "browser", "sniff", "detection"]
, "version": "0.0.7"
, "version": "0.0.8"
, "homepage": "https://github.com/ded/bowser"
, "author": "Dustin Diaz <[email protected]> (http://dustindiaz.com)"
, "main": "./bowser.js"
Expand Down
12 changes: 6 additions & 6 deletions src/bowser.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,18 @@
// Graded Browser Support
// http://developer.yahoo.com/yui/articles/gbs
if ((bowser.msie && bowser.version >= 6) ||
(bowser.chrome && bowser.version >= 8) ||
(bowser.firefox && bowser.version >= 3.6) ||
(bowser.chrome && bowser.version >= 10) ||
(bowser.firefox && bowser.version >= 4.0) ||
(bowser.safari && bowser.version >= 5) ||
(bowser.opera && bowser.version >= 9.5)) {
(bowser.opera && bowser.version >= 10.0)) {
bowser.a = t;
}

else if ((bowser.msie && bowser.version < 6) ||
(bowser.chrome && bowser.version < 8) ||
(bowser.firefox && bowser.version < 3.6) ||
(bowser.chrome && bowser.version < 10) ||
(bowser.firefox && bowser.version < 4.0) ||
(bowser.safari && bowser.version < 5) ||
(bowser.opera && bowser.version < 9.5)) {
(bowser.opera && bowser.version < 10.0)) {
bowser.c = t
} else bowser.x = t

Expand Down

0 comments on commit 62a5525

Please sign in to comment.