From a6d51588308261ff65055e48d8ecf108fe6b88e8 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 3 Aug 2017 15:03:50 +0100 Subject: [PATCH] electron support for mouse forward/back buttons in Windows Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- electron_app/src/electron-main.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/electron_app/src/electron-main.js b/electron_app/src/electron-main.js index 99e14b7447..ce5ac38413 100644 --- a/electron_app/src/electron-main.js +++ b/electron_app/src/electron-main.js @@ -228,6 +228,17 @@ electron.app.on('ready', () => { } }); + if (process.platform === 'win32') { + // Handle forward/backward mouse buttons in Windows + mainWindow.on('app-command', (e, cmd) => { + if (cmd === 'browser-backward' && mainWindow.webContents.canGoBack()) { + mainWindow.webContents.goBack(); + } else if (cmd === 'browser-forward' && mainWindow.webContents.canGoForward()) { + mainWindow.webContents.goForward(); + } + }); + } + webContentsHandler(mainWindow.webContents); mainWindowState.manage(mainWindow); });