Merge pull request #387 from kribblo/patch-1

Use typeof window.process !== 'undefined'
This commit is contained in:
Nathan Rajlich 2016-12-20 13:19:46 -08:00 committed by GitHub
commit a16cf42885

View File

@ -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;
}