WebKit browser in Java app on multiple platforms

17,271

Solution 1

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

Solution 2

JXBrowser is one option. It's including Safari.

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

Share:
17,271
Jean-Philippe Pellet
Author by

Jean-Philippe Pellet

Lecturer (EPFL) & developer (University of Teacher Education, Lausanne, Switzerland). Ph.D. in computer science. Interests include: Language design (big fan of Scala) Machine learning, statistics, statistical causality Pedagogical tools Teaching of computer science and computational thinking You can contact me at jppellet at gmail dot com.

Updated on July 20, 2022

Comments

  • Jean-Philippe Pellet
    Jean-Philippe Pellet over 1 year

    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.

    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?

  • Jean-Philippe Pellet
    Jean-Philippe Pellet over 13 years
    JxBrowser is very expensive... and from their website I read "JxBrowser supports integration with Internet Explorer and Mozilla (corresponding FireFox 3) under Windows, Apple Safari and Mozilla under Mac OS X, and Mozilla under Linux". So no WebKit for all platforms. Maybe a façade for the SWT Browser widget using WebKit on Mac and Linux, and the WebKit4SWT widget you mention for Windows would be a solution.
  • KJW
    KJW almost 12 years
    I used JxBrowser before and it's not truly cross platform and very slow to updates and lacks documentation. I forked out $2000 for it and overall experience was very bad as it's still buggy after two years and you must continue to pay license fee to get more updates....
  • Joe
    Joe over 11 years
    This is not a great option due to the requirements: Windows: 32-bit SWT, Safari must be installed Linux: WebKitGTK 1.2.0 or newer must be in the library load path. Examples of Linux distros that meet this requirement by default include Red Hat Enterprise Linux 6 and Ubuntu 10.04. OS X: No additional runtime requirements, the default renderer is WebKit-based. Windows requires safari to be installed? Not many people have this.
  • Jean-Philippe Pellet
    Jean-Philippe Pellet over 11 years
    @Joe It's least impractical I found. Feel free to suggest other solutions.
  • BasK
    BasK about 9 years
    Can You give some example for webkit.
  • h3xStream
    h3xStream about 9 years
    @BasK You can find up to date example on their website: teamdev.com/downloads/jxbrowser/docs/…