diff --git a/packages/insomnia/src/main/window-utils.ts b/packages/insomnia/src/main/window-utils.ts index 2057d0071f..e98edc506d 100644 --- a/packages/insomnia/src/main/window-utils.ts +++ b/packages/insomnia/src/main/window-utils.ts @@ -25,7 +25,7 @@ import { docsBase } from '../common/documentation'; import { getElectronStorage } from './electron-storage'; import { ipcMainOn } from './ipc/electron'; import { getLogDirectory } from './log'; -import { createPluginWindow, destroyPluginWindow } from './plugin-window'; +import { createPluginWindow, destroyPluginWindow, getPluginWindow } from './plugin-window'; import { MAIN_WINDOW_SECURITY } from './window-security'; const DEFAULT_WIDTH = 1280; @@ -634,6 +634,21 @@ export function createWindow(): ElectronBrowserWindow { hiddenBrowserWindow ? stopHiddenBrowserWindow() : createHiddenBrowserWindow(); }, }, + { + label: 'Show/hide plugin browser window ', + click: () => { + const pluginWindow = getPluginWindow(); + invariant(pluginWindow, 'pluginWindow is not defined'); + pluginWindow.isVisible() ? pluginWindow.hide() : pluginWindow.show(); + }, + }, + { + label: 'Stop/start plugin browser window ', + click: () => { + const pluginWindow = getPluginWindow(); + pluginWindow ? destroyPluginWindow() : createPluginWindow(); + }, + }, { // Simulates the OS "Open folder in Insomnia" flow without a packaged build // (Finder association / protocol handler only register for an installed app).