(
webContents: electron.WebContents,
callbacks: AppMenuCallbacks,
isBuilderWindowFocused: boolean,
fullscreenOnLaunch: boolean
)
| 201 | } |
| 202 | |
| 203 | function makeViewMenu( |
| 204 | webContents: electron.WebContents, |
| 205 | callbacks: AppMenuCallbacks, |
| 206 | isBuilderWindowFocused: boolean, |
| 207 | fullscreenOnLaunch: boolean |
| 208 | ): Electron.MenuItemConstructorOptions[] { |
| 209 | const devToolsAccel = unamePlatform === "darwin" ? "Option+Command+I" : "Alt+Shift+I"; |
| 210 | return [ |
| 211 | { |
| 212 | label: isBuilderWindowFocused ? "Reload Window" : "Reload Tab", |
| 213 | accelerator: "Shift+CommandOrControl+R", |
| 214 | click: (_, window) => { |
| 215 | (getWindowWebContents(window) ?? webContents)?.reloadIgnoringCache(); |
| 216 | }, |
| 217 | }, |
| 218 | { |
| 219 | label: "Relaunch All Windows", |
| 220 | click: () => callbacks.relaunchBrowserWindows(), |
| 221 | }, |
| 222 | { |
| 223 | label: "Clear Tab Cache", |
| 224 | click: () => clearTabCache(), |
| 225 | }, |
| 226 | { |
| 227 | label: "Toggle DevTools", |
| 228 | accelerator: devToolsAccel, |
| 229 | click: (_, window) => { |
| 230 | const wc = getWindowWebContents(window) ?? webContents; |
| 231 | wc?.toggleDevTools(); |
| 232 | }, |
| 233 | }, |
| 234 | { type: "separator" }, |
| 235 | { |
| 236 | label: "Reset Zoom", |
| 237 | accelerator: "CommandOrControl+0", |
| 238 | click: (_, window) => { |
| 239 | const wc = getWindowWebContents(window) ?? webContents; |
| 240 | if (wc) { |
| 241 | resetZoomLevel(wc); |
| 242 | } |
| 243 | }, |
| 244 | }, |
| 245 | { |
| 246 | label: "Zoom In", |
| 247 | accelerator: "CommandOrControl+=", |
| 248 | click: (_, window) => { |
| 249 | const wc = getWindowWebContents(window) ?? webContents; |
| 250 | if (wc) { |
| 251 | increaseZoomLevel(wc); |
| 252 | } |
| 253 | }, |
| 254 | }, |
| 255 | { |
| 256 | label: "Zoom In (hidden)", |
| 257 | accelerator: "CommandOrControl+Shift+=", |
| 258 | click: (_, window) => { |
| 259 | const wc = getWindowWebContents(window) ?? webContents; |
| 260 | if (wc) { |
no test coverage detected