assistant-note/main.js

25 lines
597 B
JavaScript
Raw Normal View History

2023-01-30 03:15:29 -05:00
// npm start
const { app, BrowserWindow } = require('electron')
2023-11-01 22:15:06 -04:00
const path = require('path')
2023-01-30 03:15:29 -05:00
2023-11-01 22:15:06 -04:00
// electorn
2023-01-30 03:15:29 -05:00
const createWindow = () => {
const win = new BrowserWindow({
width: 800,
2023-11-01 22:15:06 -04:00
height: 600,
webPreferences: {
preload: path.join(__dirname, 'preload.js')
}
2023-01-30 03:15:29 -05:00
})
win.loadFile('index.html')
}
app.whenReady().then(() => {
createWindow()
2023-11-01 22:15:06 -04:00
app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) createWindow()
})
2023-11-01 22:14:40 -04:00
})
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') app.quit()
2023-11-01 22:15:06 -04:00
})