Skip to content

Commit

Permalink
Added back and forward features
Browse files Browse the repository at this point in the history
  • Loading branch information
supersu-man committed Oct 5, 2021
1 parent d372d00 commit 6330f84
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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() }
Expand Down

0 comments on commit 6330f84

Please sign in to comment.