add:  var IOService = Components.classes["@mozilla.org/network/io-service;1"] .getService(Components.interfaces.nsIIOService);  
context:   addDownloads: function (aParams, aObserver)  {    var numXPInstallItems = aParams.GetInt(1);        var fileLocator = Components.classes["@mozilla.org/file/directory_service;1"].getService(Components.interfaces.nsIProperties);    var tempDir = fileLocator.get("TmpD", Components.interfaces.nsIFile);    var mimeService = Components.classes["@mozilla.org/uriloader/external-helper-app-service;1"].getService(Components.interfaces.nsIMIMEService);        var xpinstallManager = gDownloadManager.QueryInterface(Components.interfaces.nsIXPInstallManagerUI);    var xpiString = "";    for (var i = 0; i < numXPInstallItems;) {      // Pretty Name      var displayName = aParams.GetString(i++);            // URI      var uri = Components.classes["@mozilla.org/network/standard-url;1"].createInstance(Components.interfaces.nsIURI);      uri.spec = aParams.GetString(i++);            var iconURL = aParams.GetString(i++);            // Local File Target      var url = uri.QueryInterface(Components.interfaces.nsIURL);      var localTarget = tempDir.clone();      localTarget.append(url.fileName);            xpiString += localTarget.path + ",";            // MIME Info      var mimeInfo = null;      try {        mimeInfo = mimeService.getFromTypeAndExtension(null, url.fileExtension);      }      catch (e) { }            if (!iconURL)         iconURL = "chrome://mozapps/skin/xpinstall/xpinstallItemGeneric.png";            var targetUrl = makeFileURL(localTarget);      var download = gDownloadManager.addDownload(Components.interfaces.nsIXPInstallManagerUI.DOWNLOAD_TYPE_INSTALL,                                                   uri, targetUrl, displayName, iconURL, mimeInfo, 0, null);            // Advance the enumerator      var certName = aParams.GetString(i++);    }    var observerService = Components.classes[kObserverServiceProgID]                                    .getService(Components.interfaces.nsIObserverService);    observerService.notifyObservers(xpinstallManager.xpiProgress, "xpinstall-progress", "open");    }
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/c6a3ed4cdda98a9d38469cd45022bea2ef388178/downloads.js/buggy/toolkit/mozapps/downloads/content/downloads.js