-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
50 lines (43 loc) · 1.25 KB
/
index.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
45
46
47
48
49
50
const {app, BrowserWindow} = require('electron');
const path = require('path').join;
const url = require('url').format;
let win
const iconPath = path(__dirname, 'docs/icons/icon.png');
console.log("Found icon: ", iconPath);
async function createWindow() {
win = new BrowserWindow({
width: 400,
height: 600,
fullscreenable: false,
resizable: false,
icon: iconPath,
autoHideMenuBar: true,
spellcheck: false,
experimentalFeatures: true,
webPreferences: {
nodeIntegration: true,
nodeIntegrationInSubFrames: true,
nodeIntegrationInWorker: true,
webgl: false,
enableWebSQL: false,
v8CacheOptions: "bypassHeatCheck"
}
});
win.loadFile('./web/index.html');
console.log("App loaded");
getProcessInfo();
win.on('closed', () => {
win = null;
console.log("App closed");
});
};
async function getProcessInfo() {
console.log("App version: ", app.getVersion());
console.log("Process started with PID: ", process.pid);
console.log(process.versions);
};
console.log("App ready! Creating window.");
app.on('ready', createWindow);
app.on('window-all-closed', () => {
app.quit();
});