Merge pull request #8939 from electron/expose-remote-to-sandbox
Expose remote module to sandbox
This commit is contained in:
commit
f71353a4c5
4 changed files with 29 additions and 16 deletions
|
@ -7,8 +7,6 @@ const {WebContents} = process.atomBinding('web_contents')
|
|||
|
||||
const {ipcMain, isPromise, webContents} = electron
|
||||
|
||||
const fs = require('fs')
|
||||
|
||||
const objectsRegistry = require('./objects-registry')
|
||||
|
||||
const hasProp = {}.hasOwnProperty
|
||||
|
@ -268,13 +266,6 @@ ipcMain.on('ELECTRON_BROWSER_REQUIRE', function (event, module) {
|
|||
}
|
||||
})
|
||||
|
||||
ipcMain.on('ELECTRON_BROWSER_READ_FILE', function (event, file) {
|
||||
fs.readFile(file, (err, data) => {
|
||||
if (err) event.returnValue = {err: err.message}
|
||||
else event.returnValue = {data: data.toString()}
|
||||
})
|
||||
})
|
||||
|
||||
ipcMain.on('ELECTRON_BROWSER_GET_BUILTIN', function (event, module) {
|
||||
try {
|
||||
event.returnValue = valueToMeta(event.sender, electron[module])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue