Bug 1408451: Log to web console when blocking toplevel data: URI navigations. r=bz

This commit is contained in:
Christoph Kerschbaumer
2017-10-16 14:18:52 +02:00
parent 9fde875780
commit f7074d3759
3 changed files with 8 additions and 4 deletions

View File

@@ -9959,10 +9959,13 @@ nsDocShell::InternalLoad(nsIURI* aURI,
isTargetTopLevelDocShell = true;
}
nsIDocument* doc = mContentViewer ? mContentViewer->GetDocument()
: nullptr;
if (!nsContentSecurityManager::AllowTopLevelNavigationToDataURI(
aURI,
contentType,
aTriggeringPrincipal,
doc,
(aLoadType == LOAD_NORMAL_EXTERNAL),
!aFileName.IsVoid())) {
// logging to console happens within AllowTopLevelNavigationToDataURI
@@ -10097,8 +10100,6 @@ nsDocShell::InternalLoad(nsIURI* aURI,
}
}
const nsIDocument* doc = mContentViewer ? mContentViewer->GetDocument()
: nullptr;
const bool isDocumentAuxSandboxed = doc &&
(doc->GetSandboxFlags() & SANDBOXED_AUXILIARY_NAVIGATION);