Add electron.hideInternalModules
This commit is contained in:
parent
c649c4cf4f
commit
2ca5a33d28
3 changed files with 13 additions and 6 deletions
|
@ -1,3 +1,10 @@
|
|||
# Do not expose the internal modules to `require`.
|
||||
exports.hideInternalModules = ->
|
||||
{globalPaths} = require 'module'
|
||||
if globalPaths.length is 3
|
||||
# Remove the "common/api/lib" and "browser-or-renderer/api/lib".
|
||||
globalPaths.splice 0, 2
|
||||
|
||||
Object.defineProperties exports,
|
||||
# Common modules, please sort with alphabet order.
|
||||
clipboard:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue