rem: gEditor = GetCurrentEditor(); 
add: gEditor = editorElement.getEditor(editorElement.contentWindow); 
context: function onLoad(){  // If we don't get the editor, then we won't allow replacing.  gEditor = GetCurrentEditor();  if (!gEditor)  {    window.close();    return;  }  // Get the xul <editor> element:  var editorXUL = window.opener.document.getElementById("content-frame");  // Get the nsIWebBrowserFind service:  gFindInst = editorXUL.webBrowserFind;  try {  // get the find service, which stores global find state    gFindService = Components.classes["@mozilla.org/find/find_service;1"]                         .getService(Components.interfaces.nsIFindService);  } catch(e) { dump("No find service!\n"); gFindService = 0; }  // Init gReplaceDialog.  initDialogObject();  // Change "OK" to "Find".  //dialog.find.label = document.getElementById("fBLT").getAttribute("label");  // Fill dialog.  loadDialog();  if (gReplaceDialog.findInput.value)    gReplaceDialog.findInput.select();  else    gReplaceDialog.findInput.focus();}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/108824e9bf09210b8fa9e282c7d4989af9f77109/EdReplace.js/clean/editor/ui/dialogs/content/EdReplace.js