rem: document.commandDispatcher.focusedWindow = window; if (element instanceof Components.interfaces.nsIDOMElement) 
add: if (element instanceof Components.interfaces.nsIDOMWindow) { document.commandDispatcher.focusedWindow = element; document.commandDispatcher.focusedElement = null; } else if (element instanceof Components.interfaces.nsIDOMElement) { document.commandDispatcher.focusedWindow = element.ownerDocument.defaultView; 
context: function WindowFocusTimerCallback(element){  // This fuction is a redo of the fix for jag bug 91884  var ww = Components.classes["@mozilla.org/embedcomp/window-watcher;1"]                     .getService(Components.interfaces.nsIWindowWatcher);  if (window == ww.activeWindow) {    element.focus();  } else {    // set the element in command dispatcher so focus will restore properly    // when the window does become active    document.commandDispatcher.focusedWindow = window;    if (element instanceof Components.interfaces.nsIDOMElement)      document.commandDispatcher.focusedElement = element;  }}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/e78f794d7c23ad16270b7fe5ae8b38df6457109d/navigator.js/clean/xpfe/browser/resources/content/navigator.js