Usable Browser Engines

Usable Browser Engines

For another A-Team like fair project we built a mosaic of Images, live h264 videos and html sites on a huge 42″ LCD panel. You have three rows with four columns and place an image, video or webbrowser widget at any position. Displaying the video and the image is quite easy. But the browser was a bit tricky.

So my first choiche was Python and KHTML. Well KHTML is attached to KIO and other services. So I found this python KDE example and changed it to display a specified url and changed KCmdLineArgs. Managing KCmdLineArgs in python was a bit tricks and documentation could have been a bit better. But we have dropped this approach because

  • We had a dcopserver, kdeinint, KLauncher starting race. Sometimes instead of the site a “could not initiliaze KLauncher” error was displayed.
  • It insisted on opening the Save As dialog for flash…

Okay my next try was gpe-mini-browser which uses gtk-webcore. The most amount of work was needed to make the old gtk-webcore snapshot compile on edgy. Then I had to hide the toolbar controls. Besides crashing when specifying http:// in parse_url gpe-mini-browser worked really well for the purpose and it had a good performance across the network. It displayed the binary content of the flash which was acceptable. We didn’t use this application because I did not feel like creating packages for it. gpe-mini-browser uses libcurl to do HTTP transfer the benefit is the browser does not require any other daemons running. If you want to kill it, just kill the gpe-mini-browser. In contrast to KHTMLPart and KIO this was a big win for our purpose.

Now the monster enters the game. I know that the OLPC sugar project embeds Mozilla using python. So I looked for GtkMozEmbed bindings but there weren’t any. I considered using the bindings from the SUGAR project but as I was behind a stupid firewall I was not able to git clone the laptop.org repository. So I googled for MozEmbed bindings and found the ruby bindings with an example which showed everything I needed. A bit more documentation wouldn’t hurt but the example did the stuff I needed to do so the documentation was enough. This was the first time I coded in ruby, I’m not impressed though but it got the job done. After installing ruby, irb, gtkmozembed for ruby and recognising that it misses a dep on the gtk+ bindings I was able to copy and paste the example to the ruby shell and I saw the mozilla screen.

There were some pitfalls. Specially in getting the same code running on Dapper. A magic Gtk.init was missing to make the ruby script run on dapper but now our mosaic is powered by ruby and mozilla.

I would have preferred to use KHTML/WebKit but the time might not be ready. With WebKit and Qt4 and Curl we might get there. But sadly the cmake System of WebKit heavily depends on KDE trunk being installed. This needs some more fixing.

Comments are closed.