rem: var windowManager = Components.classes['@mozilla.org/rdf/datasource;1?name=window-mediator'].getService(); 
add: var windowManager = Components.classes['@mozilla.org/appshell/window-mediator;1'].getService(); 
context: function SwitchInsertCharToAnotherEditorOrClose(){  if ("InsertCharWindow" in window && window.InsertCharWindow)  {    var windowManager = Components.classes['@mozilla.org/rdf/datasource;1?name=window-mediator'].getService();    var windowManagerInterface = windowManager.QueryInterface( Components.interfaces.nsIWindowMediator);    var enumerator = windowManagerInterface.getEnumerator( null );    // TODO: Fix this to search for command controllers and look for "cmd_InsertChars"    // For now, detect just Web Composer and HTML Mail Composer    while ( enumerator.hasMoreElements()  )    {      var  tempWindow = enumerator.getNext();      if (tempWindow != window && tempWindow != window.InsertCharWindow &&           ("editorShell" in tempWindow) && tempWindow.editorShell)      {        var type = tempWindow.editorShell.editorType;        if (type == "html" || type == "text" || type == "htmlmail")	      {          tempWindow.InsertCharWindow = window.InsertCharWindow;          window.InsertCharWindow = null;          tempWindow.InsertCharWindow.editorShell = tempWindow.editorShell;          tempWindow.InsertCharWindow.opener = tempWindow;          return;	      }      }    }    // Didn't find another editor - close the dialog    window.InsertCharWindow.close();  }}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/58ad7ad612cf759624c52f8d3473225eb3ce4026/editor.js/buggy/editor/ui/composer/content/editor.js