Wednesday, 18 August 2010

The Awesome New Features of Midori 0.2.7

After a rather longish time a new release of midori is out and among other things it has a feature I never expected it would have implemented this early. Unless I'm mistaken, midori is the first browser that supports delayed tab loading on startup out of box (I'm aware of some extension for firefox which does something like this). You just need to set it in your preferences. Yay, this speeds up browser startup about zillion times as I keep a lot of tabs open. Well, it could use some improvement – currently you need to hit reload to load a tab, it would be nice if they loaded when selected.

Next, long awaited feature, are improvements to location bar. It can now search through bookmarks and it supports multiword search. Another bunch of useful improvements.

There are also two new Vala extensions – history list and external applications. The first one is an interesting feature that adds behaviour similar to how alt-tab works for windows to ctrl-tab for tabs. Since I usually have many tabs open, but frequently switch only between few of them, this looks like a huge usability improvement.

The other one is another long awaited thing – since webkitgtk does not support ftp protocol, we'd just got error messages instead of ftp listings, now midori fires up gftp. Unfortunately, without passing it the uri. So I looked into the code, quickly get acquainted with Vala language (really easy if you know some object oriented programming language and C), switched gftp for nautilus (gftp is a bit overkill to me) and fixed it to actually open the location. It's like two lines change:

diff -up midori-0.2.7/extensions/external-applications.vala.nautilus midori-0.2.7/extensions/external-applications.vala
--- midori-0.2.7/extensions/external-applications.vala.nautilus 2010-08-16 21:31:14.000000000 +0200
+++ midori-0.2.7/extensions/external-applications.vala 2010-08-18 01:34:04.000000000 +0200
@@ -17,7 +17,7 @@ public class ExternalApplications : Mido
Dialog? dialog;
bool launch (string command, string uri) {
try {
- var info = GLib.AppInfo.create_from_commandline (command, "", 0);
+ var info = GLib.AppInfo.create_from_commandline (command, "", GLib.AppInfoCreateFlags.SUPPORTS_URIS);
var uris = new List();
uris.prepend (uri);
info.launch_uris (uris, new GLib.AppLaunchContext ());
@@ -38,7 +38,7 @@ public class ExternalApplications : Mido
WebNavigationAction action, WebPolicyDecision decision) {
string uri = request.get_uri ();
if (uri.has_prefix ("ftp://")) {
- if (launch ("gftp", uri)) {
+ if (launch ("nautilus", uri)) {
decision.ignore ();
return true;

Hopefully this will be configurable in the next release (so that I won't have to patch the source code :D).

These new things also have the flip side though – occasional crashes. I haven't got time yet to inspect them, but I suspect the new vala extensions or changes to location bar to be at fault.


Anonymous said...

err.. xdg-open

Martin said...

xdg-open does not work in this case:
$ xdg-open \

gvfs-open: error opening location: The specified location is not mounted