From 0e47511c9f9757de73c8f7cdda34413eddd4e23f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?I=C3=B1aki=20Baz=20Castillo?= Date: Sun, 20 Aug 2017 18:43:12 +0200 Subject: [PATCH] Disable colors in Edge and Internet Explorer (fixes https://github.com/visionmedia/debug/issues/417) --- src/browser.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/browser.js b/src/browser.js index 879aaa79..f5149ff5 100644 --- a/src/browser.js +++ b/src/browser.js @@ -49,6 +49,11 @@ function useColors() { return true; } + // Internet Explorer and Edge do not support colors. + if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { + return false; + } + // is webkit? http://stackoverflow.com/a/16459606/376773 // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||