From 8cce3f4503989e6d64961cbd0722b733cc0e2937 Mon Sep 17 00:00:00 2001 From: TC Date: Thu, 18 Mar 2021 22:02:19 +0100 Subject: [PATCH] Add view/navigation menu --- menu.js | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/menu.js b/menu.js index 222fac90..661929ca 100644 --- a/menu.js +++ b/menu.js @@ -165,6 +165,38 @@ const mainMenuTemplate = (win) => [ }, ], }, + { + label: "View", + submenu: [ + { role: "reload" }, + { role: "forceReload" }, + { type: "separator" }, + { role: "zoomIn" }, + { role: "zoomOut" }, + { role: "resetZoom" }, + ], + }, + { + label: "Navigation", + submenu: [ + { + label: "Go back", + click: () => { + if (win.webContents.canGoBack()) { + win.webContents.goBack(); + } + }, + }, + { + label: "Go forward", + click: () => { + if (win.webContents.canGoForward()) { + win.webContents.goForward(); + } + }, + }, + ], + }, ]; module.exports.mainMenuTemplate = mainMenuTemplate;