-
-
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
Extension Option Pages fail to load with Chrome runtime in WinForms or Wpf.HwndHost #4963
Comments
There are some extensions that will only work with the full
I think that'll use the Can you try with |
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 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. |
- Looks like when Chromium creates it's own windows we don't get a reference to the object Issue #4963
Nice work! Have added check in commit c44f56f Included in the Is there anything else required for this? |
This fixed it. You can still get a crash here but thats really only if custom hosting and not really extension related #4980 |
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 mode
Install 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.
The text was updated successfully, but these errors were encountered: