rem: var pref = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); 
context: function init() {  var de = document.documentElement;  var items = [];  if (window.arguments[0] instanceof Components.interfaces.nsIDialogParamBlock) {    var args = window.arguments[0];    var fromInstall = args.GetInt(0) == 1 ? true : false;    var numberOfItems = args.GetInt(1);    for (var i = 0; i < numberOfItems; ++i)      items.push(args.GetString(i));    var extensionsBundle = document.getElementById("extensionsBundle");    var pref = Components.classes["@mozilla.org/preferences-service;1"]                         .getService(Components.interfaces.nsIPrefBranch);    try {      var url = pref.getCharPref("extensions.blocklist.detailsURL");    }    catch (e) { }    if (fromInstall) { // Blocklist blocked install      var params = {        message1: extensionsBundle.getFormattedString("blocklistedInstallMsg",                                                      [items[0]]),        moreInfoURL: url,        title: extensionsBundle.getString("blocklistedInstallTitle")      };      items = [];      var button = document.getElementById("centeredButton");      button.setAttribute("dlgtype", "accept");      de.buttons = "accept";      de.getButton("accept").focus();    }    else { // Blocklist background notification      // only hide when not used due to focus issues      document.getElementById("buttonCenteredBox").hidden = true;      var brandBundle = document.getElementById("brandBundle");      var brandShortName = brandBundle.getString("brandShortName");      params = {        message1: extensionsBundle.getFormattedString("blocklistNotifyMsg",                                                      [brandShortName]),        message2: extensionsBundle.getFormattedString("blocklistRestartMsg",                                                      [brandShortName]),        moreInfoURL: url,        title: extensionsBundle.getString("blocklistNotifyTitle")      };      de.buttons = "extra1,cancel";      button = de.getButton("cancel");      button.label = extensionsBundle.getString("laterButton");      de.setAttribute("ondialogextra1", "restartApp();");      button.focus();      button = de.getButton("extra1");      button.label = extensionsBundle.getFormattedString("restartButton",                                                         [brandShortName]);    }  }  else {    // only hide when not used due to focus issues    document.getElementById("buttonCenteredBox").hidden = true;    items = window.arguments[0];    params = window.arguments[1];  }  var addons = document.getElementById("addonsChildren");  if (items.length > 0)    document.getElementById("addonsTree").hidden = false;  // Fill the addons list  for (i = 0; i < items.length; ++i) {    var treeitem = document.createElementNS(kXULNS, "treeitem");    var treerow  = document.createElementNS(kXULNS, "treerow");    var treecell = document.createElementNS(kXULNS, "treecell");    treecell.setAttribute("label", items[i]);    treerow.appendChild(treecell);    treeitem.appendChild(treerow);    addons.appendChild(treeitem);  }  // Set the messages  var messages = ["message1", "message2", "message3"];  for (i = 0; i < messages.length; ++i) {    if (messages[i] in params) {      var message = document.getElementById(messages[i]);      message.hidden = false;      message.appendChild(document.createTextNode(params[messages[i]]));    }  }    document.getElementById("infoIcon").className =    params["iconClass"] ? "spaced " + params["iconClass"] : "spaced alert-icon";  if ("moreInfoURL" in params && params["moreInfoURL"]) {    message = document.getElementById("moreInfo");    message.value = extensionsBundle.getString("moreInfoText");    message.setAttribute("href", params["moreInfoURL"]);    document.getElementById("moreInfoBox").hidden = false;  }  // Set the window title  if ("title" in params)    document.title = params.title;  // Set up the buttons  if ("buttons" in params) {    gButtons = params.buttons;    var buttonString = "";    for (var buttonType in gButtons)      buttonString += "," + buttonType;    de.buttons = buttonString.substr(1);    for (buttonType in gButtons) {      button = de.getButton(buttonType);      button.label = gButtons[buttonType].label;      if (gButtons[buttonType].focused)        button.focus();      document.addEventListener(kDialog + buttonType, handleButtonCommand, true);    }  }}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/ec11f116b2a6e29bded32bf930ec73264e161dd7/list.js/buggy/toolkit/mozapps/extensions/content/list.js