New CefBrowser instances sometimes show blank screen

3,111 views
Skip to first unread message

Michael Nannola

unread,
Nov 5, 2013, 10:00:36 AM11/5/13
to cef...@googlegroups.com
I have a pretty strange issue that I have not seen mentioned anywhere on these boards that is causing me some headaches.  In my Win Form application, sometimes when I create
a new instance of CefBrowser, nothing is rendered on the screen, it just shows a blank page.

The strange thing about it is that if I use the Refresh command, the screen will still not show anything.  No matter how many times I refresh, nothing is shown.  If I save the source of the page, everything looks fine in the HTML code loaded into the browser.  The only way to get the browser to render is to close the window, and start a new instance of CefBrowser.

This happens about one out of every 4-6 times that I start an instance of a browser.  The rest of the time, everything works perfectly.  

This issue occurs in both SingleProcess and MultiProcess mode.  The Verbose logs don't show anything different when the window is blank versus when the window shows HTML.

Using Visual Studio 2010, Windows 7 64bit, Cef 3.1547.1448.

Anyone have any ideas  or seen this behavior before?

Dmitry Azaraev

unread,
Nov 5, 2013, 11:55:55 AM11/5/13
to cef...@googlegroups.com
Sounds like browser's window size did not initalized (resized) properly. Try to log to file size changes inside browser control, or force it to resize once you see that it is not shown.


--
You received this message because you are subscribed to the Google Groups "CefGlue" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cefglue+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Best regards,
   Dmitry

Michael Nannola

unread,
Nov 5, 2013, 1:17:12 PM11/5/13
to cef...@googlegroups.com, dmitry....@gmail.com
After testing, I don't believe this is the issue.  I logged out the window's width and height and see the same logging in a successful browser instance and an unsuccessful one.  I also attempted re-sizing the window on the unsuccessful instance and I continued to see a blank screen.  

Any other thoughts?  I appreciate the help.

Dmitry Azaraev

unread,
Nov 5, 2013, 2:12:08 PM11/5/13
to cef...@googlegroups.com
Hm. You check both sizes of underlying browser's window and control's sizes?

Did you have any minimal sample which can reproduce problem?

idan p

unread,
Nov 16, 2013, 8:25:51 AM11/16/13
to cef...@googlegroups.com, dmitry....@gmail.com
I have encountered this item as well (we call it the "White screen of death" :-)).
In my case, I don't see the renderer process (I only get the browser process and the gpu process).
Can you check this on your side?

Dmitry Azaraev

unread,
Nov 17, 2013, 5:54:04 PM11/17/13
to cef...@googlegroups.com
Sorry, for long delay.
You probably should enable CEF verbose logging and looking something interesting in it, once you got "white screen of death"... I'm never see similar issue.

Michael Nannola

unread,
Nov 18, 2013, 12:17:41 PM11/18/13
to cef...@googlegroups.com
Verbose logging does not seem to show anything different when a blank screen appears versus when the correct content shows.

I am now thinking this problem is related to the LoadString method due to this issue on CEF: https://code.google.com/p/chromiumembedded/issues/detail?id=797

Now I will try and rework parts of my application to load this data in another way and see if that corrects these issues.  I will report back when this has been tested.

Dmitry Azaraev

unread,
Nov 18, 2013, 12:31:15 PM11/18/13
to cef...@googlegroups.com
You call LoadString immediately?
Try create browser with about:blank and wait for some loading completed events, and then call LoadString/LoadUrl.
For quick-try call LoadString after some delay.


--
You received this message because you are subscribed to the Google Groups "CefGlue" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cefglue+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Best regards,
   Dmitry

idan p

unread,
Nov 19, 2013, 4:38:07 AM11/19/13
to cef...@googlegroups.com, dmitry....@gmail.com
After Dmitry talked about resize...I have seen the following code:
            var form = TopLevelControl as Form;
            if (form != null && form.WindowState != FormWindowState.Minimized)
            {
                ResizeWindow(_browserWindowHandle, Width, Height);
            }

This means that if you set the browser size before you actually attach it to the form, you will miss the actual ResizeWindow function.
Not sure whether it's going to affect your code, but can you try plugging the browser to the form before setting its size (by size or by dock)?

Regards,
Idan

Jiangyuan He

unread,
Mar 6, 2014, 1:54:17 AM3/6/14
to cef...@googlegroups.com
Nannola: have you resolved this problem. I met same problem in winform win7 cef 3.1650.1617

在 2013年11月5日星期二UTC+8下午11时00分36秒,Michael Nannola写道:

Michael Nannola

unread,
Mar 6, 2014, 10:46:32 AM3/6/14
to cef...@googlegroups.com
I do not believe it is 100 percent resolved, but the problem has occurred much less frequently after I upgraded to CEF 3.1650.1522.  
One thing I did was replace most of my LoadString methods with LoadRequest, and pass in a CefRequest object.  This was done around the same time I upgraded to 1522, so I can't say for sure which one of these reduced the frequency of the issue.

If it happens again I will try and reproduce it and report back.


--
You received this message because you are subscribed to a topic in the Google Groups "CefGlue" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cefglue/VtixOYSLrVU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cefglue+u...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.



--
Michael Nannola
512-751-8283
Reply all
Reply to author
Forward
0 new messages