electron/spec/fixtures/api/site-instance-overrides/main.js
Samuel Attard 16a3f41fd3
chore: add deprecation warning for the default of contextIsolation (#23507)
* chore: add deprecation warning for the default of contextIsolation

* chore: add to breaking changes

* Update docs/breaking-changes.md

Co-authored-by: Jeremy Apthorp <jeremya@chromium.org>

* chore: fix specs on windows

Co-authored-by: Jeremy Apthorp <jeremya@chromium.org>
2020-06-25 10:55:17 -07:00

36 lines
731 B
JavaScript

const { app, BrowserWindow, ipcMain } = require('electron');
const path = require('path');
process.noDeprecation = true;
process.on('uncaughtException', (e) => {
console.error(e);
process.exit(1);
});
app.allowRendererProcessReuse = JSON.parse(process.argv[2]);
const pids = [];
let win;
ipcMain.on('pid', (event, pid) => {
pids.push(pid);
if (pids.length === 2) {
console.log(JSON.stringify(pids));
if (win) win.close();
app.quit();
} else {
if (win) win.reload();
}
});
app.whenReady().then(() => {
win = new BrowserWindow({
show: false,
webPreferences: {
preload: path.resolve(__dirname, 'preload.js'),
contextIsolation: true
}
});
win.loadFile('index.html');
});