-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
36 lines (31 loc) · 922 Bytes
/
main.js
File metadata and controls
36 lines (31 loc) · 922 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
35
36
const { app, BrowserWindow } = require('electron')
const { dialog, ipcMain } = require('electron')
const url = require('url')
const path = require('path')
const fs = require('fs')
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
let win
function createWindow() {
win = new BrowserWindow({
width: 650,
height: 280,
webPreferences: {
nodeIntegration: true
},
show: false,
})
win.loadFile('src/index.html')
win.once('ready-to-show', () => {
win.show();
// win.openDevTools();
})
}
// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.on('ready', createWindow)
// Quit when all windows are closed.
app.on('window-all-closed', () => {
app.quit()
})