mirror of
https://github.com/lancedikson/bowser
synced 2025-06-13 13:03:52 +00:00
Merge c12ff890c3
into 23545d4403
This commit is contained in:
commit
eb38b82dea
@ -29,6 +29,14 @@ if (bowser.webkit) {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
IE Browsers will report their version along with if the browser is in compatability mode
|
||||||
|
|
||||||
|
``` js
|
||||||
|
if (bowser.msie && bowser.compatability) {
|
||||||
|
// beware compatability mode
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
Ender installation
|
Ender installation
|
||||||
-----
|
-----
|
||||||
If you don't already have [Ender](http://ender.no.de) (an npm package) install it now (and don't look back)
|
If you don't already have [Ender](http://ender.no.de) (an npm package) install it now (and don't look back)
|
||||||
|
14
bowser.js
14
bowser.js
@ -43,7 +43,19 @@
|
|||||||
|
|
||||||
if (ie) return {
|
if (ie) return {
|
||||||
msie: t
|
msie: t
|
||||||
, version: ua.match(/msie (\d+(\.\d+)?);/i)[1]
|
, version: (function(ua) {
|
||||||
|
switch (ua.match(/Trident\/(\d+(\.\d+)?)/i)[1]) {
|
||||||
|
case '6.0': //Trident 6.0 maps to IE 10
|
||||||
|
return '10.0'
|
||||||
|
case '5.0': //Trident 5.0 maps to IE 9
|
||||||
|
return '9.0'
|
||||||
|
case '4.0': //Trident 4.0 maps to IE 8
|
||||||
|
return '8.0'
|
||||||
|
default: //Trident not present reverts back to IE 7 or below
|
||||||
|
return '7.0'
|
||||||
|
}
|
||||||
|
})(ua)
|
||||||
|
, compatability: ua.indexOf("MSIE 7.0") > -1
|
||||||
}
|
}
|
||||||
if (chrome) return {
|
if (chrome) return {
|
||||||
webkit: t
|
webkit: t
|
||||||
|
Loading…
Reference in New Issue
Block a user