From 0c2d23d029788c053b735b4f11ebba9577a7d42a Mon Sep 17 00:00:00 2001 From: Amelia Frost Date: Sat, 4 Apr 2026 12:35:06 -0700 Subject: [PATCH] Make it a toggle --- src/native/window.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/native/window.ts b/src/native/window.ts index e19cd39..c4f4190 100644 --- a/src/native/window.ts +++ b/src/native/window.ts @@ -68,6 +68,7 @@ export function createMainWindow() { contextIsolation: true, nodeIntegration: false, spellcheck: true, + devTools: true, }, }); @@ -150,8 +151,12 @@ export function createMainWindow() { ) { event.preventDefault(); mainWindow.webContents.reload(); - } else if(input.key=='F12'){ - mainWindow.webContents.openDevTools({ mode: "detach" }); + } else if (input.key === "F12") { + if (mainWindow.webContents.isDevToolsOpened()) { + mainWindow.webContents.closeDevTools(); + } else { + mainWindow.webContents.openDevTools({ mode: "detach" }); + } } });