From 21049606987ba155ea8dcd1956c907bfb85912e6 Mon Sep 17 00:00:00 2001 From: Alexander Grimalovsky Date: Tue, 21 Mar 2017 13:19:24 +0300 Subject: [PATCH 1/2] Updated test for old IE to avoid errors in a case if standard globals are either missed or have different set of properties (e.g. into test environments or into browser addons). Fixes #177 --- addStyles.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/addStyles.js b/addStyles.js index c81451da..e4472a34 100644 --- a/addStyles.js +++ b/addStyles.js @@ -11,7 +11,12 @@ var stylesInDom = {}, }; }, isOldIE = memoize(function() { - return /msie [6-9]\b/.test(self.navigator.userAgent.toLowerCase()); + // Test for IE <= 9 as proposed by Browserhacks + // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805 + // Tests for existence of standard globals is to allow style-loader + // to operate correctly into non-standard environments + // @see https://github.com/webpack-contrib/style-loader/issues/177 + return window && document && document.all && !window.atob; }), getElement = (function(fn) { var memo = {}; From d4cbc027a607b91006fdeaaeae19ac163dea83ab Mon Sep 17 00:00:00 2001 From: Alexander Grimalovsky Date: Tue, 21 Mar 2017 13:21:22 +0300 Subject: [PATCH 2/2] Fixed whitespace difference --- addStyles.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addStyles.js b/addStyles.js index e4472a34..af770cd0 100644 --- a/addStyles.js +++ b/addStyles.js @@ -16,7 +16,7 @@ var stylesInDom = {}, // Tests for existence of standard globals is to allow style-loader // to operate correctly into non-standard environments // @see https://github.com/webpack-contrib/style-loader/issues/177 - return window && document && document.all && !window.atob; + return window && document && document.all && !window.atob; }), getElement = (function(fn) { var memo = {};