Comment 3 for bug 727372

Revision history for this message
In , Chris Coulson (chrisccoulson) wrote :

Created attachment 517395
Use GIO for finding the default handler

We're trying to get u1ms:// URI's to open in Banshee in Ubuntu, and have registered the handler in the proper way (it's desktop file defines x-scheme-handler/u1ms in its MimeType field). However, clicking u1ms links in Firefox results in a dialog with the following message being displayed:

"Firefox doesn't know how to open this address, because the protocol (u1ms) isn't associated with any program."

(Note, that we're building Firefox with --enable-gio in Ubuntu, as this doesn't work in gnomevfs at all anymore)

This is because nsGNOMERegistry::HandlerExists checks for the existence of a protocol handler by looking directly at the GConf keys in /desktop/gnome/url-handlers, which are deprecated in GNOME 3.0 (see also bug 611953). When built with --enable-gio, nsGNOMERegistry::HandlerExists should use the gio API directly.

Note, this bug applies to any URI which needs to be handled by an external application (eg, mailto:// links only work on my machine by virtue of having stale entries in /desktop/gnome/url-handlers, and those don't match my preferred mail client anyway).

I've attached a patch which fixes this. Unfortunately, it depends on the patches on bug 611953 too, as it uses the new nsIGIOService::GetAppForURIScheme