23 lines
511 B
JavaScript
23 lines
511 B
JavaScript
const { app, BrowserWindow } = require('electron')
|
|
|
|
const createWindow = () => {
|
|
let mainWin = new BrowserWindow({
|
|
width: 800,
|
|
height: 400,
|
|
show: false,
|
|
webPreferences: {
|
|
enableRemoteModule: true,
|
|
nodeIntegration: true
|
|
}
|
|
})
|
|
|
|
mainWin.loadFile('index.html')
|
|
mainWin.on('ready-to-show', mainWin.show)
|
|
mainWin.on('close', () => {
|
|
mainWin = null
|
|
})
|
|
}
|
|
|
|
app.on('ready', createWindow)
|
|
app.on('window-all-closed', app.quit)
|