Open mitchcapper opened 3 weeks ago
There are some extensions that will only work with the full Chromium UI
. I think this is likely one of those.
--use-chrome-style-window
I think that'll use the Chromium UI
. Does it show the Chromium menu
? e.g. three dots?
Can you try with --use-native
instead? That should match Chrome Runtime
embedded into a native window.
OK I made a foolish error and must have been attaching to the render process with native only debugging. I noticed just hitting windows key + N with the above cli options to create a new window appears and would then crash. I did a procdump as with these options I didn't even get a chance to attach before crash.
ExtraInfo is null like I mentioned but cefsharp doesn't expect this:
I saw this once before for reasons I don't recall but at the time I thought I traced that it shouldn't have been null.
Officially the docs say
|extra_info| is an optional read-only value originating from CefBrowserHost::CreateBrowser(), CefBrowserHost::CreateBrowserSync(), CefLifeSpanHandler::OnBeforePopup() or CefBrowserView::CreateBrowserView().
In this case tracing back up I see CreateWebView
is called with a nullptr for params.
We do check IsPopup and that comes from cef it seems so not sure if there is another property we should be checking.:
// CefRenderProcessHandler
void CefAppUnmanagedWrapper::OnBrowserCreated(CefRefPtr<CefBrowser> browser, CefRefPtr<CefDictionaryValue> extraInfo)
{
auto wrapper = gcnew CefBrowserWrapper(browser);
_onBrowserCreated->Invoke(wrapper);
//Multiple CefBrowserWrappers created when opening popups
_browserWrappers->TryAdd(browser->GetIdentifier(), wrapper);
//For the main browser only we check LegacyBindingEnabled and
//load the objects. Popups don't send this information and checking
//will override the _legacyBindingEnabled field
if (!browser->IsPopup() && extraInfo && extraInfo.get() != NULL )
{
_legacyBindingEnabled = extraInfo->GetBool("LegacyBindingEnabled");
works and works without the two additional CLI args for multiple crashes from before.
works and works without the two additional CLI args for multiple crashes from before.
Nice work!
Have added check in commit https://github.com/cefsharp/CefSharp/commit/c44f56f5af02d808d21fd3945a300761561a991a
Included in the 130.1.90
release.
Is there anything else required for this?
Is there an existing issue for this?
CefSharp Version
129.0.980
Operating System
Windows 10
Architecture
x64
.Net Version
.net 6.0
Implementation
WinForms
Reproduction Steps
To the WinForm Sample netcore app Program.cs add:
CefSharp.CefSharpSettings.RuntimeStyle = CefRuntimeStyle.Chrome;
Run the WinForm sample app in .net 6 modeInstall any extension that has options by visiting the store page ie: https://chromewebstore.google.com/detail/shortcuts-for-google/baohinapilmkigilbbbcccncoljkdpnd
will prompt to download package can save anywhere it will still install will crash some can ignore just restart now go to chrome://extensions details on the extension and then click options
should get a crash
Expected behavior
not crash show options page
Actual behavior
enable settings.CefCommandLineArgs.Add("renderer-startup-dialog");
to attach to it on spawn (don't need to attach until the one right after you click options)
chrome-extension://baohinapilmkigilbbbcccncoljkdpnd/views/options.html
The crash happens in libcef_dll\cpptoc\render_process_handler_cpptoc.cc
The final line there. extra_info is null, browser is not, both wraps seems to succeed. The Get succeeds. Single stepping right after the final wrap (in theory when OnBrowserCreated is called) you get the crash but you are already in the fatal log message.
The log on verbose shows:
Regression?
probably not
Known Workarounds
unknown work around
Does this problem also occur in the CEF Sample Application
No
Other information
Trying cefclient with:
does not repro the same error, everything works. Given the lack of cefclient reproducing it and the lack of debug stepping there or something to break down no idea what one would debug further.