Make back/forward/refresh work the same as the arrow button in topbar (#3720)

Signed-off-by: Hung-Han (Henry) Chen <chenhungh@gmail.com>
This commit is contained in:
chh authored and GitHub committed 2021-09-02 14:21:36 +03:00
1 parent 40a2d9e05c
commit d6d66682f6
2 files changed
+6 -4

No files matched your search

+2 -2
View File
@@ -188,14 +188,14 @@ export function buildMenu(windowManager: WindowManager) {
label: "Back",
accelerator: "CmdOrCtrl+[",
click() {
webContents.getFocusedWebContents()?.goBack();
webContents.getAllWebContents().filter(wc => wc.getType() === "window").forEach(wc => wc.goBack());
}
},
{
label: "Forward",
accelerator: "CmdOrCtrl+]",
click() {
webContents.getFocusedWebContents()?.goForward();
webContents.getAllWebContents().filter(wc => wc.getType() === "window").forEach(wc => wc.goForward());
}
},
{
+4 -2
View File
@@ -243,8 +243,10 @@ export class WindowManager extends Singleton {
if (frameInfo) {
this.sendToView({ channel: IpcRendererNavigationEvents.RELOAD_PAGE, frameInfo });
} else {
webContents.getFocusedWebContents()?.reload();
webContents.getFocusedWebContents()?.clearHistory();
webContents.getAllWebContents().filter(wc => wc.getType() === "window").forEach(wc => {
wc.reload();
wc.clearHistory();
});
}
}