blank page when using 127.0.0.1 as a url in cefBrowser

184 views
Skip to first unread message

Mohamed Ashraf

unread,
Jul 26, 2021, 1:06:03 PM7/26/21
to CEF Python
I am running flask server that host on 127.0.0.1:5000, when I set the url of the browser it doesn't show anything except blank page

Czarek Tomczak.

unread,
Jul 26, 2021, 3:10:05 PM7/26/21
to CEF Python
You can open Developer Tools window via mouse context menu and see what happens. Check logs as well.

Mohamed Ashraf

unread,
Jul 30, 2021, 12:20:12 PM7/30/21
to CEF Python
There is no error in the console, when I open the same link on external browser like chrome or opera it opens and shows up the content with no problems

Czarek Tomczak.

unread,
Jul 30, 2021, 2:10:06 PM7/30/21
to CEF Python
Debug the problem with Developer Tools. The difference is that cefpython currently embeds old version of Chromium v66.

Mohamed Ashraf

unread,
Aug 26, 2021, 8:20:00 PM8/26/21
to CEF Python
Hi Czarek, I found that adding "allow-insecure-localhost" to the switches solved the problem.

CEF_SWITCHES = {
    "allow-insecure-localhost":"",
}

cef.Initialize(switches=CEF_SWITCHES)

Czarek Tomczak.

unread,
Aug 27, 2021, 11:36:24 AM8/27/21
to CEF Python
First time see that being required.

Mohamed Ashraf

unread,
Aug 27, 2021, 3:25:40 PM8/27/21
to CEF Python
I have tried the same code on another machine and worked without need for this, but on the current machine it doesn't work unless I add that option. I don't understand why this happens but It is working now 

Mohamed Ashraf

unread,
Feb 12, 2022, 10:39:43 AM2/12/22
to CEF Python
If there is someone has the same problem,
make sure you are not using proxy on your machine otherwise it will show you an empty window
to solve this issue even when there is proxy enabled use switch "proxy-server":"direct://", so your code be like this→ 
CEF_SWITCHES = {"proxy-server":"direct://"}
cef.Initialize(switches=CEF_SWITCHES)

if there is something wrong or I am not aware of please tell me
Reply all
Reply to author
Forward
0 new messages