diff --git a/CefSharp.BrowserSubprocess.Core/CefAppUnmanagedWrapper.cpp b/CefSharp.BrowserSubprocess.Core/CefAppUnmanagedWrapper.cpp index df1d7e9f4..928aff733 100644 --- a/CefSharp.BrowserSubprocess.Core/CefAppUnmanagedWrapper.cpp +++ b/CefSharp.BrowserSubprocess.Core/CefAppUnmanagedWrapper.cpp @@ -61,18 +61,6 @@ namespace CefSharp void CefAppUnmanagedWrapper::OnContextCreated(CefRefPtr browser, CefRefPtr frame, CefRefPtr context) { - //Send a message to the browser processing signaling that OnContextCreated has been called - //only param is the FrameId. Currently an IPC message is only sent for the main frame - will see - //how viable this solution is and if it's worth expanding to sub/child frames. - if (frame->IsMain()) - { - auto contextCreatedMessage = CefProcessMessage::Create(kOnContextCreatedRequest); - - SetInt64(contextCreatedMessage->GetArgumentList(), 0, frame->GetIdentifier()); - - browser->SendProcessMessage(CefProcessId::PID_BROWSER, contextCreatedMessage); - } - if (_legacyBindingEnabled) { if (_javascriptObjects->Count > 0) @@ -112,6 +100,18 @@ namespace CefSharp cefSharpObjCamelCase->SetValue(kDeleteBoundObjectCamelCase, unBindObjFunction, CefV8Value::PropertyAttribute::V8_PROPERTY_ATTRIBUTE_NONE); cefSharpObjCamelCase->SetValue(kRemoveObjectFromCacheCamelCase, removeObjectFromCacheFunction, CefV8Value::PropertyAttribute::V8_PROPERTY_ATTRIBUTE_NONE); cefSharpObjCamelCase->SetValue(kIsObjectCachedCamelCase, isObjectCachedFunction, CefV8Value::PropertyAttribute::V8_PROPERTY_ATTRIBUTE_NONE); + + //Send a message to the browser processing signaling that OnContextCreated has been called + //only param is the FrameId. Currently an IPC message is only sent for the main frame - will see + //how viable this solution is and if it's worth expanding to sub/child frames. + if (frame->IsMain()) + { + auto contextCreatedMessage = CefProcessMessage::Create(kOnContextCreatedRequest); + + SetInt64(contextCreatedMessage->GetArgumentList(), 0, frame->GetIdentifier()); + + browser->SendProcessMessage(CefProcessId::PID_BROWSER, contextCreatedMessage); + } }; void CefAppUnmanagedWrapper::OnContextReleased(CefRefPtr browser, CefRefPtr frame, CefRefPtr context)