diff --git a/packages/bruno-app/src/components/Sidebar/TitleBar/index.js b/packages/bruno-app/src/components/Sidebar/TitleBar/index.js index daaf1f452..ebf8c608d 100644 --- a/packages/bruno-app/src/components/Sidebar/TitleBar/index.js +++ b/packages/bruno-app/src/components/Sidebar/TitleBar/index.js @@ -18,6 +18,7 @@ const TitleBar = () => { const [importCollectionModalOpen, setImportCollectionModalOpen] = useState(false); const [importCollectionLocationModalOpen, setImportCollectionLocationModalOpen] = useState(false); const dispatch = useDispatch(); + const { ipcRenderer } = window; const handleImportCollection = (collection) => { setImportedCollection(collection); @@ -50,6 +51,10 @@ const TitleBar = () => { ); }; + const openDevTools = () => { + ipcRenderer.invoke('renderer:open-devtools'); + }; + return ( {createCollectionModalOpen ? setCreateCollectionModalOpen(false)} /> : null} @@ -104,6 +109,15 @@ const TitleBar = () => { > Import Collection +
{ + menuDropdownTippyRef.current.hide(); + openDevTools(); + }} + > + Devtools +
diff --git a/packages/bruno-electron/src/ipc/collection.js b/packages/bruno-electron/src/ipc/collection.js index 864aff82e..03a15305b 100644 --- a/packages/bruno-electron/src/ipc/collection.js +++ b/packages/bruno-electron/src/ipc/collection.js @@ -486,6 +486,10 @@ const registerRendererEventHandlers = (mainWindow, watcher, lastOpenedCollection return Promise.reject(error); } }); + + ipcMain.handle('renderer:open-devtools', async () => { + mainWindow.webContents.openDevTools(); + }); }; const registerMainEventHandlers = (mainWindow, watcher, lastOpenedCollections) => {