-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
39 lines (33 loc) · 1.14 KB
/
main.js
File metadata and controls
39 lines (33 loc) · 1.14 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
const { app, BrowserWindow } = require('electron')
let mainWindow
async function createWindow () {
mainWindow = new BrowserWindow({
width: 1080,
height: 700,
icon: __dirname + `/o.ico`,
frame: false,
transparent: true,
autoHideMenuBar: true,
webPreferences: {
nodeIntegration: true,
contextIsolation: false,
enableRemoteModule: true}
})
mainWindow.loadURL(`file://${__dirname}/startup2.html`).then(()=>{
console.log({Message: "URL Loaded"})
})
// BYPASS BOOT SCREEN COMMENT ABOVE AND UNCOMMENT BELOW
// mainWindow.loadURL(`file://${__dirname}/index.html`).then(()=>{
// console.log({Message: "URL Loaded"})
// })
// SHOW DEV TOOLS ON MAINWINDOW @ LOADURL, CAN MAKE EVENT AND BUTTON TO TOGGLE THIS FEATURE FOR DEV
// mainWindow.webContents.openDevTools()
mainWindow.on('closed', function () {
mainWindow = null
})
}
app.whenReady().then(() => {
if (BrowserWindow.getAllWindows().length === 0) {
createWindow().then(r => console.log({Message: "Application Started"}))
}
})