diff --git a/electron/main.js b/electron/main.js index 8c0d32aa8..fe7f500a9 100644 --- a/electron/main.js +++ b/electron/main.js @@ -1,4 +1,4 @@ -const { app, BrowserWindow, Menu, globalShortcut, shell } = require("electron"); +const { app, BrowserWindow, Menu, shell } = require("electron"); const greenworks = require("./greenworks"); if (greenworks.init()) { @@ -22,12 +22,6 @@ function createWindow() { win.loadFile("index.html"); win.show(); if (debug) win.webContents.openDevTools(); - globalShortcut.register("f5", function () { - win.loadFile("index.html"); - }); - globalShortcut.register("f8", function () { - win.loadFile("index.html", { query: { noScripts: "true" } }); - }); win.webContents.on("new-window", function (e, url) { // make sure local urls stay in electron perimeter @@ -55,6 +49,25 @@ function createWindow() { { label: "Select All", accelerator: "CmdOrCtrl+A", selector: "selectAll:" }, ], }, + { + label: "reloads", + submenu: [ + { + label: "reload", + accelerator: "f5", + click: () => { + win.loadFile("index.html"); + }, + }, + { + label: "reload & kill all scripts", + click: () => { + win.webContents.forcefullyCrashRenderer(); + setTimeout(() => win.loadFile("index.html", { query: { noScripts: "true" } }), 5000); + }, + }, + ], + }, ]), );