rem: var htmlEditor = gEditor.QueryInterface(Components.interfaces.nsIHTMLEditor); if (!htmlEditor) return; SetElementEnabled(linkItem, !isCollapsed || htmlEditor.getElementOrParentByTagName("href", null)); 
add: try { SetElementEnabled(linkItem, !isCollapsed || gEditor.getElementOrParentByTagName("href", null)); } catch(e) {} 
context: function InitRemoveStylesMenuitems(removeStylesId, removeLinksId, removeNamedAnchorsId){  // Change wording of menuitems depending on selection  var stylesItem = document.getElementById(removeStylesId);  var linkItem = document.getElementById(removeLinksId);  var isCollapsed = gEditor.selection.isCollapsed;  if (stylesItem)  {    stylesItem.setAttribute("label", isCollapsed ? GetString("StopTextStyles") : GetString("RemoveTextStyles"));    stylesItem.setAttribute("accesskey", GetString("RemoveTextStylesAccesskey"));  }  if (linkItem)  {    linkItem.setAttribute("label", isCollapsed ? GetString("StopLinks") : GetString("RemoveLinks"));    linkItem.setAttribute("accesskey", GetString("RemoveLinksAccesskey"));    // Note: disabling text style is a pain since there are so many - forget it!    // Disable if not in a link, but always allow "Remove"    //  if selection isn't collapsed since we only look at anchor node    var htmlEditor = gEditor.QueryInterface(Components.interfaces.nsIHTMLEditor);    if (!htmlEditor) return;    SetElementEnabled(linkItem, !isCollapsed ||                      htmlEditor.getElementOrParentByTagName("href", null));  }  // Disable if selection is collapsed  SetElementEnabledById(removeNamedAnchorsId, !isCollapsed);}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/d56262a401c9d60bbef8fdbf3317ef55705279f1/editor.js/buggy/editor/ui/composer/content/editor.js