CEF CefRenderProcessHandler :: OnContextCreated未调用 [英] CEF CefRenderProcessHandler::OnContextCreated not called

查看:936
本文介绍了CEF CefRenderProcessHandler :: OnContextCreated未调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谁曾尝试在CEF中向JavaScript添加本机函数?它不起作用,很容易重新出现:

Who tried add native function to javascript in CEF? It was not work, simple to reappear:


  1. 下载CEF3二进制软件包(1750)

  2. 打开cefclient2010.sln

  3. 打开client_app.cpp,在cefclient项目中

  4. 转到第110行,设置断点

  5. F5

  6. 输入任何URL,任何尝试,断点都不会中断

  1. download the CEF3 binary package (1750)
  2. open cefclient2010.sln
  3. open client_app.cpp which in cefclient project
  4. goto line 110, set a breakpoint
  5. F5
  6. input any url, any try, the breakpoint never breaked

我错过了一些步骤?或某些设置?

Am I missed some steps? or some settings?

推荐答案

我遇到了相同的问题
,必须添加 CefRenderProcessHandler 接口在SimpleApp中,最重要的是必须实现 CefApp :: GetRenderProcessHandler()方法
就像这样:

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;
  }

默认情况下,基类返回NULL ,因此 OnContextCreated()不会调用。

by default, the base class return NULL,so OnContextCreated() will not call.

这篇关于CEF CefRenderProcessHandler :: OnContextCreated未调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆