14 Feb 2009, Comments (0)

Writing a browser in three rows

Author: cjg

We reached a new record: writing a browser in three rows! After python I decided to test also WebKit bindings for ruby:

[kaltura-widget wid="jr0a2p7nrk" width="410" height="364" addpermission="0" editpermission="3" /]

And these are the three rows:

require 'webkit'
Gtk::Window.new().add(wv = Gtk::WebKit::WebView.new).show_all
Thread.new do Gtk.main end

As you can see from the video to open a webpage you have to write wv.open(“URL”) to the irb prompt.

No comments yet.

Leave a comment

XHTML– Allowed tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">