(direction: "back" | "forward")
| 1113 | // focused window's navigation history. canGo* guards keep the keys no-ops at |
| 1114 | // the ends of the stack, matching how they behave in a browser. |
| 1115 | const navigateHistory = (direction: "back" | "forward") => { |
| 1116 | const nav = BrowserWindow.getFocusedWindow()?.webContents.navigationHistory; |
| 1117 | if (!nav) return; |
| 1118 | if (direction === "back") { |
| 1119 | if (nav.canGoBack()) nav.goBack(); |
| 1120 | } else if (nav.canGoForward()) { |
| 1121 | nav.goForward(); |
| 1122 | } |
| 1123 | }; |
| 1124 | const historyMenu: MenuItemConstructorOptions = { |
| 1125 | label: "History", |
| 1126 | submenu: [ |
no outgoing calls
no test coverage detected