rem: var contentType = mimeService.getTypeFromFile(aDownload.target); 
add: var contentType = mimeService.getTypeFromFile(aDownload.targetFile); 
context: function downloadCompleted(aDownload) {  // Wrap this in try...catch since this can be called while shutting down...   // it doesn't really matter if it fails then since well.. we're shutting down  // and there's no UI to update!  try {    var rdf = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService);    var rdfc = Components.classes["@mozilla.org/rdf/container;1"].createInstance(Components.interfaces.nsIRDFContainer);    var db = gDownloadManager.datasource;        rdfc.Init(db, rdf.GetResource("NC:DownloadsRoot"));    var id = aDownload.target.path;        // Refresh the icon, so that executable icons are shown.    var mimeService = Components.classes["@mozilla.org/uriloader/external-helper-app-service;1"].getService(Components.interfaces.nsIMIMEService);    var contentType = mimeService.getTypeFromFile(aDownload.target);        var listItem = document.getElementById(id);    var oldImage = listItem.getAttribute("image");    // I tack on the content-type here as a hack to bypass the cache which seems    // to be interfering despite the fact the image has 'validate="always"' set    // on it.     listItem.setAttribute("image", oldImage + "&contentType=" + contentType);        var dlRes = rdf.GetUnicodeResource(id);      var insertIndex = gDownloadManager.activeDownloadCount + 1;    // Don't bother inserting the item into the same place!    if (insertIndex != rdfc.IndexOf(dlRes)) {      rdfc.RemoveElement(dlRes, true);      if (insertIndex == rdfc.GetCount() || insertIndex < 1)         rdfc.AppendElement(dlRes);      else        rdfc.InsertElementAt(dlRes, insertIndex, true);          }            // Remove the download from our book-keeping list and if the count    // falls to zero, update the title here, since we won't be getting    // any more progress notifications in which to do it.     for (var i = 0; i < gActiveDownloads.length; ++i) {      if (gActiveDownloads[i] == aDownload) {        gActiveDownloads.splice(i, 1);        break;      }    }    if (gActiveDownloads.length == 0)      window.title = document.documentElement.getAttribute("statictitle");      }  catch (e) {  }}
meta: 8395	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8395/7c82e1279d55b0fc3e38b05b6596208d1482c3a3/downloads.js/clean/toolkit/mozapps/downloads/content/downloads.js