Dispatch a notification that a newly-opened window has been initialized (bug 326784). r+sr=bzbarsky.
This commit is contained in:
Родитель
092964b5d7
Коммит
7d6f272823
|
@ -96,6 +96,8 @@ interface nsIWindowWatcher : nsISupports {
|
|||
@note This method should try to set the default charset for the new
|
||||
window to the default charset of aParent. This is not guaranteed,
|
||||
however.
|
||||
@note This method may dispatch a "toplevel-window-ready" notification
|
||||
via nsIObserverService if the window did not already exist.
|
||||
*/
|
||||
nsIDOMWindow openWindow(in nsIDOMWindow aParent, in string aUrl,
|
||||
in string aName, in string aFeatures,
|
||||
|
|
|
@ -839,6 +839,16 @@ nsWindowWatcher::OpenWindowJSInternal(nsIDOMWindow *aParent,
|
|||
}
|
||||
}
|
||||
|
||||
if (windowIsNew) {
|
||||
// Notify observers that the window is open and ready.
|
||||
// The window has not yet started to load a document.
|
||||
nsCOMPtr<nsIObserverService> obsSvc =
|
||||
do_GetService("@mozilla.org/observer-service;1");
|
||||
if (obsSvc) {
|
||||
obsSvc->NotifyObservers(*_retval, "toplevel-window-ready", nsnull);
|
||||
}
|
||||
}
|
||||
|
||||
if (uriToLoad) { // get the script principal and pass it to docshell
|
||||
JSContextAutoPopper contextGuard;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче