commit 67c1cc525e31d7af3d7ada79211d9edf07b6e07e Author: Johann Hofmann jhofmann@mozilla.com Date: Sun Oct 6 15:43:39 2019 +0000
Bug 1554805 - Never set firstPartyDomain on origin attributes for moz-extension. r=rpl,Ehsan,tjr
Differential Revision: https://phabricator.services.mozilla.com/D47425
--HG-- extra : moz-landing-system : lando --- caps/OriginAttributes.cpp | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/caps/OriginAttributes.cpp b/caps/OriginAttributes.cpp index 7f40e6549310..0737bce36321 100644 --- a/caps/OriginAttributes.cpp +++ b/caps/OriginAttributes.cpp @@ -92,6 +92,13 @@ void OriginAttributes::SetFirstPartyDomain(const bool aIsTopLevelDocument, return; }
+ // Add-on principals should never get any first-party domain + // attributes in order to guarantee their storage integrity when switching + // FPI on and off. + if (scheme.EqualsLiteral("moz-extension")) { + return; + } + nsCOMPtr<nsIPrincipal> blobPrincipal; if (dom::BlobURLProtocolHandler::GetBlobURLPrincipal( aURI, getter_AddRefs(blobPrincipal))) {