Bug 1396399 - Clarify rules for applying activeTab permission to content scripts. r=kmag, r=bz

MozReview-Commit-ID: 9xPDX8Qk2iR
This commit is contained in:
Andrew Swan
2017-11-04 21:06:20 -07:00
parent 09c4378db5
commit 8cef91f7e3
22 changed files with 175 additions and 29 deletions

View File

@@ -695,6 +695,7 @@ nsDocShell::LoadURI(nsIURI* aURI,
nsString target;
nsAutoString srcdoc;
bool forceAllowDataURI = false;
bool originalFrameSrc = false;
nsCOMPtr<nsIDocShell> sourceDocShell;
nsCOMPtr<nsIURI> baseURI;
@@ -732,6 +733,7 @@ nsDocShell::LoadURI(nsIURI* aURI,
aLoadInfo->GetSourceDocShell(getter_AddRefs(sourceDocShell));
aLoadInfo->GetBaseURI(getter_AddRefs(baseURI));
aLoadInfo->GetForceAllowDataURI(&forceAllowDataURI);
aLoadInfo->GetOriginalFrameSrc(&originalFrameSrc);
}
MOZ_LOG(gDocShellLeakLog, LogLevel::Debug,
@@ -999,6 +1001,10 @@ nsDocShell::LoadURI(nsIURI* aURI,
flags |= INTERNAL_LOAD_FLAGS_FORCE_ALLOW_DATA_URI;
}
if (originalFrameSrc) {
flags |= INTERNAL_LOAD_FLAGS_ORIGINAL_FRAME_SRC;
}
return InternalLoad(aURI,
originalURI,
resultPrincipalURI,
@@ -10404,6 +10410,7 @@ nsDocShell::InternalLoad(nsIURI* aURI,
rv = DoURILoad(aURI, aOriginalURI, aResultPrincipalURI, aLoadReplace,
loadFromExternal,
(aFlags & INTERNAL_LOAD_FLAGS_FORCE_ALLOW_DATA_URI),
(aFlags & INTERNAL_LOAD_FLAGS_ORIGINAL_FRAME_SRC),
aReferrer,
!(aFlags & INTERNAL_LOAD_FLAGS_DONT_SEND_REFERRER),
aReferrerPolicy,
@@ -10543,6 +10550,7 @@ nsDocShell::DoURILoad(nsIURI* aURI,
bool aLoadReplace,
bool aLoadFromExternal,
bool aForceAllowDataURI,
bool aOriginalFrameSrc,
nsIURI* aReferrerURI,
bool aSendReferrer,
uint32_t aReferrerPolicy,
@@ -10724,6 +10732,7 @@ nsDocShell::DoURILoad(nsIURI* aURI,
}
loadInfo->SetLoadTriggeredFromExternal(aLoadFromExternal);
loadInfo->SetForceAllowDataURI(aForceAllowDataURI);
loadInfo->SetOriginalFrameSrcLoad(aOriginalFrameSrc);
// We have to do this in case our OriginAttributes are different from the
// OriginAttributes of the parent document. Or in case there isn't a