commit b9e7d044aa52c8cda48c73616d70324f666fe1e7 Author: Arthur Edelstein arthuredelstein@gmail.com Date: Sun Jan 17 23:32:59 2016 -0800
fixup! Bug #13670.1: Isolate favicon requests by first party
Fixes https://bugs.torproject.org/18030, "Favicons loaded via the Page Info dialog are not going over the same circuit as the URL bar domain" --- browser/base/content/pageinfo/pageInfo.js | 2 ++ dom/base/nsContentUtils.cpp | 2 +- dom/base/nsImageLoadingContent.cpp | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/browser/base/content/pageinfo/pageInfo.js b/browser/base/content/pageinfo/pageInfo.js index 4c75d65..6183532 100644 --- a/browser/base/content/pageinfo/pageInfo.js +++ b/browser/base/content/pageinfo/pageInfo.js @@ -970,6 +970,8 @@ function makePreview(row)
var newImage = new Image; newImage.id = "thepreviewimage"; + // Ensure "Media" items are fetched over the first-party domain. + newImage.setAttribute("firstparty", gWindow.top.document.location); var physWidth = 0, physHeight = 0; var width = 0, height = 0;
diff --git a/dom/base/nsContentUtils.cpp b/dom/base/nsContentUtils.cpp index 5d3dea7..67cd53b 100644 --- a/dom/base/nsContentUtils.cpp +++ b/dom/base/nsContentUtils.cpp @@ -3000,7 +3000,7 @@ nsContentUtils::LoadImage(nsIURI* aURI, nsINode* aLoadingNode, NS_PRECONDITION(aLoadingPrincipal, "Must have a principal"); NS_PRECONDITION(aRequest, "Null out param");
- nsCOMPtr<nsIDocument> aLoadingDocument(aLoadingNode ? aLoadingNode->GetCurrentDoc() : nullptr); + nsCOMPtr<nsIDocument> aLoadingDocument(aLoadingNode ? aLoadingNode->OwnerDoc() : nullptr);
imgLoader* imgLoader = GetImgLoaderForDocument(aLoadingDocument); if (!imgLoader) { diff --git a/dom/base/nsImageLoadingContent.cpp b/dom/base/nsImageLoadingContent.cpp index 55c2bd7..64ec1d4 100644 --- a/dom/base/nsImageLoadingContent.cpp +++ b/dom/base/nsImageLoadingContent.cpp @@ -932,7 +932,7 @@ nsImageLoadingContent::LoadImage(nsIURI* aNewURI, nsCOMPtr<nsIContent> content = do_QueryInterface(static_cast<nsIImageLoadingContent*>(this)); nsresult rv; - rv = nsContentUtils::LoadImage(aNewURI, aDocument, + rv = nsContentUtils::LoadImage(aNewURI, content, aDocument->NodePrincipal(), aDocument->GetDocumentURI(), aDocument->GetReferrerPolicy(),
tbb-commits@lists.torproject.org