2023-08-28 05:23:10 -06:00
|
|
|
const { app, BrowserWindow } = require('electron/main')
|
2023-07-17 02:30:53 -06:00
|
|
|
const path = require('node:path')
|
2020-11-30 00:48:39 -07:00
|
|
|
|
|
|
|
function createWindow () {
|
|
|
|
const win = new BrowserWindow({
|
|
|
|
width: 800,
|
|
|
|
height: 600,
|
|
|
|
webPreferences: {
|
2021-03-16 17:45:38 -06:00
|
|
|
preload: path.join(__dirname, 'preload.js')
|
2020-11-30 00:48:39 -07:00
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
win.loadFile('index.html')
|
|
|
|
}
|
|
|
|
|
2021-03-16 17:45:38 -06:00
|
|
|
app.whenReady().then(() => {
|
|
|
|
createWindow()
|
|
|
|
|
|
|
|
app.on('activate', () => {
|
|
|
|
if (BrowserWindow.getAllWindows().length === 0) {
|
|
|
|
createWindow()
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
2020-11-30 00:48:39 -07:00
|
|
|
|
|
|
|
app.on('window-all-closed', () => {
|
|
|
|
if (process.platform !== 'darwin') {
|
|
|
|
app.quit()
|
|
|
|
}
|
|
|
|
})
|