mardi 28 février 2017

How can I support window.external.xxx in cef framework

I want to switch from an embedded IE activeX to the libcef framework. My web project's javascript call C++ function use window.external.xxx method. But I can't get window.external object in cef framework. I try to bind my c++ function in window object. sadly, it doesn't work for me.

My code for binding c++ function to window object is like that:

CefRefPtr<CefV8Value> ptrGlobalObj = context->GetGlobal();
CefRefPtr<CefV8Value> jsCallOrthoLink = CefV8Value::CreateFunction(_T("CallOrthoLink"), m_ptrV8Handler);
ptrGlobalObj->SetValue(_T("CallOrthoLink"), jsCallOrthoLink, V8_PROPERTY_ATTRIBUTE_NONE);

I test it with window.xxx method in javascript. it works. so I know my bind codes are correctly.

How can I fixed this issue with window.external.xxxx method?

Thanks.

Aucun commentaire:

Enregistrer un commentaire