From 001d03c859be5e68267c6b59d3a73d7f2fe7a9fd Mon Sep 17 00:00:00 2001 From: Ryohei Ikegami Date: Mon, 3 Apr 2017 22:11:29 +0900 Subject: [PATCH] Do not add search paths in devtools --- lib/renderer/init.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/renderer/init.js b/lib/renderer/init.js index c6fd6a2..72f7c9e 100644 --- a/lib/renderer/init.js +++ b/lib/renderer/init.js @@ -117,8 +117,11 @@ if (nodeIntegration === 'true') { global.__filename = __filename global.__dirname = __dirname - // Search for module under the app directory - module.paths = module.paths.concat(Module._nodeModulePaths(electron.remote.app.getAppPath())) + if (window.location.protocol !== 'chrome-devtools:') { + // Search for module under the app directory + // (remote.app doesn't work in devtools) + module.paths = module.paths.concat(Module._nodeModulePaths(electron.remote.app.getAppPath())) + } } // Redirect window.onerror to uncaughtException. -- 2.7.4