From 6330f84abbc5fae4abd588e0baf39987f370bd5e Mon Sep 17 00:00:00 2001 From: Sumanth Perambuduri <35676632+supersu-man@users.noreply.github.com> Date: Tue, 5 Oct 2021 22:12:39 +0530 Subject: [PATCH] Added back and forward features --- src/index.js | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 185b583..846a847 100644 --- a/src/index.js +++ b/src/index.js @@ -22,7 +22,21 @@ electron.app.on('browser-window-created', (e,window) => { } window.center() window.setIcon(path.join(__dirname, '../icon.png')) - window.setMenu(null) + menu = Menu.buildFromTemplate([ + { + label: 'Back', + click() { window.webContents.goBack() } + }, + { + label:'Forward', + click() { window.webContents.goForward() } + }, + { + label: 'Reload', + role: 'reload' + } + ]) + window.setMenu(menu) }) function openMainWindow() { @@ -147,6 +161,14 @@ function checkForUpdate() { function createMenu() { menu = Menu.buildFromTemplate([ + { + label: 'Back', + click() { window.webContents.goBack() } + }, + { + label:'Forward', + click() { window.webContents.goForward() } + }, { label: 'Home', click() { openCard() }