rem: try { editor.selectElement(labelElement); gDialog.labelText.value = GetSelectionAsText(); } catch (e) {} 
add: var range = editor.document.createRange(); range.selectNode(labelElement); gDialog.labelText.value = range.toString(); 
context: function Startup(){  var editor = GetCurrentEditor();  if (!editor)  {    dump("Failed to get active editor!\n");    window.close();    return;  }  gDialog.editText = document.getElementById("EditText");  gDialog.labelText = document.getElementById("LabelText");  gDialog.labelFor = document.getElementById("LabelFor");  gDialog.labelAccessKey = document.getElementById("LabelAccessKey");  labelElement = window.arguments[0];  // Make a copy to use for AdvancedEdit  globalElement = labelElement.cloneNode(false);  InitDialog();  try {    editor.selectElement(labelElement);    gDialog.labelText.value = GetSelectionAsText();  } catch (e) {}  if (/</.test(labelElement.innerHTML))  {    gDialog.editText.checked = false;    gDialog.editText.disabled = false;    gDialog.labelText.disabled = true;    gDialog.editText.addEventListener("command", onEditText, false);    SetTextboxFocus(gDialog.labelFor);  }  else    SetTextboxFocus(gDialog.labelText);  SetWindowLocation();}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/161212bb0026cff780d4cc07e50d7cf54d70e70b/EdLabelProps.js/buggy/editor/ui/dialogs/content/EdLabelProps.js