diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index 71fd80d1359..2a130cc3468 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -13969,7 +13969,8 @@ nsDocShell::ShouldPrepareForIntercept(nsIURI* aURI, bool aIsNonSubresourceReques do_GetService(THIRDPARTYUTIL_CONTRACTID, &result); NS_ENSURE_SUCCESS(result, result); - if (mCurrentURI) { + if (mCurrentURI && + nsContentUtils::CookiesBehavior() == nsICookieService::BEHAVIOR_REJECT_FOREIGN) { nsAutoCString uriSpec; mCurrentURI->GetSpec(uriSpec); if (!(uriSpec.EqualsLiteral("about:blank"))) { @@ -13984,10 +13985,7 @@ nsDocShell::ShouldPrepareForIntercept(nsIURI* aURI, bool aIsNonSubresourceReques return result; } - if (isThirdPartyURI && - (Preferences::GetInt("network.cookie.cookieBehavior", - nsICookieService::BEHAVIOR_ACCEPT) == - nsICookieService::BEHAVIOR_REJECT_FOREIGN)) { + if (isThirdPartyURI) { return NS_OK; } } diff --git a/dom/base/nsContentUtils.h b/dom/base/nsContentUtils.h index 67c80efb2ac..e6a8a153a75 100644 --- a/dom/base/nsContentUtils.h +++ b/dom/base/nsContentUtils.h @@ -2524,6 +2524,11 @@ public: static bool IsNonSubresourceRequest(nsIChannel* aChannel); + static uint32_t CookiesBehavior() + { + return sCookiesBehavior; + } + // The order of these entries matters, as we use std::min for total ordering // of permissions. Private Browsing is considered to be more limiting // then session scoping