Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer 1

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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