Local Page not loading/rendering - CEF3904

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Local Page not loading/rendering - CEF3904

Postby mabhatt » Sun Feb 16, 2020 2:21 pm

Hi,

I am trying to load a local page but everytime I am getting "Failed to load URL http://localhost/102-t1.html with error
ERR_FAILED (-2)."
error. After debugging further I saw that the GetViewRect function of renderer is getting called but not onPaint.
I am not sure what I am doing wrong here.

I am using -
cef_binary_78.3.9+gc7345f2+chromium-78.0.3904.108_windows32

--
Thanks,
Manoj
mabhatt
Newbie
 
Posts: 8
Joined: Tue Dec 03, 2019 2:14 pm

Re: Local Page not loading/rendering - CEF3904

Postby ndesktop » Mon Feb 17, 2020 2:50 am

Paint have nothing to do with ERR_FAILED, this is a network error.
AFAIK this is a cache error, either disk or certificate-related.
(Since this is localhost I'm excluding DNS-related errors, but maybe there are weird stuff in hosts file, I can't 100% rule this out either).
ndesktop
Master
 
Posts: 756
Joined: Thu Dec 03, 2015 10:10 am

Re: Local Page not loading/rendering - CEF3904

Postby mabhatt » Mon Feb 17, 2020 1:57 pm

I tried setting up the same in different system, but still same error. I think the problem might be somewhere in my logic where I am parsing the input parameters. My error gone away when I started giving input file name without "file:///"

Error is coming when I am passing url parameter as -
file:///C:/testcef/test.html
mabhatt
Newbie
 
Posts: 8
Joined: Tue Dec 03, 2019 2:14 pm

Re: Local Page not loading/rendering - CEF3904

Postby ndesktop » Mon Feb 17, 2020 3:04 pm

file:// is a different animal. Do you actually have a webserver running on localhost[:80] and 102-t1.html resource available?
ndesktop
Master
 
Posts: 756
Joined: Thu Dec 03, 2015 10:10 am

Re: Local Page not loading/rendering - CEF3904

Postby mabhatt » Mon Feb 17, 2020 5:18 pm

I have resource available but no webserver running on local. I have multiple html files and I am trying out to open them.
mabhatt
Newbie
 
Posts: 8
Joined: Tue Dec 03, 2019 2:14 pm

Re: Local Page not loading/rendering - CEF3904

Postby ndesktop » Tue Feb 18, 2020 2:09 am

If you need a quick-and-dirty webserver, you can set up one with Python 2.7:
- create somewhere a directory C:\temp\htdocs
- in C:\temp\htdocs copy 102-t1.html file
- create C:\temp\htdocs\server.py file:
Code: Select all
import SimpleHTTPServer
import SocketServer

PORT = 80

Handler = SimpleHTTPServer.SimpleHTTPRequestHandler

httpd = SocketServer.TCPServer(("", PORT), Handler)

print "serving at port", PORT
httpd.serve_forever()

Ref: SImpleHTTPServer

- open a command prompt and run
python server.py

Now http://localhost/102-t1.html will be served by server.py. Console will show:
Code: Select all
$ python server.py
serving at port 80
127.0.0.1 - - [18/Feb/2020 09:08:13] "GET /102-t1.html HTTP/1.1" 200 -
127.0.0.1 - - [18/Feb/2020 09:08:13] code 404, message File not found
127.0.0.1 - - [18/Feb/2020 09:08:13] "GET /favicon.ico HTTP/1.1" 404 -
ndesktop
Master
 
Posts: 756
Joined: Thu Dec 03, 2015 10:10 am

Re: Local Page not loading/rendering - CEF3904

Postby mabhatt » Thu Mar 05, 2020 4:55 pm

I finally figured out the problem. It was happening because of the network service enablement for newer branches.
I upgraded my cef branch from cef3202 to cef3904 which did not work.
After reading this https://bitbucket.org/chromiumembedded/cef/issues/2622/implement-support-for-networkservice I switched back to 3809 but again this has another issue where windows 7 library wasn't linking -
cef_sandbox.lib(md5_boringssl.obj) : error LNK2019: unresolved external symbol _MD5_Init referenced in function "void __cdecl base::MD5Init(struct md5_state_st *)" (?MD5Init@base@@YAXPAUmd5_state_st@@@Z)
So went back a little down 3770 which finally worked for me.

I never ever worked on such large C++ code base but one thing I absolutely appreciate is the documentation of CEF. Now, I'll restart reading my novel since my code started working.
Thanks @ndesktop for the help.
mabhatt
Newbie
 
Posts: 8
Joined: Tue Dec 03, 2019 2:14 pm

Re: Local Page not loading/rendering - CEF3904

Postby ndesktop » Fri Mar 06, 2020 12:44 am

Check this and this, maybe it helps.
Usually is /MD.
ndesktop
Master
 
Posts: 756
Joined: Thu Dec 03, 2015 10:10 am


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot], Majestic-12 [Bot] and 93 guests