A SWT widget embedding a cross platform Chromium Browser. It works on Windows, Mac OS and Linux.
This new widget allows to develop modern web UIs inside a Java SWT or an Eclipse RCP application. It can be easily embedded in an Eclipse view, using the same API that is used with the other SWT browsers.
No more custom code for each platform, no more installations of specific libraries for Linux, no more problems in Windows with IE, no more platform-dependant and browser-specific issues at all. This is a truly cross platform SWT Browser that runs seamlessly in all operating systems.
It is based on and uses the CEF Framework (https://bitbucket.org/chromiumembedded/cef).
Chromium SWT Browser is provided as a P2 repository ready to use, which contains:
CEF Binaries are provided in a separate repository for easy usage.
An eclipse P2 repository is available with the bundle and fragments for Linux, Windows and Mac OS (x86_64 only)
1- Chromium Browser Widget repository (EPL): http://dl.maketechnology.io/chromium-swt/rls/repository
Third party dependencies (JNR, ASM) are available at eclipse repository (EPL) (No dependencies since 0.10.0):
3- CEF Binaries (Optional) required to run can be manually copied to ~/.swt/lib/[os]/x86_64/ or you can use this repository which provides a feature and per platform fragments with CEF binaries and resources. http://dl.maketechnology.io/chromium-cef/rls/repository
Change your java import to use
import org.eclipse.swt.chromium.Browser;. It follows the same SWT Browser API.
On linux it works only with GTK2 for now. Since 0.9.0 it works with GTK3, with CEF binaries repository which has some patches on CEF for gtk3.
Make sure you enable the following bundles and their dependencies in your run config:
If you don't use CEF Binaries repository, you will get an error on first run saying CEF binaries are not available. Use the CEF Binaries repository or manually download cef_binary 3.3071 client archive from http://opensource.spotify.com/cefbuilds/ and extract binaries to folder indicated in error (~/.swt/lib/*/x86_64/chromium-3071). Then rerun.
⚠️ On Linux, your first launch may fail due to a bug on CEF. You can workaround this by copying
snapshot_blob.bin from CEF folder to the
jre/bin folder (e.g.:
/usr/lib/jvm/java-8-oracle/jre/bin/). Those files should be siblings of the java executable file. Or use our CEF binaries repo which contains the fix.
org.eclipse.swt.chromiumplugin dependency to /org.eclipse.swt.examples/META-INF/MANIFEST.MF
import import org.eclipse.swt.chromium.Browser;
org.eclipse.swt.chromium.WindowEventin lines 62 and 63.
This repo uses GIT LFS, please install (https://git-lfs.github.com/) before cloning.
mvn clean package
Notes: Running with mvn has some test failing due accessing protected fields from same package in different bundes. This is a temporary until it gets merged to SWT.
We (Make Technology, http://www.maketechnology.io/) have agreed with the Eclipse Foundation to do all this work and contribute it under the EPL, but we need your support to make this huge project happen!
Funding this work is welcome. If you think your company is interested in and can help, please contact us ([email protected]).
We're offering early support for the widget and consultancy. Note that it will be open source anyway.