Bug 1639195 - Part 1: Make BrowserChild::RecvLoadURL() to use the correct triggering princpal. r=ckerschb,mattwoodrow
This patch makes the triggering princpal to be propagated to the BrowserChild when calling LoadURL in nsFrameLoader. And use it as the triggering principal for loading instead of the system principal. Differential Revision: https://phabricator.services.mozilla.com/D75965
This commit is contained in:
@@ -576,7 +576,15 @@ nsresult nsFrameLoader::ReallyStartLoadingInternal() {
|
||||
mRemoteBrowser->ResumeLoad(mPendingSwitchID);
|
||||
mPendingSwitchID = 0;
|
||||
} else {
|
||||
mRemoteBrowser->LoadURL(mURIToLoad);
|
||||
// The triggering principal could be null if the frame is loaded other
|
||||
// than the src attribute, for example, the frame is sandboxed. In the
|
||||
// case we use the principal of the owner content, which is needed to
|
||||
// prevent XSS attaches on documents loaded in subframes.
|
||||
if (mTriggeringPrincipal) {
|
||||
mRemoteBrowser->LoadURL(mURIToLoad, mTriggeringPrincipal);
|
||||
} else {
|
||||
mRemoteBrowser->LoadURL(mURIToLoad, mOwnerContent->NodePrincipal());
|
||||
}
|
||||
}
|
||||
|
||||
if (!mRemoteBrowserShown) {
|
||||
|
||||
Reference in New Issue
Block a user