Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Browser display simply blank (first step in trying out CefSharp) #1870

Closed
Coarist opened this issue Nov 23, 2016 · 7 comments
Closed

Browser display simply blank (first step in trying out CefSharp) #1870

Coarist opened this issue Nov 23, 2016 · 7 comments
Labels
duplicate upstream These issues require fixing in the Chromium Embedded Framework(CEF) or Chromium.

Comments

@Coarist
Copy link

Coarist commented Nov 23, 2016

Visual Studio Community 2013, 2015 (tried both)
Nuget method and Package Manager console method (both tried)
C# and VB (tried both)
Windows 10 64-bit

I followed all available beginner's examples, all showed blank webbrowser, none worked on my computer -
Create a .NET 4.5 project (also tried 4.5.2)
set the project to x64
when the project is opened, Nuget or PM install CefSharp.WinForms (tried both)
Add a panel to dock in my WinForm
Add code to initialize CEF
Add code to attach Chrome browser to a panel
Complie and run
But the panel is initially grey, then turned white, and it remained blank forever.

I have checked that in the output directory all Cef files and the locales sub-directory are there.
I have inserted a button to activate DevTools which popped up OK but it is also blank.

Cef initialization seemed to be OK (flag returned OK value)
Browser when adding interrupt handler for finished initializing did generate the correct interrupt (break point inserted)


Update: Confirm rollback CefSharp version from 53 to 51 is functioning as expected - no issue with version 51.

Special thanks for shawty looking into this matter. shawty's response is really helpful to me.

@shawty
Copy link

shawty commented Nov 26, 2016

Just to confirm, this also happens on windows 7 64 bit with the current NuGet version.

Set the actuaql build to 64bit and blank to.

However, set the actual build to 32bit and all works correctly as expected.

When running the 64bit build, we do occasionally get a crash box too:

image

Even when the crash occurs however, CEF still tries to load and initialise

image

Build is winforms, under Visual Studio 2013. Previous versions don't exhibit this behavior.

Code is as follows

` using System.Windows.Forms;
using CefSharp;
using CefSharp.WinForms;

namespace CEFSharp_Intercept
{
  public partial class FrmMainForm : Form
  {
    private ChromiumWebBrowser _chromeBrowser;

    public FrmMainForm()
    {
      InitializeComponent();
      InitializeChromium();
    }

    private void InitializeChromium()
    {
      CefSettings settings = new CefSettings();
      Cef.Initialize(settings);

      //_chromeBrowser = new ChromiumWebBrowser("");
      //_chromeBrowser.LoadHtml("<html><body><h1>Hello world!</h1></body></html>", "http://example/");

      _chromeBrowser = new ChromiumWebBrowser("http://localhost/");

      PnlBrowser.Controls.Add(_chromeBrowser);
      _chromeBrowser.Dock = DockStyle.Fill;

      _chromeBrowser.IsBrowserInitializedChanged += ChromeBrowserIsBrowserInitializedChanged;
    }

    void ChromeBrowserIsBrowserInitializedChanged(object sender, IsBrowserInitializedChangedEventArgs e)
    {
      _chromeBrowser.ShowDevTools();
    }

    private void FrmMainFormFormClosing(object sender, FormClosingEventArgs e)
    {
      Cef.Shutdown();
    }

    private void button1_Click(object sender, System.EventArgs e)
    {
      _chromeBrowser.Load("http://google.co.uk/");
    }

  }
}

`

@shawty
Copy link

shawty commented Nov 26, 2016

@shawty
Copy link

shawty commented Nov 27, 2016

Update:

Trying the same project in VS2015 resulted in exactly the same behavior, however, setting the .NET build to 4.6 rather than 4.6.1 (Which was my default) and changing the CefSharp version from 53 to 51 resolves the issue and allows both X64 and X86 to work as expected.

Iv'e not done any source level analysis yet, and I'm unlikely to get any time to do so, but those are my findings for now.

@amaitland
Copy link
Member

Known Issues

https://github.com/cefsharp/CefSharp/releases/tag/v53.0.0

@amaitland amaitland added duplicate upstream These issues require fixing in the Chromium Embedded Framework(CEF) or Chromium. labels Nov 27, 2016
@shawty
Copy link

shawty commented Nov 28, 2016

Ah, good to know... Thanks.

@keepWalking
Copy link

Is there any workaround for newer version (eg. v67.0) for x64 build?

@shawty
Copy link

shawty commented Oct 17, 2018

I've no idea, I've not used CefSharp for quite sometime now, and since the team have closed this one sometime ago, you'll likely not get an official response here.

My Advice would be to open a new issue in the tracker, and reference this one by linking it.

In the new issue, detail how to reproduce the issue and any findings you already have, that will really help @amaitland and the rest of the team trouble shoot things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate upstream These issues require fixing in the Chromium Embedded Framework(CEF) or Chromium.
Projects
None yet
Development

No branches or pull requests

4 participants