From 408ae94373aaa8693b23b5b402bbeb4320c9e210 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristoffer=20Lund=C3=A9n?= Date: Tue, 20 Dec 2016 21:33:50 +0100 Subject: [PATCH] Use typeof window.process !== 'undefined' 'process' in window returns true after window.process = null --- browser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/browser.js b/browser.js index 52f3a97..8d013bc 100644 --- a/browser.js +++ b/browser.js @@ -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; }