Skip to content

Commit

Permalink
Merge pull request #282 from vkarpov15/patch-1
Browse files Browse the repository at this point in the history
Prevent crash when used with react-native
  • Loading branch information
TooTallNate authored Oct 22, 2016
2 parents a4ce0ba + d39abed commit b139836
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ exports.colors = [

function useColors() {
// is webkit? http://stackoverflow.com/a/16459606/376773
return ('WebkitAppearance' in document.documentElement.style) ||
// 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))) ||
// is firefox >= v31?
Expand Down

0 comments on commit b139836

Please sign in to comment.