(direction: "back" | "forward")
| 1161 | // focused window's navigation history. canGo* guards keep the keys no-ops at |
| 1162 | // the ends of the stack, matching how they behave in a browser. |
| 1163 | const navigateHistory = (direction: "back" | "forward") => { |
| 1164 | const nav = BrowserWindow.getFocusedWindow()?.webContents.navigationHistory; |
| 1165 | if (!nav) return; |
| 1166 | if (direction === "back") { |
| 1167 | if (nav.canGoBack()) nav.goBack(); |
| 1168 | } else if (nav.canGoForward()) { |
| 1169 | nav.goForward(); |
| 1170 | } |
| 1171 | }; |
| 1172 | const historyMenu: MenuItemConstructorOptions = { |
| 1173 | label: "History", |
| 1174 | submenu: [ |
no outgoing calls
no test coverage detected