зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1081537 - Fall back to the addon global (if one exists) in GetEntryDocument. r=bz
This commit is contained in:
Родитель
36e2a81120
Коммит
3268a57801
|
@ -131,7 +131,16 @@ GetEntryGlobal()
|
|||
nsIDocument*
|
||||
GetEntryDocument()
|
||||
{
|
||||
nsCOMPtr<nsPIDOMWindow> entryWin = do_QueryInterface(GetEntryGlobal());
|
||||
nsIGlobalObject* global = GetEntryGlobal();
|
||||
nsCOMPtr<nsPIDOMWindow> entryWin = do_QueryInterface(global);
|
||||
|
||||
// If our entry global isn't a window, see if it's an addon scope associated
|
||||
// with a window. If it is, the caller almost certainly wants that rather
|
||||
// than null.
|
||||
if (!entryWin) {
|
||||
entryWin = xpc::AddonWindowOrNull(global->GetGlobalJSObject());
|
||||
}
|
||||
|
||||
return entryWin ? entryWin->GetExtantDoc() : nullptr;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче