Open dev tools only if app is not packaged

This commit is contained in:
everoddandeven 2024-10-16 00:47:23 +02:00
parent 4fb5627ac1
commit 3edd9d52bc

View file

@ -57,7 +57,7 @@ function createWindow(): BrowserWindow {
tray.setContextMenu(trayMenu); tray.setContextMenu(trayMenu);
console.log(`createWindow(): icon = ${wdwIcon}`); console.log(`createWindow(): icon = ${wdwIcon}`);
console.log(`app.isPackaged: ${app.isPackaged}`);
// Create the browser window. // Create the browser window.
win = new BrowserWindow({ win = new BrowserWindow({
x: 0, x: 0,
@ -69,13 +69,13 @@ function createWindow(): BrowserWindow {
nodeIntegration: false, nodeIntegration: false,
allowRunningInsecureContent: (serve), allowRunningInsecureContent: (serve),
contextIsolation: true, contextIsolation: true,
devTools: true devTools: !app.isPackaged
}, },
autoHideMenuBar: true, autoHideMenuBar: true,
icon: wdwIcon icon: wdwIcon
}); });
win.webContents.openDevTools(); if (!app.isPackaged)win.webContents.openDevTools();
if (serve) { if (serve) {
const debug = require('electron-debug'); const debug = require('electron-debug');