mirror of
https://github.com/lancedikson/bowser
synced 2024-10-27 20:34:22 +00:00
- add touchpad support
- upgrade graded support
This commit is contained in:
parent
f381b9373b
commit
975a408f15
@ -101,7 +101,7 @@
|
||||
|
||||
// Graded Browser Support
|
||||
// http://developer.yahoo.com/yui/articles/gbs
|
||||
if ((bowser.msie && bowser.version >= 6) ||
|
||||
if ((bowser.msie && bowser.version >= 7) ||
|
||||
(bowser.chrome && bowser.version >= 10) ||
|
||||
(bowser.firefox && bowser.version >= 4.0) ||
|
||||
(bowser.safari && bowser.version >= 5) ||
|
||||
@ -109,7 +109,7 @@
|
||||
bowser.a = t;
|
||||
}
|
||||
|
||||
else if ((bowser.msie && bowser.version < 6) ||
|
||||
else if ((bowser.msie && bowser.version < 7) ||
|
||||
(bowser.chrome && bowser.version < 10) ||
|
||||
(bowser.firefox && bowser.version < 4.0) ||
|
||||
(bowser.safari && bowser.version < 5) ||
|
||||
|
2
bowser.min.js
vendored
2
bowser.min.js
vendored
@ -3,4 +3,4 @@
|
||||
* https://github.com/ded/bowser
|
||||
* MIT License | (c) Dustin Diaz 2011
|
||||
*/
|
||||
!function(a,b){if(typeof define=="function"){define(b)}else{if(typeof module!="undefined"&&module.exports){module.exports.browser=b()}else{this[a]=b()}}}("bowser",function(){var d=navigator.userAgent,r=true,b=/msie/i.test(d),l=/chrome/i.test(d),c=/safari/i.test(d)&&!l,p=/iphone/i.test(d),q=/ipad/i.test(d),n=/touchpad/i.test(d),i=/android/i.test(d),j=/opera/i.test(d),m=/firefox/i.test(d),h=/gecko\//i.test(d),f=/seamonkey\//i.test(d),a=/version\/(\d+(\.\d+)?)/i,g;function e(){if(b){return{msie:r,version:d.match(/msie (\d+(\.\d+)?);/i)[1]}}if(l){return{webkit:r,chrome:r,version:d.match(/chrome\/(\d+(\.\d+)?)/i)[1]}}if(n){return{webkit:r,touchpad:r,version:d.match(/touchpad\/(\d+(\.\d+)?)/i)[1]}}if(p||q){g={webkit:r,mobile:r,ios:r,iphone:p,ipad:q};if(a.test(d)){g.version=d.match(a)[1]}return g}if(i){return{webkit:r,android:r,mobile:r,version:d.match(a)[1]}}if(c){return{webkit:r,safari:r,version:d.match(a)[1]}}if(j){return{opera:r,version:d.match(a)[1]}}if(h){g={gecko:r,mozilla:r,version:d.match(/firefox\/(\d+(\.\d+)?)/i)[1]};if(m){g.firefox=r}return g}if(f){return{seamonkey:r,version:d.match(/seamonkey\/(\d+(\.\d+)?)/i)[1]}}}var k=e();if((k.msie&&k.version>=6)||(k.chrome&&k.version>=10)||(k.firefox&&k.version>=4)||(k.safari&&k.version>=5)||(k.opera&&k.version>=10)){k.a=r}else{if((k.msie&&k.version<6)||(k.chrome&&k.version<10)||(k.firefox&&k.version<4)||(k.safari&&k.version<5)||(k.opera&&k.version<10)){k.c=r}else{k.x=r}}return k});
|
||||
!function(a,b){typeof define=="function"?define(b):typeof module!="undefined"&&module.exports?module.exports.browser=b():this[a]=b()}("bowser",function(){function p(){if(c)return{msie:b,version:a.match(/msie (\d+(\.\d+)?);/i)[1]};if(d)return{webkit:b,chrome:b,version:a.match(/chrome\/(\d+(\.\d+)?)/i)[1]};if(h)return{webkit:b,touchpad:b,version:a.match(/touchpad\/(\d+(\.\d+)?)/i)[1]};if(f||g){o={webkit:b,mobile:b,ios:b,iphone:f,ipad:g},n.test(a)&&(o.version=a.match(n)[1]);return o}if(i)return{webkit:b,android:b,mobile:b,version:a.match(n)[1]};if(e)return{webkit:b,safari:b,version:a.match(n)[1]};if(j)return{opera:b,version:a.match(n)[1]};if(l){o={gecko:b,mozilla:b,version:a.match(/firefox\/(\d+(\.\d+)?)/i)[1]},k&&(o.firefox=b);return o}if(m)return{seamonkey:b,version:a.match(/seamonkey\/(\d+(\.\d+)?)/i)[1]}}var a=navigator.userAgent,b=!0,c=/msie/i.test(a),d=/chrome/i.test(a),e=/safari/i.test(a)&&!d,f=/iphone/i.test(a),g=/ipad/i.test(a),h=/touchpad/i.test(a),i=/android/i.test(a),j=/opera/i.test(a),k=/firefox/i.test(a),l=/gecko\//i.test(a),m=/seamonkey\//i.test(a),n=/version\/(\d+(\.\d+)?)/i,o,q=p();q.msie&&q.version>=7||q.chrome&&q.version>=10||q.firefox&&q.version>=4||q.safari&&q.version>=5||q.opera&&q.version>=10?q.a=b:q.msie&&q.version<7||q.chrome&&q.version<10||q.firefox&&q.version<4||q.safari&&q.version<5||q.opera&&q.version<10?q.c=b:q.x=b;return q})
|
@ -2,7 +2,7 @@
|
||||
"name": "bowser"
|
||||
, "description": "a browser detector"
|
||||
, "keywords": ["ender", "browser", "sniff", "detection"]
|
||||
, "version": "0.1.0"
|
||||
, "version": "0.2.0"
|
||||
, "homepage": "https://github.com/ded/bowser"
|
||||
, "author": "Dustin Diaz <dustin@dustindiaz.com> (http://dustindiaz.com)"
|
||||
, "main": "./bowser.js"
|
||||
|
@ -96,7 +96,7 @@
|
||||
|
||||
// Graded Browser Support
|
||||
// http://developer.yahoo.com/yui/articles/gbs
|
||||
if ((bowser.msie && bowser.version >= 6) ||
|
||||
if ((bowser.msie && bowser.version >= 7) ||
|
||||
(bowser.chrome && bowser.version >= 10) ||
|
||||
(bowser.firefox && bowser.version >= 4.0) ||
|
||||
(bowser.safari && bowser.version >= 5) ||
|
||||
@ -104,7 +104,7 @@
|
||||
bowser.a = t;
|
||||
}
|
||||
|
||||
else if ((bowser.msie && bowser.version < 6) ||
|
||||
else if ((bowser.msie && bowser.version < 7) ||
|
||||
(bowser.chrome && bowser.version < 10) ||
|
||||
(bowser.firefox && bowser.version < 4.0) ||
|
||||
(bowser.safari && bowser.version < 5) ||
|
||||
|
Loading…
Reference in New Issue
Block a user