how can i turn off the debug view in electron?i cant find any about it using google

邮差的信 提交于 2020-01-24 03:01:05

问题


every time i run my electron app,it starts like this! always turn the front-end elements view,how can i start my app without this show on GUI? besides,why it goes with black bg? it went well on chrome. thank u,guys


回答1:


The black screen is probably due to the css files routes. Check them.

If you followed the starter electron tutorial, you are most likely calling mainWindow.openDevTools();. Remove that line and you will not get the console.




回答2:


Check if your code is calling openDevTools().




回答3:


Just comment the below code

win.webContents.openDevTools() 

to

// win.webContents.openDevTools() 



回答4:


For me, the bug was with npm caching some sort of preference. Even when I got rid of "openDevTools()", the problem persisted. To fix the problem, I removed my node_modules folder, and re-ran "npm install", and from there everything worked just fine.



来源:https://stackoverflow.com/questions/36733761/how-can-i-turn-off-the-debug-view-in-electroni-cant-find-any-about-it-using-goo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!