From ac4a87c1ae0a63dd446981dab94e75284d1dcf6d Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Sat, 12 Aug 2006 02:09:23 +0000 Subject: [PATCH] Diverting window.open into a tab doesn't stop the about:blank load before returning the new window. Bug 348272, r=bsmedberg, sr=jst --- .../components/windowwatcher/src/nsWindowWatcher.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/embedding/components/windowwatcher/src/nsWindowWatcher.cpp b/embedding/components/windowwatcher/src/nsWindowWatcher.cpp index 80aafa4f0a0e..0ebdfc00dc06 100644 --- a/embedding/components/windowwatcher/src/nsWindowWatcher.cpp +++ b/embedding/components/windowwatcher/src/nsWindowWatcher.cpp @@ -595,6 +595,15 @@ nsWindowWatcher::OpenWindowJSInternal(nsIDOMWindow *aParent, getter_AddRefs(newWindow)); if (NS_SUCCEEDED(rv)) { GetWindowTreeItem(newWindow, getter_AddRefs(newDocShellItem)); + if (windowIsNew && newDocShellItem) { + // Make sure to stop any loads happening in this window that the + // window provider might have started. Otherwise if our caller + // manipulates the window it just opened and then the load + // completes their stuff will get blown away. + nsCOMPtr webNav = + do_QueryInterface(newDocShellItem); + webNav->Stop(nsIWebNavigation::STOP_NETWORK); + } } } }