Opening an URL launches the default browser at address "%u"

Bug #905139 reported by Olivier Tilloy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gnome-vfs (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

revelation is configured to open URLs using the following command: "gnome-open %U".
According to the source package this is the default configuration (stored in gconf as /apps/revelation/launcher/website).

When clicking on a URL inside revelation to open it, it launches firefox (or raises an existing firefox window to the top), but the URL in the address bar is "%u", literally, instead of having been replaced with the actual URL.

As far as I can remember it used to work in Natty and previous releases, this is a regression in Oneiric.

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: revelation 0.4.11-9ubuntu1
ProcVersionSignature: Ubuntu 3.0.0-14.23-generic 3.0.9
Uname: Linux 3.0.0-14-generic x86_64
NonfreeKernelModules: nvidia wl
ApportVersion: 1.23-0ubuntu4
Architecture: amd64
CheckboxSubmission: 2c7995ffdf051a6d0adf7ab2c7be5ba9
CheckboxSystem: 7e42599bda39ea7ff8b528272b6ef52b
Date: Fri Dec 16 08:52:18 2011
EcryptfsInUse: Yes
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Release amd64 (20111012)
SourcePackage: revelation
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Olivier Tilloy (osomon) wrote :
Revision history for this message
Olivier Tilloy (osomon) wrote :

This bug is still there in 12.04. Marking confirmed as I can consistently reproduce.

Changed in revelation (Ubuntu):
status: New → Confirmed
Revision history for this message
Olivier Tilloy (osomon) wrote :

I did a bit of investigation, and it appears that revelation uses a gnome.ui.HRef (http://developer.gnome.org/libgnomeui/stable/GnomeHRef.html) to display URLs. It appears that this widget itself is broken, not the way revelation uses it. The following piece of Python code demonstrates the issue:

    #!/usr/bin/python

    import pygtk
    pygtk.require('2.0')
    import gtk
    import gnome.ui

    if __name__ == '__main__':
        href = gnome.ui.HRef('http://ubuntu.com', 'Ubuntu')
        window = gtk.Window(gtk.WINDOW_TOPLEVEL)
        window.add(href)
        href.show()
        window.show()
        gtk.main()

Revision history for this message
Olivier Tilloy (osomon) wrote :

I dug further, and the issue also appears in the C implementation, the issue is not in the Python wrapper itself. The following piece of C code demonstrates it:

    // compile with: gcc `pkg-config --cflags --libs gtk+-2.0 libgnomeui-2.0` test.c

    #include <gtk/gtk.h>
    #include <libgnomeui/libgnomeui.h>

    int main(int argc, char **argv)
    {
        gtk_init(&argc, &argv);
        GtkWidget* window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
        GtkWidget* href = gnome_href_new("http://ubuntu.com", "Ubuntu");
        gtk_container_add(GTK_CONTAINER(window), href);
        gtk_widget_show(href);
        gtk_widget_show(window);
        gtk_main();
        return 0;
    }

Revision history for this message
Olivier Tilloy (osomon) wrote :

Re-targetting to the libgnomeui source package.

affects: revelation (Ubuntu) → libgnomeui (Ubuntu)
Revision history for this message
Olivier Tilloy (osomon) wrote :

Under the covers, gnome.ui.HRef calls gnome_url_show_with_env(...) to open a URL. The following piece of C code demonstrates that the issue seems to be in the implementation of gnome_url_show(...):

    // compile with: gcc test.c `pkg-config --cflags --libs libgnome-2.0`

    #include <libgnome/libgnome.h>

    int main(int argc, char **argv)
    {
        g_type_init();
        gnome_url_show("http://ubuntu.com", NULL);
        return 0;
    }

Revision history for this message
Olivier Tilloy (osomon) wrote :

gnome_url_show(...) calls gnome_vfs_url_show(...) under the hood. The issue is present there, as demonstrated by the following piece of C code:

    // compile with: gcc test.c `pkg-config --cflags --libs gnome-vfs-2.0`

    #include <libgnomevfs/gnome-vfs-utils.h>

    int main(int argc, char **argv)
    {
        g_type_init();
        gnome_vfs_url_show("http://ubuntu.com");
        return 0;
    }

Revision history for this message
Olivier Tilloy (osomon) wrote :

Re-targetting to the gnome-vfs source package.

affects: libgnomeui (Ubuntu) → gnome-vfs (Ubuntu)
Revision history for this message
Olivier Tilloy (osomon) wrote :

I dug further into the code of gnome-vfs, and it turns out that it inspects the value of the GConf key /desktop/gnome/url-handlers/http/command when required to open a URL. The code replaces all occurrences of "%s" with the URL passed as a parameter. On my desktop, the default value for this key is "firefox %u". Setting it to "firefox %s" fixes the issue.

Revision history for this message
Olivier Tilloy (osomon) wrote :

Interestingly, the default value for this key is defined in /usr/share/gconf/defaults/10_libgnomevfs2-common, and its default value is "sensible-browser %s". It might be that my configuration got messed up with at some point. Marking invalid as this is not an issue with a given package or implementation after all.

Changed in gnome-vfs (Ubuntu):
status: Confirmed → Invalid
Revision history for this message
Olivier Tilloy (osomon) wrote :

An additional note on the topic: after inspecting my gconf settings, a number of commands associated to some protocols under /desktop/gnome/url-handlers/ had a "%u" instead of "%s" in their value, which leads me to think that some program corrupted the values as opposed to manual tinkering.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.