-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
OffScreen - ChromeRuntime doesn't work with LoadURL #4832
Comments
Given it works with the alloy runtime this likely needs to be fixed in CEF. |
@GrabzIt Looking at the code in more detail, can you defer creation of the browser until after you've subscribed to the event? e.g. // Create the CefSharp.OffScreen.ChromiumWebBrowser instance
using (var browser = new ChromiumWebBrowser(testUrl, automaticallyCreateBrowser:false))
{
browser.FrameLoadEnd += Browser_FrameLoadEnd;
browser.CreateBrowser();
// Wait
Thread.Sleep(20000);
} |
Thanks, this approach works and seems to work with further calls to LoadURL and adding and removing the event: e.g.
Is this the way it should be used from now or are the CEF changes to the chrome runtime going to fix the issue? |
That would be my recommendation. Pretty sure I modified most of the examples/tests a while back to use this approach. If there are any outstanding then happy to update them.
From a |
That sounds great thanks. |
Is there an existing issue for this?
CefSharp Version
125.0.210
Operating System
Windows 10
Architecture
x64
.Net Version
.NET 6.0
Implementation
OffScreen
Reproduction Steps
Expected behavior
This should load the url and display a screenshot but when ChromeRuntime = true it never works. However, it does if you remove ChromeRuntime = true.
Actual behavior
It never fires the browser loaded event.
Regression?
No response
Known Workarounds
No response
Does this problem also occur in the CEF Sample Application
Yes using WPF/OffScreen command line args
Other information
No response
The text was updated successfully, but these errors were encountered: