choose some window config

This commit is contained in:
2024-05-29 22:29:17 +02:00
parent fb1ee829ee
commit fc4b271cc6
+6 -4
View File
@@ -1,4 +1,4 @@
const { app, BrowserWindow } = require('electron/main'); const { app, BrowserWindow, nativeTheme, Menu } = require('electron/main');
const path = require('node:path'); const path = require('node:path');
const fs = require('fs'); const fs = require('fs');
const os = require('os'); const os = require('os');
@@ -72,15 +72,17 @@ async function createWindow() {
height: 1080, height: 1080,
backgroundColor: '#000000', backgroundColor: '#000000',
icon: 'images/icon-512.png', icon: 'images/icon-512.png',
autoHideMenuBar: true,
webPreferences: { webPreferences: {
preload: path.join(__dirname, 'preload.js'), preload: path.join(__dirname, 'preload.js'),
nodeIntegration: true,
webSecurity: false, webSecurity: false,
disableDialogs: true
}, },
show: false,
autoHideMenuBar: true
}); });
nativeTheme.themeSource = 'dark';
Menu.setApplicationMenu(null);
// register event callbacks // register event callbacks
win.on("closed", function () { win = null; }); win.on("closed", function () { win = null; });
win.webContents.on("will-frame-navigate", (event) => validateDomain(event)); win.webContents.on("will-frame-navigate", (event) => validateDomain(event));