electron/docs/fiddles/ipc/webview-new-window/preload.js
Milan Burda 67f273a6d6
docs: add <webview> new-window event removal to breaking-changes.md (#36985)
Co-authored-by: Milan Burda <miburda@microsoft.com>
2023-05-31 10:47:08 -04:00

6 lines
277 B
JavaScript

const { ipcRenderer } = require('electron')
const webview = document.getElementById('webview')
ipcRenderer.on('webview-new-window', (e, webContentsId, details) => {
console.log('webview-new-window', webContentsId, details)
webview.dispatchEvent(new Event('new-window'))
})