2021-03-02 17:38:56 +00:00
|
|
|
const { app, BrowserWindow } = require('electron');
|
|
|
|
|
2021-07-22 19:49:21 +00:00
|
|
|
app.once('ready', async () => {
|
2021-03-04 16:22:32 +00:00
|
|
|
const w = new BrowserWindow({
|
|
|
|
show: false,
|
|
|
|
webPreferences: {
|
|
|
|
contextIsolation: false,
|
|
|
|
nodeIntegration: true
|
|
|
|
}
|
|
|
|
});
|
2021-07-22 19:49:21 +00:00
|
|
|
w.webContents.once('render-process-gone', (_, details) => {
|
|
|
|
if (details.reason === 'crashed') {
|
|
|
|
process.exit(0);
|
|
|
|
} else {
|
|
|
|
process.exit(details.exitCode);
|
|
|
|
}
|
2021-03-02 17:38:56 +00:00
|
|
|
});
|
2021-07-22 19:49:21 +00:00
|
|
|
await w.webContents.loadURL('chrome://checkcrash');
|
2021-03-02 17:38:56 +00:00
|
|
|
});
|