Reputation: 65
Who tried add native function to javascript in CEF? It was not work, simple to reappear:
Am I missed some steps? or some settings?
Upvotes: 1
Views: 5430
Reputation: 51
i had the same problem
you must add CefRenderProcessHandler interface in SimpleApp ,then the most important is you must implement CefApp::GetRenderProcessHandler() method
.
just like this:
virtual CefRefPtr<CefRenderProcessHandler> GetRenderProcessHandler() {
return this;
}
by default, the base class return NULL,so OnContextCreated()
will not call.
Upvotes: 5
Reputation: 2735
By default sample CEF application is multi-process. Either attach CEF render process to the debugger or simply do following (force the CEF app run into single process mode):
CefSettings settings;
#ifdef _DEBUG
settings.single_process = true;
#endif
Upvotes: 1
Reputation: 1674
Perhaps it has something to do with the process model? How can you tell if the function is getting called? If by using a debugger, make sure you attached all child-processes too.
Upvotes: 2