diff --git a/docs/api/web-contents.md b/docs/api/web-contents.md index 192e12e4012e..d30a34f8ec31 100644 --- a/docs/api/web-contents.md +++ b/docs/api/web-contents.md @@ -507,7 +507,6 @@ Emitted when the devtools window instructs the webContents to reload Returns: * `event` Event -* `guest` WebContents - The contents of the guest page. * `webPreferences` Object - The web preferences that will be used by the guest page. This object can be modified to adjust the preferences for the guest page. diff --git a/lib/browser/guest-view-manager.js b/lib/browser/guest-view-manager.js index 6b8b6144708a..9eb81b89ae22 100644 --- a/lib/browser/guest-view-manager.js +++ b/lib/browser/guest-view-manager.js @@ -206,7 +206,7 @@ const attachGuest = function (event, elementInstanceId, guestInstanceId, params) webPreferences.preloadURL = params.preload } - event.sender.emit('will-attach-webview', event, guest, webPreferences, params) + event.sender.emit('will-attach-webview', event, webPreferences, params) if (event.defaultPrevented) { if (guest.viewInstanceId == null) guest.viewInstanceId = params.instanceId destroyGuest(embedder, guestInstanceId) diff --git a/spec/static/main.js b/spec/static/main.js index 0763ba2ecf91..1eafd78503da 100644 --- a/spec/static/main.js +++ b/spec/static/main.js @@ -255,7 +255,7 @@ ipcMain.on('prevent-next-will-attach-webview', (event) => { }) ipcMain.on('disable-node-on-next-will-attach-webview', (event, id) => { - event.sender.once('will-attach-webview', (event, guest, webPreferences, params) => { + event.sender.once('will-attach-webview', (event, webPreferences, params) => { params.src = `file://${path.join(__dirname, '..', 'fixtures', 'pages', 'c.html')}` webPreferences.nodeIntegration = false }) diff --git a/spec/webview-spec.js b/spec/webview-spec.js index 02207a4b26a4..174b1e3962d2 100644 --- a/spec/webview-spec.js +++ b/spec/webview-spec.js @@ -1100,7 +1100,7 @@ describe(' tag', function () { w.loadURL('file://' + fixtures + '/pages/webview-visibilitychange.html') }) - describe('will-attach-webview event', () => { + describe.only('will-attach-webview event', () => { it('supports changing the web preferences', (done) => { ipcRenderer.send('disable-node-on-next-will-attach-webview') webview.addEventListener('console-message', (event) => {