electron/spec/fixtures/crash-cases/setimmediate-renderer-crash/index.js
Milan Burda d78f37ec8f
refactor: use node scheme imports in spec (#38487)
Co-authored-by: Milan Burda <miburda@microsoft.com>
2023-06-15 10:42:27 -04:00

22 lines
488 B
JavaScript

const { app, BrowserWindow } = require('electron');
const path = require('node:path');
app.whenReady().then(() => {
const win = new BrowserWindow({
show: false,
webPreferences: {
nodeIntegration: true,
preload: path.resolve(__dirname, 'preload.js')
}
});
win.loadURL('about:blank');
win.webContents.on('render-process-gone', () => {
process.exit(1);
});
win.webContents.on('did-finish-load', () => {
setTimeout(() => app.quit());
});
});