main.js 352 B

1234567891011121314151617181920
  1. const {app, BrowserWindow} = require('electron')
  2. const windows = []
  3. function createWindow (id) {
  4. const window = new BrowserWindow({show: false})
  5. window.loadURL(`data:,window${id}`)
  6. windows.push(window)
  7. }
  8. app.once('ready', () => {
  9. for (let i = 1; i <= 5; i++) {
  10. createWindow(i)
  11. }
  12. setImmediate(function () {
  13. app.exit(123)
  14. })
  15. })