From fc4b271cc6bca5552dcd380e031807442de05a4c Mon Sep 17 00:00:00 2001 From: Daniel Stock Date: Wed, 29 May 2024 22:29:17 +0200 Subject: [PATCH] choose some window config --- main.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/main.js b/main.js index b83faee..98544c4 100644 --- a/main.js +++ b/main.js @@ -1,4 +1,4 @@ -const { app, BrowserWindow } = require('electron/main'); +const { app, BrowserWindow, nativeTheme, Menu } = require('electron/main'); const path = require('node:path'); const fs = require('fs'); const os = require('os'); @@ -72,15 +72,17 @@ async function createWindow() { height: 1080, backgroundColor: '#000000', icon: 'images/icon-512.png', + autoHideMenuBar: true, webPreferences: { preload: path.join(__dirname, 'preload.js'), - nodeIntegration: true, webSecurity: false, + disableDialogs: true }, - show: false, - autoHideMenuBar: true }); + nativeTheme.themeSource = 'dark'; + Menu.setApplicationMenu(null); + // register event callbacks win.on("closed", function () { win = null; }); win.webContents.on("will-frame-navigate", (event) => validateDomain(event));