Bug 1081537 - Fall back to the addon global (if one exists) in GetEntryDocument. r=bz
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user