Black screen appears when the browser loads for the 1st time

Having problems with building or using the CefSharp .NET binding? Ask your CEF-related questions here. Please ask general usage questions on StackOverflow.

Moderator: amaitland

Black screen appears when the browser loads for the 1st time

Postby Dhvaj17 » Fri Mar 12, 2021 9:38 am

Hi,

CEF Sharp - V86

I am getting this strange issue and our users have starting complaining about it.

When the cefsharp winform browser loads for the first time, it shows the black window for few mili-seconds and then it disappears.
If we reload or refresh the webpage, it does not happens.

We have recently upgraded from V79 to V86 and we did not had any issue in earlier version.

What i have tried so far is, tried setting below command line arguements but it didn't work.

settings.CefCommandLineArgs.Add("disable-gpu");
settings.CefCommandLineArgs.Add("disable-gpu-compositing");

I have also tried setting
Cef.EnableHighDPISupport()

But it didn't work.

Any help or lead will be appreciated.
Dhvaj17
Techie
 
Posts: 19
Joined: Fri Oct 16, 2020 4:51 am

Re: Black screen appears when the browser loads for the 1st

Postby amaitland » Fri Mar 12, 2021 5:16 pm

Continue discussion at viewtopic.php?f=6&t=11526
Maintainer of the CefSharp project.
amaitland
Master
 
Posts: 969
Joined: Wed Jan 14, 2015 2:35 am

Re: Black screen appears when the browser loads for the 1st

Postby Dhvaj17 » Mon Mar 15, 2021 3:29 am

amaitland wrote:Continue discussion at viewtopic.php?f=6&t=11526


Issue is happening in latest CEF Version i.e V88.

Checked with CEFSharp Minimal Example kept here
https://github.com/cefsharp/CefSharp.MinimalExample

When we load CefSharp winform browser in wpf application using winform host, a black screen appears on load for the first time for few miliseconds and then disappears.

This was not happening in earlier version.(i checked with V79).

Steps to reproduce.
1. Create a sample wpf application ,use windowsformhost to load cefsharp winform browser.
2. In constructor of winform browser, use any url. I tested with www.googlecom.
3. Run the application.
3. Notice the initial black screen appears for few miliseconds and then disappears and loads the url.

Please note this happens only for the first time when the chrome winform loads and later any url loaded into it works fine.

Can anyone please suggest or help
Dhvaj17
Techie
 
Posts: 19
Joined: Fri Oct 16, 2020 4:51 am

Re: Black screen appears when the browser loads for the 1st

Postby Dhvaj17 » Mon Mar 15, 2021 5:11 am

This is working fine till v83.
From v84 - [84.0.4147.105], this seems to be broken and issue is also reproducible in latest V88.
Dhvaj17
Techie
 
Posts: 19
Joined: Fri Oct 16, 2020 4:51 am

Re: Black screen appears when the browser loads for the 1st

Postby amaitland » Mon Mar 15, 2021 5:38 am

Does the problem reproduce with the WinForms example?

You can also test with https://github.com/cefsharp/CefSharp.Wpf.HwndHost

As this doesn't appear to be a CefSharp specific issue using the other topic would be preferable.
Maintainer of the CefSharp project.
amaitland
Master
 
Posts: 969
Joined: Wed Jan 14, 2015 2:35 am

Re: Black screen appears when the browser loads for the 1st

Postby Dhvaj17 » Tue Mar 16, 2021 2:50 am

amaitland wrote:Does the problem reproduce with the WinForms example?

You can also test with https://github.com/cefsharp/CefSharp.Wpf.HwndHost

As this doesn't appear to be a CefSharp specific issue using the other topic would be preferable.



It works fine with winform example. It is only a problem with a cross browser(i mean using chrome winform browser in WPFApplication via WindowsFormHost Control)

Sample code:

MainWindow.xaml

<Border Grid.Row="1" BorderThickness="0,1">
<WindowsFormsHost Name="Host">
</WindowsFormsHost>
</Border>

MainWindow.xaml.cs

public partial class MainWindow : Window
{
public MainWindow()
{
var Browser = new CefSharp.WinForms.ChromiumWebBrowser("www.google.com");
InitializeComponent();
Host.Child = Browser;
}
}
Dhvaj17
Techie
 
Posts: 19
Joined: Fri Oct 16, 2020 4:51 am

Re: Black screen appears when the browser loads for the 1st

Postby amaitland » Tue Mar 16, 2021 3:46 am

Maintainer of the CefSharp project.
amaitland
Master
 
Posts: 969
Joined: Wed Jan 14, 2015 2:35 am

Re: Black screen appears when the browser loads for the 1st

Postby Dhvaj17 » Tue Mar 16, 2021 4:34 am

amaitland wrote:Did you test with https://github.com/cefsharp/CefSharp.Wpf.HwndHost


I am same seeing the same issue happening with the above mentioned app.

A black screen appears for few mili-seconds and then disappears once the content loads.
Dhvaj17
Techie
 
Posts: 19
Joined: Fri Oct 16, 2020 4:51 am

Re: Black screen appears when the browser loads for the 1st

Postby amaitland » Tue Mar 16, 2021 4:50 am

Based on that I think it's likely a chromium change that's causing this.

You can take the last working branch and upgrade it to a newer version of CEF, that should exclude any CefSharp specific changes.
Maintainer of the CefSharp project.
amaitland
Master
 
Posts: 969
Joined: Wed Jan 14, 2015 2:35 am


Return to CefSharp Forum

Who is online

Users browsing this forum: No registered users and 1 guest