I use Google Chrome on my Debian laptop, but at one point I had Firefox installed. Now I'm developing a GTK application, and when I click on a link, it outputs this:

(charry.phpw:6267): Gtk-WARNING **: Unable to show 'http://t.co/nOOjE9u1': Failed to execute child process "/opt/firefox/firefox" (No such file or directory)

I don't understand why it would be calling for Firefox, because I have x-www-browser set to Chrome. Does anyone have insight as to how GTK picks a browser to open hyperlinks?

Now I have to expand this question. I woke up this morning and tried to run this application on my Windows box, but it says:

<php.exe:3360>: Gtk-WARNING **: Unable to show 'http://t.co/tKtwKbAt': No application is registered as handling this file

So how does GTK register URI handlers? No one on the Internet seems to know how to do this...without Gnome, at least.

link|improve this question
feedback

1 Answer

up vote 1 down vote accepted

GTK uses GVFS, which used to use scheme settings from Gconf (/desktop/gnome/uri-handlers), but has since switched to XDG MIME Actions spec, with preferences kept in ${XDG_DATA_HOME-~/.local/share}/applications.

~/.local/share/applications/mimeapps.list:

[Default Applications]
x-scheme-handler/http=firefox.desktop

The .desktop files are looked for in the subfolder applications of both $XDG_DATA_HOME and every path listed in $XDG_DATA_DIRS.

If mimeapps.list does not exist, defaults.list will be used.


I don't know the answer for Windows (yet), but Process Monitor will be useful in determining the location.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.