diff --git a/viewport-units-buggyfill.hacks.js b/viewport-units-buggyfill.hacks.js index d11f761..5f441d8 100755 --- a/viewport-units-buggyfill.hacks.js +++ b/viewport-units-buggyfill.hacks.js @@ -25,29 +25,16 @@ var calcExpression = /calc\(/g; var quoteExpression = /[\"\']/g; var urlExpression = /url\([^\)]*\)/g; - var isBuggyIE = false; - var isOldIE = false; + var userAgent = window.navigator.userAgent; + var isBuggyIE = /MSIE [0-9]\./i.test(userAgent); + var isOldIE = /MSIE [0-8]\./i.test(userAgent); var supportsVminmax = true; var supportsVminmaxCalc = true; - // WARNING! - // Do not remove the following conditional comment. - // It is required to identify the current version of IE - - /*@cc_on - - @if (9 <= @_jscript_version && @_jscript_version <= 10) - isBuggyIE = true; + if (isBuggyIE === true) { supportsVminmaxCalc = false; supportsVminmax = false; - @end - - @if (@_jscript_version < 9) { - isOldIE = true; } - @end - - @*/ // iOS SAFARI, IE9, or Stock Android: abuse "content" if "viewport-units-buggyfill" specified function checkHacks(declarations, rule, name, value) { diff --git a/viewport-units-buggyfill.js b/viewport-units-buggyfill.js index 28c3f40..81bb9dd 100755 --- a/viewport-units-buggyfill.js +++ b/viewport-units-buggyfill.js @@ -30,8 +30,8 @@ var dimensions; var declarations; var styleNode; - var isBuggyIE = false; - var isOldIE = false; + var isBuggyIE = /MSIE [0-9]\./i.test(userAgent); + var isOldIE = /MSIE [0-8]\./i.test(userAgent); var isOperaMini = userAgent.indexOf('Opera Mini') > -1; var isMobileSafari = /(iPhone|iPod|iPad).+AppleWebKit/i.test(userAgent) && (function() { @@ -66,23 +66,6 @@ return versionNumber <= 4.4; })(); - // Do not remove the following comment! - // It is a conditional comment used to - // identify old Internet Explorer versions - - /*@cc_on - - @if (9 <= @_jscript_version && @_jscript_version <= 10) - isBuggyIE = true; - @end - - @if (@_jscript_version < 9) { - isOldIE = true; - } - @end - - @*/ - // added check for IE11, since it *still* doesn't understand vmax!!! if (!isBuggyIE) { isBuggyIE = !!navigator.userAgent.match(/Trident.*rv[ :]*11\./);