如何在 Delphi 应用程序中嵌入除 IE 之外的浏览器对象

发布于 2024-07-06 09:31:17 字数 216 浏览 5 评论 0 原文

使用默认的 TWebBrowser 可以轻松嵌入 Web 浏览器。 不幸的是,默认情况下出现的是 IE

我想知道如何集成 Gecko 或 WebKit。

  1. 有没有 VCL 的例子?
  2. 如果没有,人们将如何去做呢?
  3. 在哪里可以找到可嵌入格式的 Gecko 和/或 WebKit 核心的最佳位置?

Using the default TWebBrowser makes things easy to embed a web browser. Unfortunately the one that comes in by default is IE<n>.

I'm wondering how does one integrate a Gecko or WebKit one.

  1. Are there VCL examples somewhere?
  2. If not, how would one go about doing it?
  3. Where's the best place to find the core for Gecko and/or WebKit in an embeddable format?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

眸中客 2024-07-13 09:31:17

TWebBrowser IE。 它不是浏览器的可插入结构。 您可以将其他浏览器集成到您的应用程序中。 请参阅

时间已经过去了

这个答案来自 '08 年以来然后时间就过去了。 这些链接不再有效,现在可能有更好的替代方案。

TWebBrowser is IE. It is not a plugable construction for browsers. You can have other browsers integrated in your application. See

Time has moved on

This answer is from '08 and since then time has moved on. The links don't work anymore and there are probably better alternatives now.

海夕 2024-07-13 09:31:17

一个可行的替代方案是 CEF - Chromium 嵌入式框架,它封装了 Chromium 浏览器,而 Chromium 浏览器本身又封装了 WebKit。 该库以带有导出的 C API 的纯 DLL 形式提供。

code.google.com/p/delphichromiumembedded 有一个 delphi 界面,

我一直在使用它使用我自己的界面实现,效果很好,虽然不像 THTML 或 IE 那样容易正确使用,但对于需要功能强大的嵌入式浏览器的人来说非常有用。

A viable alternative is CEF - Chromium Embedded Framework which encapsulates the Chromium browser which by itself encapsulates WebKit. This library is provided as plain DLLs with an exported C API.

There's a delphi interface available at code.google.com/p/delphichromiumembedded

I've been using it with my own interface implementation and works great, though not so easy to properly use as THTML or IE, but great for whoever needs a powerful and embeddable browser.

眼泪都笑了 2024-07-13 09:31:17

编辑: 遗憾的是,Lars 抢先了我。

有一个基于 Gecko 引擎的 ActiveX 控件,它试图呈现 IWebBrowser API(TWebBrowser 使用的)的精确副本。

您可以在这里找到它: http://www.iol.ie/~locka/ mozilla/control.htm
不幸的是,它似乎已经有一段时间没有更新了。 最后一个版本基于 Gecko 1.7.12,我相信 Gecko 目前最高为 1.9.x(在 Firefox 3 中使用)

Edit: Lars beat me to it, unfortunately

Well there is an ActiveX control based on the Gecko engine that tries to present an exact copy of the IWebBrowser API (which TWebBrowser uses).

You can find it here: http://www.iol.ie/~locka/mozilla/control.htm
Unfortunately it looks like it hasn't been updated in a while. The last version is based on Gecko 1.7.12 and I believe Gecko is currently up to 1.9.x (used in Firefox 3)

失去的东西太少 2024-07-13 09:31:17

另一种选择是 THTMLViewer 组件。 我已经用这个好几年了。

现在可以免费使用。 该网站位于此处 http://pbear.com/htmlviewers.html。 根据 Songbeamer 网站 (http://www.songbeamer.com/delphi/)有Delphi 2009版本可用。

An alternative is THTMLViewer component. I have used this for some years.

This is now available free. the web siteis here http://pbear.com/htmlviewers.html. According to the songbeamer web site (http://www.songbeamer.com/delphi/) there is a Delphi 2009 version available.

睫毛上残留的泪 2024-07-13 09:31:17

在过去的三年里,我很少遇到将 Gecko 嵌入 Delphi 的情况。 一个在游戏中出现得相当晚的库(对我来说)是 SourceForge 上的 GeckoSDK 项目。 我很早就做了很多工作,试图让嵌入式 Gecko 在 Delphi 中正常工作。 我们第一次尝试基于 Gecko 渲染引擎的内部“浏览器”是使用 Delphi 和 Gecko 1.8 构建的。 我们已经继续前进,我们的浏览器现在是一个 XULRunner 应用程序。 我的硬盘上还存放着早期尝试的一些代码,但我尚未删除。

当 Mozilla 发布 Gecko 2.0 时,我认为嵌入 Delphi 会变得容易得多。 Gecko 中的 XPCOM 对象系统使得嵌入变得非常困难,因为大多数东西都会返回 NS_RESULT。 琴弦尤其坚硬。

编辑:我刚刚浏览了我的旧书签(几乎所有书签都已失效),并搜索了基于 Gecko 的日语“bagel”浏览器的新网址,并在这里找到了它,

http://github.com/plus7/bagel/tree/master/Legacy

这可能是您从一些优秀代码开始的最佳选择。 不幸的是代码中的注释是日语,作者从未回答过问题。

Over the last three years I have come across very little in the way of embedding Gecko in Delphi. One library that showed up fairly late in the game (for me) was the GeckoSDK project on SourceForge. I did a lot of work early on trying to make embedded Gecko work correctly in Delphi. Our first attempt at a Gecko rendering engine based internal "browser" was built using Delphi and Gecko 1.8. We have since moved on and our browser is now a XULRunner application. I have pieces of code laying around on my hard drive yet from that early attempt that I have not deleted yet.

When Mozilla releases Gecko 2.0 I think it will become a lot easier to embed in Delphi. The XPCOM object system in Gecko makes it very difficult to embed because most everything returns an NS_RESULT. Strings especially were hard.

edit: I just looked through my old bookmarks (almost all of which are dead) and searched for a new url for the Japanese language "bagel" browser based on Gecko and found it here,

http://github.com/plus7/bagel/tree/master/Legacy.

This is probably your best bet for some excellent code to start from. Unfortunately the comments in the code are Japanese and the author never responded to questions.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文