From 5463d76f89338d8af53c43e3879cc733166725b4 Mon Sep 17 00:00:00 2001 From: DanKeeling Date: Fri, 9 May 2014 00:50:43 -0400 Subject: [PATCH] Updated VMM.Browser to better determine IE7/8 Versions An update to browser to check for Trident Version, IE8 reports as IE7 when in certain zones. This check determines more accurately actual IE7 or 8 version. --- source/js/Core/Core/VMM.Browser.js | 6 ++++++ source/js/VMM.Timeline.js | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/source/js/Core/Core/VMM.Browser.js b/source/js/Core/Core/VMM.Browser.js index 64df21b..d26940a 100644 --- a/source/js/Core/Core/VMM.Browser.js +++ b/source/js/Core/Core/VMM.Browser.js @@ -8,6 +8,7 @@ if(typeof VMM != 'undefined' && typeof VMM.Browser == 'undefined') { this.version = this.searchVersion(navigator.userAgent) || this.searchVersion(navigator.appVersion) || "an unknown version"; + this.tridentVersion = this.searchTridentVersion(navigator.userAgent); this.OS = this.searchString(this.dataOS) || "an unknown OS"; this.device = this.searchDevice(navigator.userAgent); this.orientation = this.searchOrientation(window.orientation); @@ -57,6 +58,11 @@ if(typeof VMM != 'undefined' && typeof VMM.Browser == 'undefined') { if (index == -1) return; return parseFloat(dataString.substring(index+this.versionSearchString.length+1)); }, + searchTridentVersion: function (dataString) { + var index = dataString.indexOf("Trident/"); + if (index == -1) return 0; + return parseFloat(dataString.substring(index + 8)); + }, dataBrowser: [ { string: navigator.userAgent, diff --git a/source/js/VMM.Timeline.js b/source/js/VMM.Timeline.js index dece5cf..f75b4d0 100755 --- a/source/js/VMM.Timeline.js +++ b/source/js/VMM.Timeline.js @@ -411,7 +411,7 @@ if(typeof VMM != 'undefined' && typeof VMM.Timeline == 'undefined') { /* GET DATA ================================================== */ if (VMM.Browser.browser == "Explorer" || VMM.Browser.browser == "MSIE") { - if ( parseInt(VMM.Browser.version, 10) <= 7 ) { + if (parseInt(VMM.Browser.version, 10) <= 7 && (VMM.Browser.tridentVersion == null || VMM.Browser.tridentVersion < 4)) { ie7 = true; } }