rem: e = PrivacyPanel.getDownloads(); document.getElementById("downloads").setAttribute("cleardisabled", !e.hasMoreElements()); 
add: try { e = PrivacyPanel.getDownloads(); var hasDownloads = e.hasMoreElements(); } catch (e) { hasDownloads = false; } document.getElementById("downloads").setAttribute("cleardisabled", !hasDownloads); 
context: function Startup() {  var cookiesEnabled = document.getElementById("enableCookies").checked;  updateBroadcaster(!cookiesEnabled);  var globalHistory = Components.classes["@mozilla.org/browser/global-history;1"].getService(Components.interfaces.nsIBrowserHistory);  document.getElementById("history").setAttribute("cleardisabled", globalHistory.count == 0);    // Initially disable the cookies clear button if there are no saved cookies  var cookieMgr = Components.classes["@mozilla.org/cookiemanager;1"].getService();  cookieMgr = cookieMgr.QueryInterface(Components.interfaces.nsICookieManager);  var e = cookieMgr.enumerator;  document.getElementById("cookies").setAttribute("cleardisabled", !e.hasMoreElements());  // Initially disable the password clear button if there are no saved passwords  var passwdMgr = Components.classes["@mozilla.org/passwordmanager;1"].getService();  passwdMgr = passwdMgr.QueryInterface(Components.interfaces.nsIPasswordManager);  e = passwdMgr.enumerator;  document.getElementById("passwords").setAttribute("cleardisabled", !e.hasMoreElements());  // Initially disable the downloads clear button if there the downloads list is empty  e = PrivacyPanel.getDownloads();  document.getElementById("downloads").setAttribute("cleardisabled", !e.hasMoreElements());    // Initially disable the form history clear button if the history is empty  var formHistory = Components.classes["@mozilla.org/satchel/form-history;1"]                              .getService(Components.interfaces.nsIFormHistory);  document.getElementById("formfill").setAttribute("cleardisabled", formHistory.rowCount == 0);    var categories = document.getElementById("privacyCategories");  categories.addEventListener("clear", PrivacyPanel.clear, false);}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/200dd55355eff6f75c20910d2d672c47a5764001/pref-privacy.js/clean/browser/components/prefwindow/content/pref-privacy.js