Merge pull request #13539 from trop-bot/3-0-x-bp-enable-webview-in-sandbox-renderer-1530547750986
Backport (3-0-x) - Enable webview in sandbox renderer
This commit is contained in:
commit
8f8d198c5a
4 changed files with 51 additions and 1 deletions
|
@ -8,7 +8,7 @@ const os = require('os')
|
|||
const qs = require('querystring')
|
||||
const http = require('http')
|
||||
const {closeWindow} = require('./window-helpers')
|
||||
|
||||
const {emittedOnce} = require('./events-helpers')
|
||||
const {ipcRenderer, remote, screen} = require('electron')
|
||||
const {app, ipcMain, BrowserWindow, BrowserView, protocol, session, webContents} = remote
|
||||
|
||||
|
@ -1581,6 +1581,23 @@ describe('BrowserWindow module', () => {
|
|||
})
|
||||
w.loadURL('file://' + path.join(fixtures, 'api', 'preload.html'))
|
||||
})
|
||||
|
||||
it('webview in sandbox renderer', async () => {
|
||||
w.destroy()
|
||||
w = new BrowserWindow({
|
||||
show: false,
|
||||
webPreferences: {
|
||||
sandbox: true,
|
||||
preload: preload,
|
||||
webviewTag: true
|
||||
}
|
||||
})
|
||||
w.loadURL(`file://${fixtures}/pages/webview-did-attach-event.html`)
|
||||
|
||||
const [, webContents] = await emittedOnce(w.webContents, 'did-attach-webview')
|
||||
const [, id] = await emittedOnce(ipcMain, 'webview-dom-ready')
|
||||
expect(webContents.id).to.equal(id)
|
||||
})
|
||||
})
|
||||
|
||||
describe('nativeWindowOpen option', () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue