rem: var editorShell = Components.classes["component: editorShell = editorShell.QueryInterface(Components.interfaces.nsIEditorShell); 
add: editorShell = Components.classes["component: if (editorShell) editorShell = editorShell.QueryInterface(Components.interfaces.nsIEditorShell);  
context: function EditorStartup(editorType){  dump("Doing Startup...\n");  contentWindow = window.content;  dump("Trying to make an editor appcore through the component manager...\n");  var editorShell = Components.classes["component://netscape/editor/editorshell"].createInstance();  editorShell = editorShell.QueryInterface(Components.interfaces.nsIEditorShell);  if (!editorShell)  {    dump("Failed to create editor shell\n");    window.close();    return;  }    // store the editor shell in the window, so that child windows can get to it.  window.editorShell = editorShell;    window.editorShell.Init();  window.editorShell.SetWebShellWindow(window);  window.editorShell.SetToolbarWindow(window)  window.editorShell.SetEditorType(editorType);  window.editorShell.SetContentWindow(contentWindow);  // Get url for editor content and load it.  // the editor gets instantiated by the editor shell when the URL has finished loading.  var url = document.getElementById("args").getAttribute("value");  window.editorShell.LoadUrl(url);    dump("EditorAppCore windows have been set.\n");  SetupToolbarElements();  // Set focus to the edit window  // This still doesn't work!  // It works after using a toolbar button, however!  contentWindow.focus();}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/f85acd993e8835575d09e6f4e3a5600489696848/EditorCommands.js/clean/editor/ui/composer/content/EditorCommands.js