diff --git a/docshell/base/nsDSURIContentListener.cpp b/docshell/base/nsDSURIContentListener.cpp index e8a8a0e12b8..7014c9e1e62 100644 --- a/docshell/base/nsDSURIContentListener.cpp +++ b/docshell/base/nsDSURIContentListener.cpp @@ -25,6 +25,7 @@ #include "nsIChannel.h" #include "nsXPIDLString.h" #include "nsIServiceManager.h" +#include "nsIDOMWindowInternal.h" //***************************************************************************** //*** nsDSURIContentListener: Object Management @@ -108,8 +109,10 @@ nsDSURIContentListener::DoContent(const char* aContentType, return NS_OK; } - if(loadFlags & nsIChannel::LOAD_RETARGETED_DOCUMENT_URI) - mDocShell->SetFocus(); + if (loadFlags & nsIChannel::LOAD_RETARGETED_DOCUMENT_URI) { + nsCOMPtr domWindow = do_GetInterface(NS_STATIC_CAST(nsIDocShell*, mDocShell)); + domWindow->Focus(); + } return NS_OK; }