forked from cannc4/Siren
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
82 lines (69 loc) · 2.16 KB
/
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
const {
app,
BrowserWindow,
ipcMain
} = require('electron')
const url = require('url');
const path = require('path')
let mainWindow = null
function createWindow() {
// Initialize the window to our specified dimensions
mainWindow = new BrowserWindow({
width: 1600,
height: 900,
backgroundColor: '#000',
enableLargerThanScreen: true,
show: true,
icon: __dirname + './favicon.icns',
fullscreenable: true,
fullscreen: true,
title: "Siren"
})
// app.setAboutPanelOptions({
// applicationName: "Siren",
// applicationVersion: "0.6.0"
// })
//mainWindow.setMenu(null);
// Specify entry point
// const startUrl = process.env.ELECTRON_START_URL || url.format({
// pathname: path.join(__dirname, '/server/build/index.html'),
// protocol: 'file:',
// slashes: true
// });
//mainWindow.loadURL(startUrl);
mainWindow.loadURL('http://localhost:3000/#/')
// Show dev tools
// Remove this line before distributing
// mainWindow.webContents.openDevTools()
// Remove window once app is closed
mainWindow.on('closed', function () {
if (process.platform !== 'darwin') {
app.quit();
mainWindow = null
}
})
// mainWindow.webContents.executeJavaScript(`
// var path = require('path');
// module.paths.push(path.resolve('node_modules'));
// module.paths.push(path.resolve('../node_modules'));
// module.paths.push(path.resolve(__dirname, '..', '..', 'electron', 'node_modules'));
// module.paths.push(path.resolve(__dirname, '..', '..', 'electron.asar', 'node_modules'));
// module.paths.push(path.resolve(__dirname, '..', '..', 'app', 'node_modules'));
// module.paths.push(path.resolve(__dirname, '..', '..', 'app.asar', 'node_modules'));
// path = undefined;
// `);
}
app.on('ready', function () {
createWindow()
mainWindow.setMenu(null);
})
app.on('activate', () => {
if (mainWindow === null) {
createWindow()
}
})
app.on('window-all-closed', function () {
if (process.platform !== 'darwin') {
app.quit()
}
})