posted by Thom Holwerda on Fri 18th Mar 2011 19:00 UTC, submitted by anonymous
IconI've been ragging on GNOME a little bit lately, so let's balance things out by talking about something I found quite fascinating: the Gtk+ HTML back-end. This will enable you to run any Gtk+-application inside Firefox 4.0 (only Firefox 4.0 is supported at the moment).

It's far from complete at this point, and as such, it'll be part of Gtk+ 3.2. Gtk+ 3.0 introduced support for multiple back-ends, and this new HTML5 gdk back-end makes use of that feature. After compiling Gtk+ with –enable-x11-backend –enable-broadway-backend, you're almost good to go.

The second step is to enable web sockets in Firefox 4.0. This feature is disabled by default by Mozilla due to security concerns, but here's how to turn it on. Once that's done, you can enable the HTML5 back-end at runtime using the GDK_BACKEND enviroment variable.

The next step is to run a Gtk+-application, like so:

GDK_BACKEND=broadway your-application&
firefox http://127.0.0.1:8080/

Alexander Larsson made a screencast of how this works.

The video is HTML5 video in WebM, which only works in browsers that support this open standard (at the moment, Chrome, Firefox 4.0 beta/RC, and Opera 11 beta). You can watch this video in Internet Explorer 9 using Google's Media Foundation codecs. You can always download the source file and play it in your favourite media player. Alternatively, you can resort to watching the video on Vimeo in the closed H264 format wrapped in Flash.

e p (6)    59 Comment(s)

Technology White Papers

See More