context: function buildContextMenu(aEvent){  var popup = document.getElementById("addonContextMenu");  var selectedItem = gExtensionsView.selectedItem;  if (aEvent.target !== popup || !selectedItem)    return false;  while (popup.hasChildNodes())    popup.removeChild(popup.firstChild);  switch (gView) {  case "extensions":  case "themes":  case "locales":  case "plugins":    var menus = gAddonContextMenus;    break;  case "updates":    menus = gUpdateContextMenus;    break;  case "installs":    menus = gInstallContextMenus;    break;  }  for (var i = 0; i < menus.length; ++i) {    var clonedMenu = document.getElementById(menus[i]).cloneNode(true);    clonedMenu.id = clonedMenu.id + "_clone";    popup.appendChild(clonedMenu);  }  // All views support about  var menuitem_about = document.getElementById("menuitem_about_clone");  var name = selectedItem ? selectedItem.getAttribute("name") : "";  menuitem_about.setAttribute("label", getExtensionString("aboutAddon", [name]));  /* When an update or install is pending allow canceling the update or install     and don't allow uninstall. When an uninstall is pending allow canceling the     uninstall.*/  if (gView != "updates" && gView != "installs") {    var canEnable = gExtensionsViewController.isCommandEnabled("cmd_cancelUninstall");    document.getElementById("menuitem_cancelUninstall_clone").hidden = !canEnable;    var canCancelInstall = gExtensionsViewController.isCommandEnabled("cmd_cancelInstall");    document.getElementById("menuitem_cancelInstall_clone").hidden = !canCancelInstall;    var canCancelUpgrade = gExtensionsViewController.isCommandEnabled("cmd_cancelUpgrade");    document.getElementById("menuitem_cancelUpgrade_clone").hidden = !canCancelUpgrade;    document.getElementById("menuitem_uninstall_clone").hidden = canEnable || canCancelInstall || canCancelUpgrade;  }  switch (gView) {  case "extensions":    canEnable = gExtensionsViewController.isCommandEnabled("cmd_reallyEnable");    document.getElementById("menuitem_enable_clone").hidden = !canEnable;    document.getElementById("menuitem_disable_clone").hidden = canEnable;    document.getElementById("menuitem_useTheme_clone").hidden = true;    break;  case "themes":    var enableMenu = document.getElementById("menuitem_enable_clone");    if (!selectedItem.isCompatible || selectedItem.isBlocklisted ||        !selectedItem.satisfiesDependencies || selectedItem.isDisabled)      // don't let the user activate incompatible themes, but show a (disabled) Enable      // menuitem to give visual feedback; it's disabled because cmd_enable returns false      enableMenu.hidden = false;    else      enableMenu.hidden = true;    document.getElementById("menuitem_options_clone").hidden = true;    document.getElementById("menuitem_disable_clone").hidden = true;    break;  case "plugins":    document.getElementById("menuitem_about_clone").hidden = true;    document.getElementById("menuitem_uninstall_clone").hidden = true;    document.getElementById("menuitem_checkUpdate_clone").hidden = true;  case "locales":    canEnable = gExtensionsViewController.isCommandEnabled("cmd_reallyEnable");    document.getElementById("menuitem_enable_clone").hidden = !canEnable;    document.getElementById("menuitem_disable_clone").hidden = canEnable;    document.getElementById("menuitem_useTheme_clone").hidden = true;    document.getElementById("menuitem_options_clone").hidden = true;    break;  case "updates":    var includeUpdate = document.getAnonymousElementByAttribute(selectedItem, "anonid", "includeUpdate");    var menuitem_includeUpdate = document.getElementById("menuitem_includeUpdate_clone");    menuitem_includeUpdate.setAttribute("checked", includeUpdate.checked ? "true" : "false");    break;  case "installs":    break;  }      return true;}
meta: 10520	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/10520/c638d38804a8a1b23aaee5ccd66bb42aad5a242e/extensions.js/buggy/toolkit/mozapps/extensions/content/extensions.js