Electron app run in 100% CPU


#1

I create a window, when I use win.loadURL(‘main’), the CPU rises to 100%. However, I use win.loadURL(‘http://www.baidu.com’) , the CPU is used only 20%. I see that console shows http 302 and some redirect suggestions. How can I solve this problem. Anyone can help?


#2

According to the docs:

The url can be a remote address (e.g. http://) or a path to a local HTML file using the file:// protocol.

If you link to a local file, you can’t just use the title. It has to be a path.


#3

thanks. However I use the remote address. In another process, it can access the remote address. It stops at the redirect process. It is really weird.
Just now, my boss told me that it maybe the version. I probably used the wrong electron version.