diff --git a/caps/BasePrincipal.cpp b/caps/BasePrincipal.cpp index b02932820254..f5f53a4eeaaa 100644 --- a/caps/BasePrincipal.cpp +++ b/caps/BasePrincipal.cpp @@ -556,6 +556,12 @@ nsresult BasePrincipal::CheckMayLoadHelper(nsIURI* aURI, NS_IMETHODIMP BasePrincipal::IsThirdPartyURI(nsIURI* aURI, bool* aRes) { + if (IsSystemPrincipal()) { + // Nothing is 3rd party to the system principal. + *aRes = false; + return NS_OK; + } + *aRes = true; // If we do not have a URI its always 3rd party. nsCOMPtr prinURI; @@ -579,6 +585,12 @@ BasePrincipal::IsThirdPartyPrincipal(nsIPrincipal* aPrin, bool* aRes) { } NS_IMETHODIMP BasePrincipal::IsThirdPartyChannel(nsIChannel* aChan, bool* aRes) { + if (IsSystemPrincipal()) { + // Nothing is 3rd party to the system principal. + *aRes = false; + return NS_OK; + } + nsCOMPtr prinURI; GetURI(getter_AddRefs(prinURI)); ThirdPartyUtil* thirdPartyUtil = ThirdPartyUtil::GetInstance();