Fixed duplicate calls to OnContextCreated (#5073)

* Added a reload button

* Added checks for V8Context
This commit is contained in:
AgapovAlexsey
2025-04-03 23:17:23 +02:00
committed by GitHub
parent 0c24c64c69
commit 581d0ee6fc
2 changed files with 12 additions and 4 deletions
@@ -131,6 +131,12 @@ namespace CefSharp
_handler->OnContextCreated(% browserWrapper, % frameWrapper, % contextWrapper);
}
//Skip additional contexts (DevTools, extensions) to avoid
//double binding and duplicate calls to IRenderProcessMessageHandler.OnContextCreated
//https://github.com/chromiumembedded/cef/issues/3867
bool isSameContext = frame->GetV8Context()->IsSame(context);
if (!isSameContext)
return;
auto rootObject = GetJsRootObjectWrapper(browser->GetIdentifier(), frame->GetIdentifier());
if (_legacyBindingEnabled)