rem: var menuitem = document.createElement("menuitem"); var label = branch.getCharPref(regions[i] + ".policyName"); menuitem.setAttribute("label", label); menuitem.setAttribute("id", "policyMenuRegion-" + regions[i]); aEvent.target.insertBefore(menuitem, noRegionsItem); 
add: var itemElement = document.getElementById("policyMenuRegion-" + regions[i]); if (!itemElement) { var menuitem = document.createElement("menuitem"); var label = branch.getCharPref(regions[i] + ".policyName"); menuitem.setAttribute("label", label); menuitem.setAttribute("id", "policyMenuRegion-" + regions[i]); menuitem.setAttribute("region", regions[i]); var sites = branch.getCharPref(regions[i] + ".sites"); if (sites.indexOf(prePath) != -1) menuitem.setAttribute("disaled", "true");  aEvent.target.insertBefore(menuitem, noRegionsItem); } 
context: function policyMenuShowing(aEvent){  var branch = getPolicyBranch();  var regions = branch.getCharPref("policynames");  regions = regions.split(", ");  var noRegionsItem = document.getElementById("policyMenu-noregions");  for (var i = 0; i < regions.length; ++i) {    var menuitem = document.createElement("menuitem");    var label = branch.getCharPref(regions[i] + ".policyName");    menuitem.setAttribute("label", label);    menuitem.setAttribute("id", "policyMenuRegion-" + regions[i]);    aEvent.target.insertBefore(menuitem, noRegionsItem);  }}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/c6f95f45bf77b8eab12737b8a4af22910b3a394b/policy.js/buggy/browser/components/policy/resources/content/policy.js