electron/spec/fixtures/api/exit-closes-all-windows-app/main.js
2017-04-11 09:09:17 -07:00

19 lines
352 B
JavaScript

const {app, BrowserWindow} = require('electron')
const windows = []
function createWindow (id) {
const window = new BrowserWindow({show: false})
window.loadURL(`data:,window${id}`)
windows.push(window)
}
app.once('ready', () => {
for (let i = 1; i <= 5; i++) {
createWindow(i)
}
setImmediate(function () {
app.exit(123)
})
})