Bug 841359 - Always log error originating from windows with chrome principals. r=bz

This commit is contained in:
Gavin Sharp 2013-02-16 17:01:59 -08:00
parent 93474d505b
commit f7d3d91a63

View File

@ -136,11 +136,15 @@ nsScriptError::InitWithWindowID(const nsAString& message,
nsIDocShell* docShell = window->GetDocShell();
nsCOMPtr<nsILoadContext> loadContext = do_QueryInterface(docShell);
if (loadContext) {
// Never suppress errors originated from chrome code
mIsFromPrivateWindow = !nsContentUtils::IsCallerChrome() &&
loadContext->UsePrivateBrowsing();
// Never mark exceptions from chrome windows as having come from
// private windows, since we always want them to be reported.
nsIPrincipal* winPrincipal = window->GetPrincipal();
mIsFromPrivateWindow = loadContext->UsePrivateBrowsing() &&
!nsContentUtils::IsSystemPrincipal(winPrincipal);
}
}
}