Skip to content

Commit a16cf42

Browse files
authored
Merge pull request #387 from kribblo/patch-1
Use typeof window.process !== 'undefined'
2 parents 6e934e9 + 408ae94 commit a16cf42

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

browser.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ function useColors() {
4040
// NB: In an Electron preload script, document will be defined but not fully
4141
// initialized. Since we know we're in Chrome, we'll just detect this case
4242
// explicitly
43-
if (typeof window !== 'undefined' && 'process' in window && window.process.type === 'renderer') {
43+
if (typeof window !== 'undefined' && typeof window.process !== 'undefined' && window.process.type === 'renderer') {
4444
return true;
4545
}
4646

0 commit comments

Comments
 (0)