When I press a button on a certain website loaded in a BrowserView, the electron app exits. It's obviously a crash, but it doesn't emit the render-process-gone neither on the BrowserWindow (renderer) or the BrowserView. It just quits. But window-all-closed is emited
app.on('ready', () => {
app.on('render-process-gone', (e, webContents, details) => {
console.log('render-process-gone', details);
});
const win = new BrowserWindow({
frame: false,
webPreferences: {
worldSafeExecuteJavaScript: true,
nodeIntegration: true,
webviewTag: false,
enableRemoteModule: false,
}
});
win.loadURL('file://' + __dirname + '/renderer.html');
const view = new BrowserView({
webPreferences: {
preload: 'preload.js'
worldSafeExecuteJavaScript: true,
nodeIntegration: false,
nodeIntegrationInSubFrames: true,
enableRemoteModule: false,
}
});
view.webContents.loadURL('http://website.com');
view.webContents.on('render-process-gone', (e, details) => {
console.log('render-process-gone', details);
});
win.setBrowserView(view);
});
app.on('window-all-closed', () => {
console.log('exiting...');
app.quit();
});
Is there a way to find out what could be causing this?
update: I added sandbox: true to the webPreferences and now it doesn't crash anymore!