This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Commit 7ab38e4
1 parent f311b10 commit 7ab38e4 Copy full SHA for 7ab38e4
File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -40,20 +40,20 @@ function useColors() {
40
40
// NB: In an Electron preload script, document will be defined but not fully
41
41
// initialized. Since we know we're in Chrome, we'll just detect this case
42
42
// explicitly
43
- if ( typeof window !== 'undefined' && window && typeof window . process !== 'undefined' && window . process . type === 'renderer' ) {
43
+ if ( window && window . process && window . process . type === 'renderer' ) {
44
44
return true ;
45
45
}
46
46
47
47
// is webkit? http://stackoverflow.com/a/16459606/376773
48
48
// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
49
- return ( typeof document !== 'undefined' && document && 'WebkitAppearance' in document . documentElement . style ) ||
49
+ return ( document && document . documentElement && document . documentElement . style && document . documentElement . style . WebkitAppearance ) ||
50
50
// is firebug? http://stackoverflow.com/a/398120/376773
51
- ( typeof window !== 'undefined' && window && window . console && ( console . firebug || ( console . exception && console . table ) ) ) ||
51
+ ( window && window . console && ( window . console . firebug || ( window . console . exception && window . console . table ) ) ) ||
52
52
// is firefox >= v31?
53
53
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
54
- ( typeof navigator !== 'undefined' && navigator && navigator . userAgent && navigator . userAgent . toLowerCase ( ) . match ( / f i r e f o x \/ ( \d + ) / ) && parseInt ( RegExp . $1 , 10 ) >= 31 ) ||
54
+ ( navigator && navigator . userAgent && navigator . userAgent . toLowerCase ( ) . match ( / f i r e f o x \/ ( \d + ) / ) && parseInt ( RegExp . $1 , 10 ) >= 31 ) ||
55
55
// double check webkit in userAgent just in case we are in a worker
56
- ( typeof navigator !== 'undefined' && navigator && navigator . userAgent && navigator . userAgent . toLowerCase ( ) . match ( / a p p l e w e b k i t \/ ( \d + ) / ) ) ;
56
+ ( navigator && navigator . userAgent && navigator . userAgent . toLowerCase ( ) . match ( / a p p l e w e b k i t \/ ( \d + ) / ) ) ;
57
57
}
58
58
59
59
/**
You can’t perform that action at this time.
0 commit comments