I'm trying to execute JS function on the TID_RENDERER(also tried on TID_UI) with setting:
- Code: Select all
CefSettings cefSettings;
cefSettings.multi_threaded_message_loop = TRUE;
cefSettings.single_process = TRUE;
all sample over Internet tell me that it's must return V8 context:
- Code: Select all
static void _OnExecJSFunc_Worker(CefRefPtr<CefBrowser> browser, SExecJSParams * params, bool * retVal)
{
REQUIRE_RENDERER_THREAD();
CefRefPtr<CefFrame> frame = browser->GetMainFrame();
CefRefPtr<CefV8Context> context = frame->GetV8Context();
}
but context of main frame always zero, i post task with helper from tests like this:
RunOnThread(TID_RENDERER, base::Bind(_OnExecJSFunc_Worker, cefHandler->GetBrowser(), params, &retVal), event);
Tried on 66, latest 67 Windows x86 builds. On https://github.com/adobe/brackets-app/blob/master/src/mac/cefclient/cefclient.cpp example it's done very easily.
Can anybody help about it? What I'm doing wrong? Why context always zero?
P.S. page loaded and complete.