No more need to check for nodeIntegration when creating guest view
This commit is contained in:
parent
0140015500
commit
90f52169af
2 changed files with 0 additions and 38 deletions
|
@ -183,10 +183,6 @@ var attachGuest = function (embedder, elementInstanceId, guestInstanceId, params
|
|||
blinkFeatures: params.blinkfeatures
|
||||
}
|
||||
|
||||
if (embedder.getWebPreferences().nodeIntegration === false) {
|
||||
webPreferences.nodeIntegration = false
|
||||
}
|
||||
|
||||
if (params.preload) {
|
||||
webPreferences.preloadURL = params.preload
|
||||
}
|
||||
|
|
|
@ -107,40 +107,6 @@ describe('<webview> tag', function () {
|
|||
document.body.appendChild(webview)
|
||||
})
|
||||
|
||||
it('disables node integration when disabled on the parent BrowserWindow', function (done) {
|
||||
var b = undefined
|
||||
|
||||
ipcMain.once('answer', function (event, typeofProcess) {
|
||||
try {
|
||||
assert.equal(typeofProcess, 'undefined')
|
||||
done()
|
||||
} finally {
|
||||
b.close()
|
||||
}
|
||||
})
|
||||
|
||||
var windowUrl = require('url').format({
|
||||
pathname: `${fixtures}/pages/webview-no-node-integration-on-window.html`,
|
||||
protocol: 'file',
|
||||
query: {
|
||||
p: `${fixtures}/pages/web-view-log-process.html`
|
||||
},
|
||||
slashes: true
|
||||
})
|
||||
var preload = path.join(fixtures, 'module', 'answer.js')
|
||||
|
||||
b = new BrowserWindow({
|
||||
height: 400,
|
||||
width: 400,
|
||||
show: false,
|
||||
webPreferences: {
|
||||
preload: preload,
|
||||
nodeIntegration: false,
|
||||
}
|
||||
})
|
||||
b.loadURL(windowUrl)
|
||||
})
|
||||
|
||||
it('disables node integration on child windows when it is disabled on the webview', function (done) {
|
||||
app.once('browser-window-created', function (event, window) {
|
||||
assert.equal(window.webContents.getWebPreferences().nodeIntegration, false)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue