Add view/navigation menu

This commit is contained in:
TC
2021-03-18 22:02:19 +01:00
parent c5bda4f3be
commit 8cce3f4503

32
menu.js
View File

@ -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;