-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
28 lines (26 loc) · 736 Bytes
/
main.js
File metadata and controls
28 lines (26 loc) · 736 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
const { app, BrowserWindow } = require('electron')
function createWindow()
{
const mainWindow = new BrowserWindow({
width: 1200,
height: 700,
icon: __dirname + '/res/AppIcon.icns',
title: 'HomeSYS',
webPreferences: {
nodeIntegration: true,
webSecurity: false
}
})
mainWindow.webContents.on('did-finish-load', () => {
mainWindow.webContents.send('message', 'Hello second window!');
});
if (process.argv[ 2 ] === "--dev")
{
mainWindow.loadURL(`http://localhost:8080`);
}
else
mainWindow.loadFile(`./dist/index.html`)
}
app.name = 'HomeSYS';
app.allowRendererProcessReuse = true;
app.on('ready', createWindow)