Giter Club home page Giter Club logo

chromium.swt's Introduction

Chromium for SWT

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).

Design

Chromium SWT Browser is provided as a P2 repository ready to use, which contains:

  • chromium bundle
  • chromium native library per platform fragments
  • feature containing all the above

CEF Binaries are provided in a separate repository for easy usage.

P2 repository

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

2- Third party dependencies (JNR, ASM) are available at eclipse repository (EPL): http://download.eclipse.org/releases/photon

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

Usage

Change your java import to use import org.eclipse.swt.chromium.Browser;. It follows the same SWT Browser API.

Notes:

  • On linux it works only with GTK2 for now.

    • Make sure you enable the following bundles and their dependencies in your run config:

      • com.github.jnr.ffi
      • com.github.jnr.jffi
      • com.github.jnr.jffi.native (fragment)
      • org.eclipse.swt.chromium
      • org.eclipse.swt.[ws].[os].x86_64 (fragment)
    • 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 icudtl.dat, natives_blob.bin and 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.

Build

This repo uses GIT LFS, please install (https://git-lfs.github.com/) before cloning.

  • Clone this repo.
  • mvn clean package

Run tests

  • Exract the CEF binaries first or run the widget once to extract the binaries, as indicated in Usage.
  • mvn verify
  • Or from eclipse run the single test class from bundle as Junit tests. (Note: you may need to change paths to .jars in local installation)

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.

Status and Plan

The full SWT Browser API is supported now, including sync and async Javascript support.

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!

https://medium.com/@mikael.barbero/chromium-eclipse-swt-integration-c61f416e97d1

Donations

Funding this work is welcome. If you think your company is interested in and can help, please contact us ([email protected]).

Support

If you need (paid) consultancy or support for having the widget integrated into your app, contact us (Make Technology, http://www.maketechnology.io) at [email protected].

We're offering early support for the widget and consultancy. Note that it will be open source anyway.

chromium.swt's People

Contributors

gzunino avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.