electron/spec/fixtures/api/window-all-closed/main.js

21 lines
391 B
JavaScript
Raw Normal View History

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