The explanation for the apparent forgetfulness of xulrunner is that there are two separate phases to the download process:
1. Populate the Helper Chooser Dialog list with mime-type helper applications
2. Launch with default mime-type helper
The solution would be to add functionality to nsMIMEInfoUnix::LaunchDefaultWithFile() that does the same thing as step 1 follows in determining the default helper.
However, Aexander has pointed me to a patch that may rework this process so the next step is to see if the patch has any positive effect on this default-handling in the absense of a sensible Content-Type from the web-server.
Here's the recent debug log showing the two phases.
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 (0xf6abe0)
success
*** FILE DOWNLOAD COMPLETED ****
nsMIMEInfoUnix::GetHasDefaultHandler()
Using vfs
nsGnomeVFSService::GetAppForMimeType("unknown/unknown", null)
calling gnome_vfs_mime_get_default_application()
Didn't get GnomeVFSMimeApplication
fallback to nsMIMEInfoImpl::GetHasDefaultHandler()
The explanation for the apparent forgetfulness of xulrunner is that there are two separate phases to the download process:
1. Populate the Helper Chooser Dialog list with mime-type helper applications
2. Launch with default mime-type helper
The solution would be to add functionality to nsMIMEInfoUnix: :LaunchDefaultW ithFile( ) that does the same thing as step 1 follows in determining the default helper.
However, Aexander has pointed me to a patch that may rework this process so the next step is to see if the patch has any positive effect on this default-handling in the absense of a sensible Content-Type from the web-server.
Here's the recent debug log showing the two phases.
=== log ===
*** POPULATE HELPER CHOOSER DIALOG ****
nsOSHelperAppSe rvice:: GetMIMEInfoFrom OS("unknown/ unknown" , "gz")
nsGNOMERegistry ::GetFromType( "unknown/ unknown" ) imeType( )
calling vfs->GetAppForM
nsGnomeVFSServi ce::GetAppForMi meType( "unknown/ unknown" , null) mime_get_ default_ application( ) lication
calling gnome_vfs_
Didn't get GnomeVFSMimeApp
failed
!retval || !hasDefault
nsOSHelperAppSe rvice:: GetFromExtensio n("gz") scription( ) ::GetFromExtens ion()
calling LookUpTypeAndDe
LookUp failed
calling nsGNOMERegistry
nsGnomeVFSServi ce::GetMimeType FromExtension( "gz", aMimeType) mime_type_ from_name( ) application/ x-gzip
calling gnome_vfs_
aMimeType=
nsGNOMERegistry ::GetFromType( "application/ x-gzip" ) imeType( )
calling vfs->GetAppForM
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 (0xf6abe0)
success
*** FILE DOWNLOAD COMPLETED ****
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:
**** ATTEMPT TO LAUNCH HELPER ***
nsMIMEInfoBase: :LaunchWithFile () n==useSystemDef ault thFile( )
mPreferredAction=4
mPreferredActio
calling LaunchDefaultWi
nsMIMEInfoUnix: :LaunchDefaultW ithFile( ) /tmp/test4 with space.txt-4.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