Closed Bug 624338 Opened 14 years ago Closed 13 years ago

Update check for default browser to work the new way (glib >= 2.27.1)


(Firefox :: Shell Integration, defect)

Not set



Firefox 6


(Reporter: vuntz, Unassigned)



(Whiteboard: [fixed in bug 611953])

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; fr-fr) AppleWebKit/534.7+ (KHTML, like Gecko) Version/5.0 Safari/534.7+ SUSE/11.4 (2.30.6-97.5) Epiphany/2.30.6
Build Identifier: 

Starting with glib 2.27.1, the way for an app to declare that it supports opening a URI scheme has changed: it used to be something living in gconf, and now we use the mime system with a mime type like x-scheme-handler/http. The old way doesn't work anymore.

glib 2.27/2.28 will be used in all distributions releasing in spring 2011.

See and the first part of for some more background.

So Firefox needs to be updated for this:

a) appProtocols ( should have mime types for each of the protocol. It's always something like x-scheme-handler/http.

b) nsGNOMEShellService::IsDefaultBrowser (from needs to use g_app_info_get_default_for_type() ( with x-scheme-handler/http and others to know what's the default app. You can then use g_app_info_get_executable() ( to see if the app matches argv[0].

c) nsGNOMEShellService::SetDefaultBrowser (from needs to also be updated. Instead of calling gconf->SetAppForProtocol(), you can simply call appInfo->SetAsDefaultForMimeType() for x-scheme-handler/http, like you do later for the usual mime types.

It's worth pointing out that shipping a desktop file with Firefox (say MozillaFirefox.desktop) would make things a bit cleaner. Instead of using g_app_info_get_executable() and checking the name of the binary, you could use g_app_info_get_id() and check that it returns MozillaFirefox.desktop. You also wouldn't need to create a GAppInfo from nothing with giovfs->CreateAppFromCommand in nsGNOMEShellService::SetDefaultBrowser(). You could instead just create it with g_desktop_app_info_new().

Reproducible: Always
I might pick that up in the near future. If anyone else wants to look at it earlier let me know.
Ever confirmed: true
Hardware: x86 → All
Version: unspecified → Trunk
Depends on: 624530
This should be addressed by

That implementation used g_app_info_get_default_for_uri_scheme instead of g_app_info_get_default_for_type.
Closed: 13 years ago
Depends on: 611953
No longer depends on: 624530
Resolution: --- → FIXED
Whiteboard: [fixed in bug 611953]
Target Milestone: --- → Firefox 6
You need to log in before you can comment on or make changes to this bug.