mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-11 01:57:00 +00:00
Bug 549539: Send a notification after a new window is created, but before any script inside it has run. r=mrbkap sr=bz
--HG-- extra : rebase_source : f15c2b197eb1a54a2ecb9b738729fda75565932c
This commit is contained in:
parent
6464e01c74
commit
119924bbe0
@ -2061,6 +2061,20 @@ nsGlobalWindow::SetNewDocument(nsIDocument* aDocument,
|
||||
}
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIObserverService> observerService =
|
||||
do_GetService("@mozilla.org/observer-service;1");
|
||||
if (observerService) {
|
||||
nsAutoString origin;
|
||||
nsIPrincipal* principal = aDocument->NodePrincipal();
|
||||
nsContentUtils::GetUTFOrigin(principal, origin);
|
||||
observerService->
|
||||
NotifyObservers(static_cast<nsIDOMWindow*>(this),
|
||||
nsContentUtils::IsSystemPrincipal(principal) ?
|
||||
"chrome-document-global-created" :
|
||||
"content-document-global-created",
|
||||
origin.get());
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user