mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-08 08:48:39 +09:00
Bug 1182569: Update ContentSecurityManager to handle docshell loads
This commit is contained in:
parent
e162907475
commit
846daf6d3b
2 changed files with 68 additions and 27 deletions
|
|
@ -1285,16 +1285,10 @@ NS_HasBeenCrossOrigin(nsIChannel* aChannel, bool aReport)
|
|||
nsCOMPtr<nsILoadInfo> loadInfo = aChannel->GetLoadInfo();
|
||||
MOZ_RELEASE_ASSERT(loadInfo, "Origin tracking only works for channels created with a loadinfo");
|
||||
|
||||
#ifdef DEBUG
|
||||
// Don't enforce TYPE_DOCUMENT assertions for loads
|
||||
// initiated by javascript tests.
|
||||
bool skipContentTypeCheck = false;
|
||||
skipContentTypeCheck = Preferences::GetBool("network.loadinfo.skip_type_assertion");
|
||||
#endif
|
||||
|
||||
MOZ_ASSERT(skipContentTypeCheck ||
|
||||
loadInfo->GetExternalContentPolicyType() != nsIContentPolicy::TYPE_DOCUMENT,
|
||||
"calling NS_HasBeenCrossOrigin on a top level load");
|
||||
// TYPE_DOCUMENT loads have a null LoadingPrincipal and can not be cross origin.
|
||||
if (!loadInfo->LoadingPrincipal()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Always treat tainted channels as cross-origin.
|
||||
if (loadInfo->GetTainting() != LoadTainting::Basic) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue