feat: always open devtools in external window

This commit is contained in:
Maarten
2023-12-23 11:43:52 +01:00
parent 4f6014a2b4
commit 010e1b89c5
2 changed files with 12 additions and 0 deletions

View File

@@ -331,6 +331,14 @@ window.addEventListener("DOMContentLoaded", () => {
})
})
// make sure devtools open in external window.
window.addEventListener("keydown", (e) => {
e.preventDefault()
if (e.key === "F12" || (e.ctrlKey && e.shiftKey && e.key === "I")) {
ipcRenderer.send("open-devtools")
}
})
ipcRenderer.on("file", (event, file) => {
console.log("path selected by user: " + file)
document.getElementById("checkpath").ariaDisabled = false // Makes the check button active

View File

@@ -76,3 +76,7 @@ ipcMain.on("selectpath", (event) => {
console.log(err)
})
})
ipcMain.on("open-devtools", () => {
mainWindow.webContents.openDevTools({mode: "detach"})
})