如何在内置电子应用程序中获取开发工具? [英] How to get dev tools in built electron app?
问题描述
是否可以在内置电子应用程序中显示开发工具?我使用 electron-packager
生成的可执行文件与在命令行中使用 electron
运行的应用程序的行为有所不同,并且我无法查看抛出了哪种异常。
Is it possible to show the dev tools within a built electron app? The executable that I built using electron-packager
is behaving differently from the app run using electron
at the command line, and I have no way to see what kinds of exceptions are being thrown.
推荐答案
是的,可以在打包的应用程序中显示DevTools ,只需调用 someBrowserWindow.webContents.openDevTools()
。如果要使用菜单项和/或键盘快捷键,则需要使用 someBrowserWindow.setMenu(someMenu)
为浏览器窗口创建并设置自己的菜单。
Yes it's possible to show the DevTools in a packaged app, just call someBrowserWindow.webContents.openDevTools()
. If you want a menu item and/or keyboard shortcut to do it then you'll need to create and set your own menu for the browser window using someBrowserWindow.setMenu(someMenu)
.
这篇关于如何在内置电子应用程序中获取开发工具?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!