Skip to content

Commit

Permalink
Disable colors in Edge and Internet Explorer (#489)
Browse files Browse the repository at this point in the history
Fixes #417.
  • Loading branch information
ibc authored and TooTallNate committed Aug 24, 2017
1 parent 13e1d06 commit b3ea123
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/browser.js
Expand Up @@ -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) ||
Expand Down

0 comments on commit b3ea123

Please sign in to comment.