Hi guys...
How do I customize an error message?
He display a blank page if the computer is offline, how to customize this page?
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.
Customize error message
- salvadordf
- Posts: 4564
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Customize error message
Hi,
You can use the TChromium.OnLoadError event to load a custom web page.
Read this forum thread for more details :
https://www.briskbard.com/forum/viewtopic.php?f=8&t=571
You can use the TChromium.OnLoadError event to load a custom web page.
Read this forum thread for more details :
https://www.briskbard.com/forum/viewtopic.php?f=8&t=571
- danicarla2
- Posts: 19
- Joined: Mon Oct 01, 2018 6:01 pm
- Location: Brazil
Re: Customize error message
When MiniBrowser is offline open a blank page, if I right click and go to "View page source" it displays this code
I like only change this code to
Code: Select all
<html><head></head><body></body></html>
Code: Select all
<html><head></head><body>Internet disconnected :(</body></html>
- salvadordf
- Posts: 4564
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Customize error message
Use TChromium.OnLoadError and check the value of errorCode.
If errorCode is ERR_INTERNET_DISCONNECTED, ERR_ADDRESS_UNREACHABLE, etc... then call TChromium.LoadURL('file://c:/path/error.html');
The file c:/path/error.html can have the contents you mentioned.
Take a look at uCEFConstants.pas for more error codes :
https://github.com/salvadordf/CEF4Delph ... stants.pas
If errorCode is ERR_INTERNET_DISCONNECTED, ERR_ADDRESS_UNREACHABLE, etc... then call TChromium.LoadURL('file://c:/path/error.html');
The file c:/path/error.html can have the contents you mentioned.
Take a look at uCEFConstants.pas for more error codes :
https://github.com/salvadordf/CEF4Delph ... stants.pas
- danicarla2
- Posts: 19
- Joined: Mon Oct 01, 2018 6:01 pm
- Location: Brazil
Re: Customize error message
Thanks, with your help I got it 
