The second issue is that internal debugging shows xulrunner makes a second attempt to get the mime-type from gnome-vfs when the first (obviously based on the web-server Content-Type) fails. The second attempt appears to be based on the file's extension (I shall trace that aspect in my next debug session).
The problem is, having got the correct handler from gnome-vfs xulrunner seems to forget/lose it and not use it later when it actually wants to launch the handler.
Here's the report for a .gzip file. The web-server (ubuntuforums.org) mis-reports the Content-Type as:
content-disposition: attachment; filename*=ISO-8859-1''test4%20with%20space.txt.gz
Content-Type: unknown/unknown
----- log -----
nsGnomeVFSService::GetAppForMimeType("unknown/unknown", null)
calling gnome_vfs_mime_get_default_application()
Didn't get GnomeVFSMimeApplication
nsGnomeVFSService::GetAppForMimeType("application/x-gzip", null)
calling gnome_vfs_mime_get_default_application()
Successfully got GnomeVFSMimeApplication (id=file-roller.desktop, name=Archive Manager)
converting app to mozApp
transfering mozApp to aApp (0x425c380)
nsMIMEInfoUnix::GetHasDefaultHandler()
Using vfs
nsGnomeVFSService::GetAppForMimeType("unknown/unknown", null)
calling gnome_vfs_mime_get_default_application()
Didn't get GnomeVFSMimeApplication
fallback to nsMIMEInfoImpl::GetHasDefaultHandler()
Here's a comparible log for a PDF file. The web-server Content-Type is:
.pdf == "application/pdf
content-disposition: attachment; filename*=ISO-8859-1''test5.pdf
The second issue is that internal debugging shows xulrunner makes a second attempt to get the mime-type from gnome-vfs when the first (obviously based on the web-server Content-Type) fails. The second attempt appears to be based on the file's extension (I shall trace that aspect in my next debug session).
The problem is, having got the correct handler from gnome-vfs xulrunner seems to forget/lose it and not use it later when it actually wants to launch the handler.
Here's the report for a .gzip file. The web-server (ubuntuforums.org) mis-reports the Content-Type as: disposition: attachment; filename* =ISO-8859- 1''test4% 20with% 20space. txt.gz
content-
Content-Type: unknown/unknown
----- log ----- ce::GetAppForMi meType( "unknown/ unknown" , null) mime_get_ default_ application( ) lication
nsGnomeVFSServi
calling gnome_vfs_
Didn't get GnomeVFSMimeApp
nsGnomeVFSServi ce::GetAppForMi meType( "application/ x-gzip" , null) mime_get_ default_ application( ) lication (id=file- roller. desktop, name=Archive Manager)
calling gnome_vfs_
Successfully got GnomeVFSMimeApp
converting app to mozApp
transfering mozApp to aApp (0x425c380)
nsMIMEInfoUnix: :GetHasDefaultH andler( ) ce::GetAppForMi meType( "unknown/ unknown" , null) mime_get_ default_ application( ) lication :GetHasDefaultH andler( )
Using vfs
nsGnomeVFSServi
calling gnome_vfs_
Didn't get GnomeVFSMimeApp
fallback to nsMIMEInfoImpl:
nsMIMEInfoBase: :LaunchWithFile () n==useSystemDef ault thFile( )
mPreferredAction=4
mPreferredActio
calling LaunchDefaultWi
nsMIMEInfoUnix: :LaunchDefaultW ithFile( ) /tmp/test4 with space.txt-2.gz
nativePath=
Using vfs
nsGnomeVFSServi ce::GetAppForMi meType( "unknown/ unknown" , null) mime_get_ default_ application( ) lication
calling gnome_vfs_
Didn't get GnomeVFSMimeApp
vfs->GetAppForM imeType( )=1 tion=0 ation NS_ERROR_ FILE_NOT_ FOUND
mDefaultApplica
!mDefaultApplic
----------
Here's a comparible log for a PDF file. The web-server Content-Type is: disposition: attachment; filename* =ISO-8859- 1''test5. pdf
.pdf == "application/pdf
content-
----- log ----- ce::GetAppForMi meType( "application/ pdf", null) mime_get_ default_ application( ) lication (id=evince.desktop, name=Document Viewer)
nsGnomeVFSServi
calling gnome_vfs_
Successfully got GnomeVFSMimeApp
converting app to mozApp
transfering mozApp to aApp (0x1140740)
nsMIMEInfoUnix: :GetHasDefaultH andler( ) ce::GetAppForMi meType( "application/ pdf", null) mime_get_ default_ application( ) lication (id=evince.desktop, name=Document Viewer)
Using vfs
nsGnomeVFSServi
calling gnome_vfs_
Successfully got GnomeVFSMimeApp
converting app to mozApp
transfering mozApp to aApp (0x150bd60)
return NS_OK
nsMIMEInfoUnix: :GetHasDefaultH andler( )
Using vfs
nsGnomeVFSServi ce::GetAppForMi meType( "application/ pdf", null) mime_get_ default_ application( ) lication (id=evince.desktop, name=Document Viewer)
calling gnome_vfs_
Successfully got GnomeVFSMimeApp
converting app to mozApp
transfering mozApp to aApp (0x2f9e920)
return NS_OK
nsMIMEInfoBase: :LaunchWithFile () n==useSystemDef ault thFile( )
mPreferredAction=4
mPreferredActio
calling LaunchDefaultWi
nsMIMEInfoUnix: :LaunchDefaultW ithFile( ) /tmp/test5- 7.pdf
nativePath=
Using vfs
nsGnomeVFSServi ce::GetAppForMi meType( "application/ pdf", null) mime_get_ default_ application( ) lication (id=evince.desktop, name=Document Viewer)
calling gnome_vfs_
Successfully got GnomeVFSMimeApp
converting app to mozApp
transfering mozApp to aApp (0x4770b50)
vfs->GetAppForM imeType( )=1
app->Launch()