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 1/2] 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; } From 78e31a8e73826702fa75611f06ee788c5f42ce71 Mon Sep 17 00:00:00 2001 From: Ashley Date: Tue, 20 Dec 2016 22:11:32 +0100 Subject: [PATCH 2/2] Update browser.js --- browser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/browser.js b/browser.js index 52f3a97..91bea91 100644 --- a/browser.js +++ b/browser.js @@ -95,7 +95,7 @@ function formatArgs(args) { // figure out the correct index to insert the CSS into var index = 0; var lastC = 0; - args[0].replace(/%[a-z%]/g, function(match) { + args[0].replace(/%[a-zA-Z%]/g, function(match) { if ('%%' === match) return; index++; if ('%c' === match) {