Comment 12 for bug 239952

Revision history for this message
TJ (tj) wrote :

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()

nsMIMEInfoBase::LaunchWithFile()
mPreferredAction=4
mPreferredAction==useSystemDefault
calling LaunchDefaultWithFile()

nsMIMEInfoUnix::LaunchDefaultWithFile()
nativePath=/tmp/test4 with space.txt-2.gz
Using vfs

nsGnomeVFSService::GetAppForMimeType("unknown/unknown", null)
calling gnome_vfs_mime_get_default_application()
Didn't get GnomeVFSMimeApplication

vfs->GetAppForMimeType()=1
mDefaultApplication=0
!mDefaultApplication NS_ERROR_FILE_NOT_FOUND
----------

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

----- log -----
nsGnomeVFSService::GetAppForMimeType("application/pdf", null)
calling gnome_vfs_mime_get_default_application()
Successfully got GnomeVFSMimeApplication (id=evince.desktop, name=Document Viewer)
converting app to mozApp
transfering mozApp to aApp (0x1140740)

nsMIMEInfoUnix::GetHasDefaultHandler()
Using vfs
nsGnomeVFSService::GetAppForMimeType("application/pdf", null)
calling gnome_vfs_mime_get_default_application()
Successfully got GnomeVFSMimeApplication (id=evince.desktop, name=Document Viewer)
converting app to mozApp
transfering mozApp to aApp (0x150bd60)
return NS_OK

nsMIMEInfoUnix::GetHasDefaultHandler()
Using vfs

nsGnomeVFSService::GetAppForMimeType("application/pdf", null)
calling gnome_vfs_mime_get_default_application()
Successfully got GnomeVFSMimeApplication (id=evince.desktop, name=Document Viewer)
converting app to mozApp
transfering mozApp to aApp (0x2f9e920)
return NS_OK

nsMIMEInfoBase::LaunchWithFile()
mPreferredAction=4
mPreferredAction==useSystemDefault
calling LaunchDefaultWithFile()

nsMIMEInfoUnix::LaunchDefaultWithFile()
nativePath=/tmp/test5-7.pdf
Using vfs

nsGnomeVFSService::GetAppForMimeType("application/pdf", null)
calling gnome_vfs_mime_get_default_application()
Successfully got GnomeVFSMimeApplication (id=evince.desktop, name=Document Viewer)
converting app to mozApp
transfering mozApp to aApp (0x4770b50)

vfs->GetAppForMimeType()=1
app->Launch()