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.

Navigate (when click on Back button) goes to blank screen

Post Reply
john.augustine
Posts: 48
Joined: Fri Jul 10, 2020 1:33 pm

Navigate (when click on Back button) goes to blank screen

Post by john.augustine »

Hi,

My browser data has Back button ( < ).

Now the issue is, a blank screen is displaying even though there is no previous page exist when i click on Back button.
I mean, need to stop navigating ( Back ) if there is no previous page exist.

Can you please provide your suggestion on this.

Kindly refer the attached screenshots.

Thanks & Regards,
John Augustine
You do not have the required permissions to view the files attached to this post.
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Navigate (when click on Back button) goes to blank screen

Post by salvadordf »

CEF browsers load "about:blank" as the first page if you don't use the TChromium.DefaultURL property.
That's the blank screen the user sees when he/she presses the back button.

Set the TChromium.DefaultURL property to the first address you want to load before calling TChromium.CreateBrowser.
john.augustine
Posts: 48
Joined: Fri Jul 10, 2020 1:33 pm

Re: Navigate (when click on Back button) goes to blank screen

Post by john.augustine »

Thanks much for your suggestion/help.

Actually, we are using "LoadRequest" and not "LoadURL".

Kindly refer the attached screenshot.

Thanks,
John Augustine
You do not have the required permissions to view the files attached to this post.
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Navigate (when click on Back button) goes to blank screen

Post by salvadordf »

Then use the TChromium.OnBeforeBrowse event to allow navigation to "about:blank" only one time.
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Navigate (when click on Back button) goes to blank screen

Post by salvadordf »

I just edited the previous post with a better answer.
john.augustine
Posts: 48
Joined: Fri Jul 10, 2020 1:33 pm

Re: Navigate (when click on Back button) goes to blank screen

Post by john.augustine »

Hi,

Thanks much for your suggestion!

As you mentioned, I have tried this in TChromium.OnBeforeBrowse (kindly refer the attached screenshot (Before_Browse.JPG) for code) but couldn't achieve.

fRequest browser.MainFrame.LoadRequest(fRequest); > Assigning value for fRequest is at method "Display" (kindly refer the attached screenshot (LoadRequest.JPG) for code)

Thanks & Regards,
John
You do not have the required permissions to view the files attached to this post.
john.augustine
Posts: 48
Joined: Fri Jul 10, 2020 1:33 pm

Re: Navigate (when click on Back button) goes to blank screen

Post by john.augustine »

Hi,

Any help on my previous post?

Thanks & Regards,
John
You do not have the required permissions to view the files attached to this post.
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Navigate (when click on Back button) goes to blank screen

Post by salvadordf »

Sorry, I forgot that "about:blank" is a special case that doesn't trigger the "OnBefore..." events in CEF.
https://magpcss.org/ceforum/viewtopic.php?f=6&t=15989
https://magpcss.org/ceforum/viewtopic.php?f=10&t=15950

Try this :
  • Set the TChromium.DefaultURL to a DATA URL which includes your logo or your client's logo or a blank html file. It will be loaded before your request for a few tenths of a second only.
  • Add the TChromium.OnBeforeBrowse to check that the previous DATA URL can only be loaded once.
john.augustine
Posts: 48
Joined: Fri Jul 10, 2020 1:33 pm

Re: Navigate (when click on Back button) goes to blank screen

Post by john.augustine »

Sure, I will try this.

Thanks Much!

Regards,
John
Post Reply