内存中资源的Java嵌入式浏览器

发布于 2024-09-24 08:35:29 字数 202 浏览 0 评论 0原文

我们有一个带有嵌入式浏览器的 Java 桌面应用程序,现在在 SWT 上使用 XULRunner(Firefox 引擎)。该浏览器的 API 允许我们加载指定 URI 或其 HTML 内容的网页。 我们需要的是加载 HTML 网页,包括资源,但一切都在内存中。最好的解决方案是提供一个在引擎尝试加载资源时使用的侦听器,以便我们可以向其发送适当的内容。

有什么想法吗?谢谢你!

We have a Java desktop app with an embedded browser, now using XULRunner (Firefox engine) on SWT. This browser's API allows us to load webs specifying an URI or its HTML content.
What we need is to load HTML webpages including resources but being everything in memory. The best solution would be to provide a listener used when the engine tries to load resources so we can send it the appropriate content.

Any ideas? thank you!

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

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

发布评论

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

评论(2

赢得她心 2024-10-01 08:35:29

听起来您需要一个小型 HTTP/Web 服务器。有Jetty,还有一些较小的,只需搜索“小型java web服务器”左右。

It sounds like you need a small HTTP / web server. There is Jetty, there are also a few smaller ones, just search for "small java web server" or so.

淡笑忘祈一世凡恋 2024-10-01 08:35:29

在 HTML 5 中,您可以将资源放入 HTML 本身中。

因此,您可以将 SWT 与支持 HTML 5 的浏览器一起使用,并准备您的网页以在 HTML 5 中包含资源。

使用 SWT 浏览器,您只需执行 browser.setText(html) 即可从内存加载页面。

In HTML 5 your can put your resources inside the HTML itself.

So you can use SWT with browser that supports HTML 5 and prepare your webpages to have resources inside HTML 5.

With SWT Browser your can simply do browser.setText(html) to load the page from memory.

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