diff --git a/lib/browser/init.js b/lib/browser/init.js index fc4f90c399ba..df670ece7100 100644 --- a/lib/browser/init.js +++ b/lib/browser/init.js @@ -18,10 +18,6 @@ require('../common/init') var globalPaths = Module.globalPaths -if (!process.env.ELECTRON_HIDE_INTERNAL_MODULES) { - globalPaths.push(path.join(__dirname, 'api')) -} - // Expose public APIs. globalPaths.push(path.join(__dirname, 'api', 'exports')) diff --git a/lib/common/api/exports/electron.js b/lib/common/api/exports/electron.js index 25ef2640d599..65da6c5d2b91 100644 --- a/lib/common/api/exports/electron.js +++ b/lib/common/api/exports/electron.js @@ -1,20 +1,6 @@ -// Do not expose the internal modules to `require`. -const hideInternalModules = function () { - var globalPaths = require('module').globalPaths - if (globalPaths.length === 3) { - // Remove the "common/api/lib" and "browser-or-renderer/api/lib". - return globalPaths.splice(0, 2) - } -} - // Attaches properties to |exports|. exports.defineProperties = function (exports) { return Object.defineProperties(exports, { - hideInternalModules: { - enumerable: true, - value: hideInternalModules - }, - // Common modules, please sort with alphabet order. clipboard: { // Must be enumerable, otherwise it woulde be invisible to remote module. diff --git a/lib/common/init.js b/lib/common/init.js index 11c098d3ce5c..1b90b9343441 100644 --- a/lib/common/init.js +++ b/lib/common/init.js @@ -12,11 +12,6 @@ process.atomBinding = function (name) { } } -if (!process.env.ELECTRON_HIDE_INTERNAL_MODULES) { - // Add common/api/lib to module search paths. - Module.globalPaths.push(path.join(__dirname, 'api')) -} - // setImmediate and process.nextTick makes use of uv_check and uv_prepare to // run the callbacks, however since we only run uv loop on requests, the // callbacks wouldn't be called until something else activated the uv loop, diff --git a/lib/renderer/init.js b/lib/renderer/init.js index a9f4acc5cbfe..fadf95256865 100644 --- a/lib/renderer/init.js +++ b/lib/renderer/init.js @@ -16,10 +16,6 @@ require('../common/init') var globalPaths = Module.globalPaths -if (!process.env.ELECTRON_HIDE_INTERNAL_MODULES) { - globalPaths.push(path.join(__dirname, 'api')) -} - // Expose public APIs. globalPaths.push(path.join(__dirname, 'api', 'exports'))