-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
34 lines (27 loc) · 720 Bytes
/
main.js
File metadata and controls
34 lines (27 loc) · 720 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
const { app, BrowserWindow, Menu } = require('electron')
let mainWindow
const createWindow = () => {
mainWindow = new BrowserWindow({
width: 290,
height: 530,
minWidth: 275,
icon: 'public/assets/icon/favicon.ico',
webPreferences: {
webSecurity: false // Bypass CORS request
}
})
mainWindow.loadFile('public/index.html')
// Open the DevTools.
// mainWindow.webContents.openDevTools()
mainWindow.on('closed', () => (mainWindow = null))
}
app.on('ready', () => {
createWindow()
Menu.setApplicationMenu(null)
})
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') app.quit()
})
app.on('activate', () => {
if (mainWindow === null) createWindow()
})