Skip to content

Commit

Permalink
allow colours in workers (#335)
Browse files Browse the repository at this point in the history
  • Loading branch information
botverse authored and thebigredgeek committed Dec 12, 2016
1 parent 501521f commit bd9faa1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions browser.js
Expand Up @@ -42,10 +42,12 @@ function useColors() {
// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
return (typeof document !== 'undefined' && 'WebkitAppearance' in document.documentElement.style) ||
// is firebug? http://stackoverflow.com/a/398120/376773
(window.console && (console.firebug || (console.exception && console.table))) ||
(typeof window !== 'undefined' && window.console && (console.firebug || (console.exception && console.table))) ||
// is firefox >= v31?
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
(navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31);
(navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
// double check webkit in userAgent just in case we are in a worker
(navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
}

/**
Expand Down

0 comments on commit bd9faa1

Please sign in to comment.