Make non-public module accesible via remote
This commit is contained in:
parent
5f6c468f0f
commit
87c10b3ac2
1 changed files with 2 additions and 5 deletions
|
@ -250,16 +250,13 @@ ipcRenderer.on('ELECTRON_RENDERER_RELEASE_CALLBACK', function (event, id) {
|
||||||
const browserModules = require('../../browser/api/exports/electron')
|
const browserModules = require('../../browser/api/exports/electron')
|
||||||
|
|
||||||
// And add a helper receiver for each one.
|
// And add a helper receiver for each one.
|
||||||
var fn = function (name) {
|
for (let name of Object.getOwnPropertyNames(browserModules)) {
|
||||||
return Object.defineProperty(exports, name, {
|
Object.defineProperty(exports, name, {
|
||||||
get: function () {
|
get: function () {
|
||||||
return exports.getBuiltin(name)
|
return exports.getBuiltin(name)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
for (var name in browserModules) {
|
|
||||||
fn(name)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get remote module.
|
// Get remote module.
|
||||||
exports.require = function (module) {
|
exports.require = function (module) {
|
||||||
|
|
Loading…
Reference in a new issue