forked from modelomaker812/pig.eon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
47 lines (38 loc) · 1.15 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
const { app, BrowserWindow } = require("electron");
app.commandLine.appendSwitch('ignore-certificate-errors')
app.commandLine.appendSwitch('allow-insecure-localhost', 'true')
const server = require("./app/src/");
let mainWindow;
function createWindow() {
mainWindow = new BrowserWindow({
width: 1200,
height: 700,
title: "Pigeon",
webPreferences: {
nodeIntegration: true,
webSecurity: false,
contextIsolation: false,
enableRemoteModule: true
},
});
mainWindow.loadURL("https://0.0.0.0:3000");
mainWindow.on("closed", function () {
mainWindow = null;
});
}
app.on("ready", createWindow);
// SSL/TSL: this is the self signed certificate support
app.on('certificate-error', (event, webContents, url, error, certificate, callback) => {
// On certificate error we disable default behaviour (stop loading the page)
// and we then say "it is all fine - true" to the callback
event.preventDefault();
callback(true);
});
app.on("resize", function (e, x, y) {
mainWindow.setSize(x, y);
});
app.on("window-all-closed", function () {
if (process.platform !== "darwin") {
app.quit();
}
});