rem: var globalHistory = Components.classes["@mozilla.org/browser/global-history;1"].getService(Components.interfaces.nsIBrowserHistory); 
add: var globalHistory = Components.classes["@mozilla.org/browser/global-history;2"].getService(Components.interfaces.nsIBrowserHistory); 
context: function Startup() {  // Initially disable the clear buttons when needed  var globalHistory = Components.classes["@mozilla.org/browser/global-history;1"].getService(Components.interfaces.nsIBrowserHistory);  document.getElementById("history").setAttribute("cleardisabled", globalHistory.count == 0);    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());  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());  try {    e = PrivacyPanel.getDownloads();    var hasDownloads = e.hasMoreElements();  }  catch (e) {    hasDownloads = false;  }  document.getElementById("downloads").setAttribute("cleardisabled", !hasDownloads);    var formHistory = Components.classes["@mozilla.org/satchel/form-history;1"]                              .getService(Components.interfaces.nsIFormHistory);  document.getElementById("formfill").setAttribute("cleardisabled", formHistory.rowCount == 0);    // set up the pref checkboxes according to the network.cookie.cookieBehavior pref  // 0: enabled  // 1: enabled for originating website only  // 2: disabled  var cookieBehavior = document.getElementById("cookieBehavior").getAttribute("value");  document.getElementById("enableCookies").checked = cookieBehavior != 2;  document.getElementById("enableCookiesForOriginatingSiteOnly").checked = cookieBehavior == 1;  updateCookieBroadcaster();  var categories = document.getElementById("privacyCategories");  categories.addEventListener("clear", PrivacyPanel.clear, false);  // XXXben - we do this because of a bug with the download retention window menulist.   // The bug is that when the Options dialog opens, or you switch from another panel to  // this panel, style is incompletely resolved on the menulist's display area anonymous  // content - it is resolved on the all a/c subcomponents *except* menulist-label (the  // text nodes)... and (as a result, I think) when style is resolved later as the menulist  // goes from visbility: collapse to being visible, the menulist-label has the wrong parent  // style context which causes the style context parent checking to complain heartily. The  // symptom is that the menulist is not initialized with the currently selected value from  // preferences. I suspect this is related to the fact that the menulist is inserted into  // an XBL insertion point, as this problem does not occur when the menulist is placed outside  // the bound element. dbaron is helping me with this with a reduced test case, but in   // the meantime, I'm working around this bug by placing the menulist outside the bound element  // until it is completely initialized and then scooting it in, which is what this code does.   var drb = document.getElementById("downloadsRetentionBox");  var drp = document.getElementById("downloadsRetentionPolicy");  drp.removeAttribute("hidden");  document.documentElement.removeChild(drp);  drb.appendChild(drp);}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/7a922f66fdefe01b355c50b90a67e5b12da14c9f/pref-privacy.js/clean/browser/components/prefwindow/content/pref-privacy.js