From 7a8a799c264a54c4297f374453f54cd7caaa6ba1 Mon Sep 17 00:00:00 2001 From: Jean-Francois Brazeau Date: Wed, 12 Feb 2014 15:05:53 +0100 Subject: [PATCH 1/2] Update useragent.js Patch proposal for https://github.com/ajaxorg/ace/issues/1814 (IE11 compatibility issue) --- lib/ace/lib/useragent.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ace/lib/useragent.js b/lib/ace/lib/useragent.js index b6989a8c..e5263e5a 100644 --- a/lib/ace/lib/useragent.js +++ b/lib/ace/lib/useragent.js @@ -76,7 +76,7 @@ exports.isLinux = (os == "linux"); // Windows Store JavaScript apps (aka Metro apps written in HTML5 and JavaScript) do not use the "Microsoft Internet Explorer" string in their user agent, but "MSAppHost" instead. exports.isIE = (navigator.appName == "Microsoft Internet Explorer" || navigator.appName.indexOf("MSAppHost") >= 0) - && parseFloat(navigator.userAgent.match(/MSIE ([0-9]+[\.0-9]+)/)[1]); + && parseFloat(navigator.userAgent.match(/(?:rv:|MSIE )([0-9]+[\.0-9]+)/)[1]); exports.isOldIE = exports.isIE && exports.isIE < 9; From 8ba0cd91be84a2bff9335a074bc9babcab8d2e29 Mon Sep 17 00:00:00 2001 From: jbrazeau Date: Wed, 12 Feb 2014 15:31:43 +0100 Subject: [PATCH 2/2] Fix : for UIE11, regexp must also consider Trident string --- lib/ace/lib/useragent.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ace/lib/useragent.js b/lib/ace/lib/useragent.js index e5263e5a..908a2a4c 100644 --- a/lib/ace/lib/useragent.js +++ b/lib/ace/lib/useragent.js @@ -76,7 +76,7 @@ exports.isLinux = (os == "linux"); // Windows Store JavaScript apps (aka Metro apps written in HTML5 and JavaScript) do not use the "Microsoft Internet Explorer" string in their user agent, but "MSAppHost" instead. exports.isIE = (navigator.appName == "Microsoft Internet Explorer" || navigator.appName.indexOf("MSAppHost") >= 0) - && parseFloat(navigator.userAgent.match(/(?:rv:|MSIE )([0-9]+[\.0-9]+)/)[1]); + && parseFloat(navigator.userAgent.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:|MSIE )([0-9]+[\.0-9]+)/)[1]); exports.isOldIE = exports.isIE && exports.isIE < 9;