It’s time for another round of name-that-browser.
You can comfortably ignore the blue box in the upper left hand corner. This was meant to be a dual-purpose screenshot, showing the mystery browser on the right, along with mplayer playing a conventional DVD rip in Musca on a 300Mhz Celeron. Unfortunately, for reasons unbeknownst to mortal man, I got a blue box there rather than an action shot from the movie, which defeated half the purpose.
But there are no tricks or gimmicks at work here, except to say that the browser is all of about 1.5Kb on disk, written in python and has webkit as its core. No toolbars, controls, address bar or menus, save the right-click menu that appears with some very primitive options in it.
And the answer is … I don’t know.
The name, however, remains a mystery to me. Perhaps it’s a well-known python exercise, or just a sample code snippet. In any case, you’re looking at it in Arch, with nothing more than gtk2 and the pywebkitgtk package from community installed. It’ll get 100/100 on the Acid3 test, renders images and fonts precisely and beautifully, and as you can see in that picture, can run at 300Mhz alongside Xorg, mplayer, alsaequal, alsamixer and Musca … and everything is hovering around 64Mb of memory total. Impressive.
But what’s the use in that? What good is a control-less browser window that needs to be fed a URL from the command line, a la
python browser.py http://kmandla.wordress.com ?
Well, if you’re one of those half-and-half tiling desktop users who prefers a console-only arrangement against X (like Awesome or xmonad or dwm) it should be fairly obvious. Here’s a worthy replacement for heavyweight graphical browsers that won’t encumber a running system and still give you a graphical page display.
So if you’re torn between elinks and Firefox, this might serve as a decent middle-ground. It’s guiltless: None of the lard that comes with Firefox, and yet you still get accurate and faithful page displays.
I could also see where this might be useful for page designers or web coders, who need something that can jack up a page quickly, then drop out of sight. Instant page view, so to speak. I’m sure there are other possibilities here that I haven’t thought of, that you could offer.
Now if only I knew the name. …
P.S.: Just for the record, because I have a feeling I’m going to be looking for the code in the future. …
#!/usr/bin/env python import sys import gtk import webkit DEFAULT_URL = 'http://www.google.com' # Change this as you Wish class SimpleBrowser: # needs GTK, Python, Webkit-GTK def __init__(self): self.window = gtk.Window(gtk.WINDOW_TOPLEVEL) self.window.set_position(gtk.WIN_POS_CENTER_ALWAYS) self.window.connect('delete_event', self.close_application) self.window.set_default_size(350, 20) vbox = gtk.VBox(spacing=5) vbox.set_border_width(5) self.txt_url = gtk.Entry() self.txt_url.connect('activate', self._txt_url_activate) self.scrolled_window = gtk.ScrolledWindow() self.webview = webkit.WebView() self.scrolled_window.add(self.webview) vbox.pack_start(self.scrolled_window, fill=True, expand=True) self.window.add(vbox) def _txt_url_activate(self, entry): self._load(entry.get_text()) def _load(self, url): self.webview.open(url) def open(self, url): self.txt_url.set_text(url) self.window.set_title('%s' % url) self._load(url) def show(self): self.window.show_all() def close_application(self, widget, event, data=None): gtk.main_quit() if __name__ == '__main__': if len(sys.argv) > 1: url = sys.argv else: url = DEFAULT_URL gtk.gdk.threads_init() browser = SimpleBrowser() browser.open(url) browser.show() gtk.main()
P.P.S.: The title of this post has a typo in it; that should say 1.5Kb, like it does everywhere else.