OnLoadEnd called erroneously

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.

OnLoadEnd called erroneously

Postby JasonLP » Tue May 03, 2016 9:03 am

I have an application using CEF 3.2623. My application will detect a load error and show a "Waiting for Internet" message if I get an OnLoadError() with an errorCode of ERR_INTERNET_DISCONNECTED (among a couple others used for the same purpose). I retry to load the page after a timeout, and when it finally succeeds, I remove the message. I detect that it succeeds by checking OnLoadEnd with an httpStatusCode of 200. In earlier versions of CEF, this worked properly.

In 3.2623 however, I am seeing the OnLoadEnd is being called with an httpStatusCode of 200, even when the network is turned off. I still get the load errors, but the OnLoadEnd is coming immediately after. I have double checked that the browser and frame objects are both what I am expecting.

Is it a bug that OnLoadEnd with httpStatusCode of 200 is being fired? If not a bug, is there a better way to detect that my page has started to load successfully? (I've looked at OnLoadingStateChange, but this doesn't give me any relevant information about load success.)

This problem exists on both Mac and Windows.

Thank you,
-Jason-
JasonLP
Mentor
 
Posts: 98
Joined: Fri Jul 25, 2014 10:10 am

Re: OnLoadEnd called erroneously

Postby fddima » Tue May 03, 2016 9:55 am

Check URL in OnLoadEnd. In case of failure it load internal page with special url, which is available only in OnLoadEnd (but not at OnLoadStart). So you probably spoof this request and miss original.
fddima
Master
 
Posts: 788
Joined: Tue Dec 07, 2010 6:10 am

Re: OnLoadEnd called erroneously

Postby JasonLP » Tue May 03, 2016 10:27 am

Aha! Great call. I didn't realize that it did that. Easy to work around.

Thanks!
-Jason-
JasonLP
Mentor
 
Posts: 98
Joined: Fri Jul 25, 2014 10:10 am


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot], ndesktop, richardmgoodin and 47 guests