Skip to content

Commit

Permalink
Merge pull request #387 from kribblo/patch-1
Browse files Browse the repository at this point in the history
Use typeof window.process !== 'undefined'
  • Loading branch information
TooTallNate committed Dec 20, 2016
2 parents 6e934e9 + 408ae94 commit a16cf42
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function useColors() {
// NB: In an Electron preload script, document will be defined but not fully
// initialized. Since we know we're in Chrome, we'll just detect this case
// explicitly
if (typeof window !== 'undefined' && 'process' in window && window.process.type === 'renderer') {
if (typeof window !== 'undefined' && typeof window.process !== 'undefined' && window.process.type === 'renderer') {
return true;
}

Expand Down

0 comments on commit a16cf42

Please sign in to comment.