rem: let index = gDownloadsView.selectedIndex; gDownloadsView.removeChild(aDownload); gDownloadsView.selectedIndex = Math.min(index, gDownloadsView.itemCount - 1); 
context: function removeDownload(aDownload){  gDownloadManager.removeDownload(aDownload.getAttribute("dlid"));  let index = gDownloadsView.selectedIndex;  gDownloadsView.removeChild(aDownload);  gDownloadsView.selectedIndex = Math.min(index, gDownloadsView.itemCount - 1);}
meta: 10520	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/10520/4895a9f799fa72c6ecb31e259a277f4a0563b233/downloads.js/clean/toolkit/mozapps/downloads/content/downloads.js