fix: will-attach-webview handler modifying params.instanceId does not break <webview> (#32386)

This commit is contained in:
Milan Burda
2022-01-12 08:41:20 +01:00
committed by GitHub
parent cbe68bdbb8
commit 99ee1fc0eb
5 changed files with 34 additions and 16 deletions

View File

@@ -138,6 +138,12 @@ ipcMain.on('prevent-next-will-attach-webview', (event) => {
event.sender.once('will-attach-webview', event => event.preventDefault());
});
ipcMain.on('break-next-will-attach-webview', (event, id) => {
event.sender.once('will-attach-webview', (event, webPreferences, params) => {
params.instanceId = null;
});
});
ipcMain.on('disable-node-on-next-will-attach-webview', (event, id) => {
event.sender.once('will-attach-webview', (event, webPreferences, params) => {
params.src = `file://${path.join(__dirname, '..', 'fixtures', 'pages', 'c.html')}`;