Skip to content

Commit

Permalink
Use typeof window.process !== 'undefined'
Browse files Browse the repository at this point in the history
'process' in window returns true after window.process = null
  • Loading branch information
kribblo authored Dec 20, 2016
1 parent 6e934e9 commit 408ae94
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 408ae94

Please sign in to comment.