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.

Blank pages in some machines

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

Blank pages in some machines

Post by thefunkyjoint »

Hi,

I'm trying to find out what is causing this issue : in some machines (usually Windows 7 machines), when i open any website, it never shows anything in TChromium, only a blank page. Any site, google.com, facebook.com and so on. In my environment this problem never happened. What could i do to find out what is causing this and how to solve ?

Thanks !
User avatar
salvadordf
Posts: 4057
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Blank pages in some machines

Post by salvadordf »

Hi,

Are you using the latest CEF4Delphi?

I updated CEF4Delphi today with an alternative method to initialize the browser.

Please read this message :
https://www.briskbard.com/forum/viewtop ... p=597#p597
thefunkyjoint
Posts: 460
Joined: Thu Aug 10, 2017 12:40 pm

Re: Blank pages in some machines

Post by thefunkyjoint »

Hi,

Thanks for your reply ; actually i'm still in the process from migrating from DCEF3 to CEF4, this problem is happening in DCEF3 ; i thought it could be related to CEF itself, that's why i ask here...

I still have some issues from the migration, i think i'll get it working properly in the next weeks.
thefunkyjoint
Posts: 460
Joined: Thu Aug 10, 2017 12:40 pm

Re: Blank pages in some machines

Post by thefunkyjoint »

I could identify the cause of this problem , so i'll share here just in case anyone needs.

The problem was i create the components in runtime and i discovered i need to wait some seconds to the components be ready for use , to then load a webpage. This is why the problem won't happen in all machines : in faster machines, no problem , the components are created fast and ready to use right away. In slower machines the bug happened.

So now i create the components and wait 2 seconds to load a page :)
User avatar
salvadordf
Posts: 4057
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Blank pages in some machines

Post by salvadordf »

Hi,

I added some changes in the component initialization in the last weeks/months.

Now TChromium.CreateBrowser checks if GlobalCEFApp.GlobalContextInitialized is True.

The new demos include a timer to call TChromium.CreateBrowser again if GlobalCEFApp.GlobalContextInitialized was False the first time.
User avatar
salvadordf
Posts: 4057
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Blank pages in some machines

Post by salvadordf »

GlobalCEFApp needs to be created in the DPR file even if the user doesn't use the browser.

If you create GlobalCEFApp after the Application.Initialize call then CEF3 may not be correctly initialized.
User avatar
salvadordf
Posts: 4057
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Blank pages in some machines

Post by salvadordf »

AlexandreP wrote: Tue Jan 30, 2018 12:11 pm Even if all flag are okay ?
It's the recommended way to initialize CEF.

The CEF3 project also recommends to do it in the main application entry-point function :
https://bitbucket.org/chromiumembedded/ ... t-function

If you try to change the initialization and destruction order you may have problems like access violations, initialization failures, etc.
Post Reply