(direction: "back" | "forward")
| 997 | // focused window's navigation history. canGo* guards keep the keys no-ops at |
| 998 | // the ends of the stack, matching how they behave in a browser. |
| 999 | const navigateHistory = (direction: "back" | "forward") => { |
| 1000 | const nav = BrowserWindow.getFocusedWindow()?.webContents.navigationHistory; |
| 1001 | if (!nav) return; |
| 1002 | if (direction === "back") { |
| 1003 | if (nav.canGoBack()) nav.goBack(); |
| 1004 | } else if (nav.canGoForward()) { |
| 1005 | nav.goForward(); |
| 1006 | } |
| 1007 | }; |
| 1008 | const historyMenu: MenuItemConstructorOptions = { |
| 1009 | label: "History", |
| 1010 | submenu: [ |
no outgoing calls
no test coverage detected