多个平台上的 Java 应用程序中的 WebKit 浏览器

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3279337/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-30 01:07:18  来源:igfitidea点击:

WebKit browser in Java app on multiple platforms

javawebkitembed

提问by Jean-Philippe Pellet

I'm trying to embed a WebKit browser in my Java app. I insist on WebKit, because I don't want to test my HTML5/CSS/Javascript with every browser that, for instance, the Browser widget in the Eclipse SWT library supports.

我正在尝试在我的 Java 应用程序中嵌入一个 WebKit 浏览器。我坚持使用 WebKit,因为我不想在每个浏览器上测试我的 HTML5/CSS/Javascript,例如,Eclipse SWT 库中的浏览器小部件支持。

Is there a way to do this on Mac, Windows and Linux, and thus make sure that my web pages are rendered inside my Java app uniformly?

有没有办法在 Mac、Windows 和 Linux 上执行此操作,从而确保我的网页在我的 Java 应用程序中统一呈现?

采纳答案by Jean-Philippe Pellet

Since SWT 3.7 M5, the Browserwidget can use WebKit on all platforms if created with the SWT.WEBKITflag. Platform-specific conditions may apply: see http://www.eclipse.org/swt/faq.php#howusewebkit.

从 SWT 3.7 M5 开始,Browser如果使用SWT.WEBKIT标志创建,小部件可以在所有平台上使用 WebKit 。特定于平台的条件可能适用:请参阅http://www.eclipse.org/swt/faq.php#howusewebkit

回答by h3xStream

JXBrowseris one option. It's including Safari.

JXBrowser是一种选择。它包括Safari。

WebKit 4 SWTis close to what you need but only work on Windows for now.

WebKit 4 SWT非常接近您的需要,但目前仅适用于 Windows。