Electron does not respond when calling console.log in the rendering thread

question:
Web pages loaded through electron are running in the rendering process. Call console.log in the js code snippet of the web page to output print information.
however, neither the js code snippet that runs itself during the loading process of the page, nor the js code snippet that is called through the message, has no console.log output.
replace the console.log position with alert ("warning"), and you have the output.

environment:
running environment is windows 10, no matter running in git bash or under the terminal, there is no output

have any friends encountered the same problem? How did it all work out? Was it in the wrong position when it was called?

Thank you!

Mar.25,2021

whether the console.log is divided into the main process or the rendering process. If the console.log is in the main process, it will be output on the command line. If it is the console.log in the rendering process, it will be output in the console in electron. Is windows F12 evoking the console? I can't remember clearly


I also encountered this problem. I can't print it in the rendering process. I can use alert. My development environment is MAC,


. < H2 > [share my solution] < / H2 >

1, scenario restore

I just encountered this problem: the console.log ("") of the rendering process; suddenly does not display.

Top right corner hint:
clipboard.png

levelsdefault

clipboard.png

2

:

clipboard.png

can be solved!

reference address: https://stackoverflow.com/que.

Menu