Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.

Display http errors on CEF4Delphi

Post Reply
thefunkyjoint
Posts: 460
Joined: Thu Aug 10, 2017 12:40 pm

Display http errors on CEF4Delphi

Post by thefunkyjoint »

When using regular Chrome, if you navigate to a page with HTTP 500 (or other error), Chrome will display this error page :

https://ibb.co/Hr4W0ww

But on Cef4Delphi, when you navigate to this same page, nothing happens, the navigator keeps blank.

Is there a way to Cef4Delphi behave exactly like Chrome in this scenario , ie, show the error page like Chrome shows instead of a blank page ?
User avatar
salvadordf
Posts: 4056
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Display http errors on CEF4Delphi

Post by salvadordf »

Yes, you can use the TChromium.OnLoadError event to load a custom web page with the error information like this :
https://github.com/salvadordf/CEF4Delphi/blob/83a2d5132293816e9d6aa3790f00ff327faf386b/demos/Delphi_VCL/MiniBrowser/uMiniBrowser.pas#L963
Post Reply