-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.js
44 lines (35 loc) · 852 Bytes
/
main.js
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
37
38
39
40
41
42
43
44
const { app, BrowserWindow, ipcMain } = require('electron')
const path = require('path')
if (app.isPackaged) {
require('update-electron-app')()
} else {
// require('electron-reloader')(module)
console.log("You are in developer mode!")
}
let win
function createWindow() {
win = new BrowserWindow({
width: 800,
height: 600,
hasShadow: true,
icon: './images/logo-transparent.png',
webPreferences: {
nodeIntegration: true,
webviewTag: true,
enableRemoteModule: true,
contextIsolation: false,
preload: `${__dirname}/scripts/preload.js`
},
frame: false
})
win.webContents.openDevTools()
win.loadFile('index.html')
return win
}
app.whenReady().then(() => {
createWindow()
})
app.on('window-all-closed', function () {
if (process.platform !== 'darwin') app.quit()
})
require('@electron/remote/main').initialize()