-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathindex.js
More file actions
52 lines (38 loc) · 1.43 KB
/
Copy pathindex.js
File metadata and controls
52 lines (38 loc) · 1.43 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
const { app, BrowserWindow, ipcMain } = require('electron');
const PORT = require('./port.json');
const createMainWindow = () => {
const win = new BrowserWindow({show: false,frame:false,icon: __dirname + '/web/assets/icons/flash96.png', webPreferences: {
nodeIntegration: true, contextIsolation: false, enableRemoteModule: true
} });
win.maximize();
win.once('ready-to-show', () => {win.show();});
win.loadURL('http://localhost:53911/index.html');
win.loadURL(`http://localhost:${PORT.port}/index.html`);
}
const createSplashWindow = () => {
const win = new BrowserWindow({height:600, width:1200 , icon: __dirname + '/web/assets/icons/flash96.png',frame:false,webPreferences: {
nodeIntegration: true, contextIsolation: false
} });
// win.loadFile("splash.html")
win.loadURL(`http://localhost:${PORT.port}/splash.html`);
}
app.whenReady().then(() => {
createSplashWindow()
});
ipcMain.on('openChildWindow', (event, arg) => {
createMainWindow();
});
function openTheMainWindow(){
createMainWindow()
}
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') app.quit()
});
process.env['ELECTRON_DISABLE_SECURITY_WARNINGS'] = 'true';
// function close_everything(){
// app.quit();
// }
// document.getElementById('close_btn').addEventListener('click', (event) => {
// // close_everything()
// win.webContents.executeJavaScript('').then(console.log("HELLLII"));
// })