-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
main.ts
58 lines (51 loc) · 1.81 KB
/
main.ts
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
const { app, BrowserWindow } = require('electron');
import * as path from "path";
import * as url from "url";
app.on('ready', () => {
const window = new BrowserWindow({
width: 1024,
height: 768,
webPreferences: {
nodeIntegration: true,
contextIsolation: false,
webSecurity: false,
}
});
window.setMenuBarVisibility(false);
window.loadFile('index.html');
window.loadURL(`http://localhost:4000`);
window.webContents.openDevTools();
});
// Quit when all windows are closed, except on macOS. There, it's common
// for applications and their menu bar to stay active until the user quits
// explicitly with Cmd + Q.
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit();
}
});
// app.on('activate', () => {
// // On OS X it's common to re-create a window in the app when the
// // dock icon is clicked and there are no other windows open.
// if (BrowserWindow.getAllWindows().length === 0) {
// app.on('ready', () => {
// // once electron has started up, create a window.
// const window = new BrowserWindow({
// width: 1024,
// height: 768,
// webPreferences: {
// nodeIntegration: true,
// contextIsolation: false,//THIS HAS CONFLICT WITH TYPESCRIPT
// webSecurity: false,
// }
// });
// // hide the default menu bar that comes with the browser window
// window.setMenuBarVisibility(false); //NOTE changed from null to false
// // load a website to display
// window.loadFile('index.html'); //This is just for production, not used for development
// window.loadURL(`http://localhost:4000`); // development
// // if(process.env.NODE_env === 'production')
// window.webContents.openDevTools();
// });
// }
// });