I read this post. Because I have same problem. I try to get v8context from mainframe it returns nil and said that the person on the forum had the same problem.
Because I need to call;
Code: Select all
V8Context.Enter
..Create some object
V8Context.Exit;
According to the answer given in stackoverflow, they took the v8context value in the mainframe and worked it in C++.
https://stackoverflow.com/questions/988 ... utefunctioI had the same problem on C++! And I have solved it with following code:
CefRefPtr<CefFrame> frame = browser->GetMainFrame();
CefRefPtr<CefV8Context> v8Context = frame->GetV8Context();
if (v8Context.get() && v8Context->Enter())
{
CefRefPtr<CefV8Value> object = CefV8Value::CreateObject(NULL);
// ExecuteFunctionWithContext and other actions
v8Context->Exit();
}
Please Help.