rem: var tagName = "button"; buttonElement = editor.getSelectedElement(tagName); 
add: const kTagName = "button"; try { buttonElement = editor.getSelectedElement(kTagName); } catch (e) {} 
context: function Startup(){  var editor = GetCurrentEditor();  if (!editor)  {    window.close();    return;  }  gDialog = {    buttonType:       document.getElementById("ButtonType"),    buttonName:       document.getElementById("ButtonName"),    buttonValue:      document.getElementById("ButtonValue"),    buttonDisabled:   document.getElementById("ButtonDisabled"),    buttonTabIndex:   document.getElementById("ButtonTabIndex"),    buttonAccessKey:  document.getElementById("ButtonAccessKey"),    MoreSection:      document.getElementById("MoreSection"),    MoreFewerButton:  document.getElementById("MoreFewerButton"),    RemoveButton:     document.getElementById("RemoveButton")  };  // Get a single selected button element  var tagName = "button";  buttonElement = editor.getSelectedElement(tagName);  if (buttonElement)    // We found an element and don't need to insert one    insertNew = false;  else  {    insertNew = true;    // We don't have an element selected,    //  so create one with default attributes    buttonElement = editor.createElementWithDefaults(tagName);    if (!buttonElement)    {      dump("Failed to get selected element or create a new one!\n");      window.close();      return;    }    // Hide button removing existing button    gDialog.RemoveButton.hidden = true;  }  // Make a copy to use for AdvancedEdit  globalElement = buttonElement.cloneNode(false);  InitDialog();  InitMoreFewer();  gDialog.buttonType.focus();  SetWindowLocation();}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/ba19e76b3af7269baf66e2c57c523119f007ec99/EdButtonProps.js/clean/editor/ui/dialogs/content/EdButtonProps.js