electron/spec/fixtures/api/window-all-closed/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

24 lines
453 B
JavaScript

const { app, BrowserWindow } = require('electron');
let handled = false;
if (app.commandLine.hasSwitch('handle-event')) {
app.on('window-all-closed', () => {
handled = true;
app.quit();
});
}
app.on('quit', () => {
process.stdout.write(JSON.stringify(handled));
process.stdout.end();
});
app.whenReady().then(() => {
const win = new BrowserWindow({
webPreferences: {
contextIsolation: true
}
});
win.close();
});