diff --git a/mozilla/docshell/base/nsDocShell.cpp b/mozilla/docshell/base/nsDocShell.cpp index 8bb86347c99..d345891a469 100644 --- a/mozilla/docshell/base/nsDocShell.cpp +++ b/mozilla/docshell/base/nsDocShell.cpp @@ -8078,6 +8078,16 @@ nsDocShell::EnsureScriptEnvironment() // Note that mScriptGlobal has taken a reference to the script // context, so we don't have to. + // Notify observers that we've created a new outer window. + // The matching notification for domwindowdestroyed is in + // nsGlobalWindow::~nsGlobalWindow(). + nsCOMPtr win(do_QueryInterface(mScriptGlobal)); + nsCOMPtr obsSvc = + do_GetService("@mozilla.org/observer-service;1"); + if (obsSvc) { + obsSvc->NotifyObservers(win, "domwindowcreated", nsnull); + } + return NS_OK; }