代码之家  ›  专栏  ›  技术社区  ›  Dejell

Gecko Xpcom使用与WebKit

  •  3
  • Dejell  · 技术社区  · 14 年前

    我需要在C++应用程序中嵌入一个Web浏览器。此外,我还需要从Delphi组件中获得它的javascript方法。

    我知道在FF里面有一只壁虎和Xpcom。webkit有类似的东西吗?

    2 回复  |  直到 14 年前
        1
  •  7
  •   plaes    14 年前

    webkit-first:有一个名为chromium-embedded的项目(chromium基本上是webkit渲染引擎和v8-javascript引擎),也有 Delphi support . 在快速查看标题之后,我没有找到访问JS方法的方法,但它允许在给定的框架中执行javascript片段:

    // Execute a string of JavaScript code in this frame. The |script_url|
    // parameter is the URL where the script in question can be found, if any. The
    // renderer may request this URL to show the developer the source of the
    // error.  The |start_line| parameter is the base line number to use for error
    // reporting.
    execute_java_script: procedure(self: PCefFrame; const jsCode, scriptUrl: PWideChar; startLine: Integer); stdcall;
    

    所以这些碎片就在那里,你只需要弄清楚如何把它们拼在一起。

    对于gecko,在一个名为 d-gecko . 但它似乎有点过时,而且似乎不允许访问JavaScript。

        2
  •  2
  •   Darin Dimitrov    14 年前

    你可以看看 this project 它允许您在Delphi应用程序中嵌入Chromium Web浏览器。