Skip to content

Commit 408ae94

Browse files
authored
Use typeof window.process !== 'undefined'
'process' in window returns true after window.process = null
1 parent 6e934e9 commit 408ae94

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

browser.js

Lines changed: 1 addition & 1 deletion
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)