diff --git a/mozilla/docshell/base/nsDocShell.cpp b/mozilla/docshell/base/nsDocShell.cpp index 00367ce0020..6e34c9c0624 100644 --- a/mozilla/docshell/base/nsDocShell.cpp +++ b/mozilla/docshell/base/nsDocShell.cpp @@ -2666,9 +2666,12 @@ NS_IMETHODIMP nsDocShell::CreateContentViewer(const char* aContentType, // // Retarget the document to this loadgroup... // - if(currentLoadGroup) - currentLoadGroup->RemoveChannel(aOpenedChannel, nsnull, nsnull, nsnull); - + /* First attach the channel to the right loadgroup + * and then remove from the old loadgroup. This + * puts the notifications in the right order and + * we don't null-out LSHE in OnStateChange() for + * all redirected urls + */ aOpenedChannel->SetLoadGroup(loadGroup); // Mark the channel as being a document URI... @@ -2678,6 +2681,9 @@ NS_IMETHODIMP nsDocShell::CreateContentViewer(const char* aContentType, aOpenedChannel->SetLoadAttributes(loadAttribs); loadGroup->AddChannel(aOpenedChannel, nsnull); + if(currentLoadGroup) + currentLoadGroup->RemoveChannel(aOpenedChannel, nsnull, nsnull, nsnull); + } #ifdef SH_IN_FRAMES NS_ENSURE_SUCCESS(Embed(viewer, "", (nsISupports *) nsnull), NS_ERROR_FAILURE);