-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
58 lines (44 loc) · 1.3 KB
/
main.js
File metadata and controls
58 lines (44 loc) · 1.3 KB
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
/*
LiveG App Runtime
Copyright (C) LiveG. All Rights Reserved.
https://liveg.tech
Licensed by the LiveG Open-Source Licence, which can be found at LICENCE.md.
*/
const electron = require("electron");
const minimist = require("minimist");
const path = require("path");
var ipc = require("./ipc");
global.arguments = minimist(process.argv);
global.mainWindow = null;
console.log(global.arguments);
global.newWindow = function(url) {
global.mainWindow = new electron.BrowserWindow({
width: 1200,
height: 800,
fullscreenable: true,
webPreferences: {
title: "",
devTools: true,
webviewTag: true,
preload: path.join(__dirname, "preload.js")
}
});
global.mainWindow.removeMenu();
global.mainWindow.setMenuBarVisibility(false);
global.mainWindow.loadFile("index.html");
if (global.arguments["debug"]) {
global.mainWindow.webContents.openDevTools();
}
global.mainWindow.on("closed", function() {
global.mainWindow = null;
});
};
electron.app.on("ready", global.newWindow);
electron.app.on("window-all-closed", function() {
electron.app.quit();
});
electron.app.on("activate", function() {
if (global.mainWindow == null) {
global.mainWindow();
}
});