From 863eff17556df84c018506e21ac547c39a4e2e99 Mon Sep 17 00:00:00 2001 From: Joe Grigg Date: Thu, 26 Apr 2012 14:38:47 -0600 Subject: [PATCH 1/3] Adding a flag for compatability mode for msie --- bowser.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/bowser.js b/bowser.js index 4636072..501e3ec 100644 --- a/bowser.js +++ b/bowser.js @@ -41,7 +41,19 @@ if (ie) return { 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 { webkit: t From b08b126ef7f6dca662cf5d501e7eb67a11062b81 Mon Sep 17 00:00:00 2001 From: Joe Grigg Date: Thu, 26 Apr 2012 14:45:27 -0600 Subject: [PATCH 2/3] updating the readme file to show msie changes --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index ba6e427..c710461 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,13 @@ if (bowser.webkit) { // do stuff with safari & chrome } ``` +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 ----- From c12ff890c389751eb57ac238c009eb8e97477e0e Mon Sep 17 00:00:00 2001 From: Joe Grigg Date: Thu, 26 Apr 2012 14:46:15 -0600 Subject: [PATCH 3/3] updating the readme file to show msie changes --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c710461..b11c41b 100644 --- a/README.md +++ b/README.md @@ -28,13 +28,14 @@ if (bowser.webkit) { // do stuff with safari & chrome } ``` + 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 -----