From e66c64350ffe6b43818f010c106b2b832cb8c9f4 Mon Sep 17 00:00:00 2001 From: hugo Date: Wed, 11 Feb 2026 09:19:16 +0100 Subject: [PATCH] fix: dev-tools work again --- src/main/main.ts | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/main/main.ts b/src/main/main.ts index 70232f5..610518b 100644 --- a/src/main/main.ts +++ b/src/main/main.ts @@ -37,6 +37,7 @@ function createWindow(): void { nodeIntegration: false, contextIsolation: true, sandbox: false, + devTools: true, }, icon: path.join(__dirname, '../../assets/icon.png'), }); @@ -45,6 +46,16 @@ function createWindow(): void { const menu = createApplicationMenu(); Menu.setApplicationMenu(menu); + // Register keyboard shortcuts for DevTools via before-input-event (more reliable) + mainWindow.webContents.on('before-input-event', (event, input) => { + // F12 or Ctrl+Shift+I to toggle DevTools + if (input.key === 'F12' || + (input.control && input.shift && input.key.toLowerCase() === 'i')) { + mainWindow?.webContents.toggleDevTools(); + event.preventDefault(); + } + }); + // Load the app - use built files unless explicitly in dev mode const rendererPath = path.join(__dirname, '../renderer/index.html'); if (isDev) { @@ -186,7 +197,13 @@ function createApplicationMenu(): Menu { { type: 'separator' }, { role: 'reload' }, { role: 'forceReload' }, - { role: 'toggleDevTools' }, + { + label: 'Toggle Developer Tools', + accelerator: process.platform === 'darwin' ? 'Cmd+Option+I' : 'Ctrl+Shift+I', + click: () => { + mainWindow?.webContents.toggleDevTools(); + }, + }, { type: 'separator' }, { role: 'resetZoom' }, { role: 'zoomIn' },