From 6f2628fef992e99781c29ffea14cfb388ef3195c Mon Sep 17 00:00:00 2001 From: yi Date: Wed, 24 May 2017 19:11:07 +0800 Subject: [PATCH] make debug working in wechat dev tool --- src/browser.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/browser.js b/src/browser.js index 71069249..78a61446 100644 --- a/src/browser.js +++ b/src/browser.js @@ -40,6 +40,10 @@ 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 wx !== 'undefined') { + return true + } + if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') { return true; } @@ -116,11 +120,12 @@ function formatArgs(args) { */ function log() { + console.log.apply(console, arguments); // this hackery is required for IE8/9, where // the `console.log` function doesn't have 'apply' - return 'object' === typeof console - && console.log - && Function.prototype.apply.call(console.log, console, arguments); + //return 'object' === typeof console + //&& console.log + //&& Function.prototype.apply.call(console.log, console, arguments); } /**