mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-02 07:05:24 +00:00
Remove special-case for setting the "src" of a chrome <iframe> or <browser>.
Treat it like we would any other subframe load -- use the chrome as the owner. Bug 348672, r+sr=jst
This commit is contained in:
parent
4e325afd57
commit
4615137f49
@ -165,8 +165,6 @@ nsFrameLoader::LoadURI(nsIURI* aURI)
|
||||
|
||||
// Get our principal
|
||||
nsIPrincipal* principal = mOwnerContent->NodePrincipal();
|
||||
NS_ASSERTION(principal == doc->NodePrincipal(),
|
||||
"Principal mismatch. Should not happen");
|
||||
|
||||
// Check if we are allowed to load absURL
|
||||
rv = secMan->CheckLoadURIWithPrincipal(principal, aURI,
|
||||
@ -179,27 +177,6 @@ nsFrameLoader::LoadURI(nsIURI* aURI)
|
||||
rv = CheckForRecursiveLoad(aURI);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// Is our principal the system principal?
|
||||
nsCOMPtr<nsIPrincipal> sysPrin;
|
||||
rv = secMan->GetSystemPrincipal(getter_AddRefs(sysPrin));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (principal == sysPrin) {
|
||||
// We're a chrome node. Belt and braces -- inherit the principal for this
|
||||
// load instead of just forcing the system principal. That way if we have
|
||||
// something loaded already the principal used will be that of what we
|
||||
// already have loaded.
|
||||
|
||||
// XXX bz I'd love to nix this, but the problem is chrome calling
|
||||
// setAttribute() on an iframe or browser and passing in a javascript: URI.
|
||||
// We probably don't want to run that with chrome privileges... Though in
|
||||
// similar circumstances, if one sets window.location.href from chrome we
|
||||
// _do_ run that with chrome privileges, so maybe we should do the same
|
||||
// here?
|
||||
loadInfo->SetInheritOwner(PR_TRUE);
|
||||
|
||||
// Also, in this case we don't set a referrer, just in case.
|
||||
} else {
|
||||
// We'll use our principal, not that of the document loaded inside us.
|
||||
// This is very important; needed to prevent XSS attacks on documents
|
||||
// loaded in subframes!
|
||||
@ -210,7 +187,6 @@ nsFrameLoader::LoadURI(nsIURI* aURI)
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
loadInfo->SetReferrer(referrer);
|
||||
}
|
||||
|
||||
// Kick off the load...
|
||||
rv = mDocShell->LoadURI(aURI, loadInfo, nsIWebNavigation::LOAD_FLAGS_NONE,
|
||||
|
Loading…
Reference in New Issue
Block a user