Bug 1258033 - Part 1: Add IsTrackingProtectionOn for nsILoadContext. r=smaug
MozReview-Commit-ID: 2eQzO6KDLyX
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#include "mozilla/Assertions.h"
|
||||
#include "mozilla/BasePrincipal.h"
|
||||
#include "mozilla/LoadContext.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/dom/ScriptSettings.h" // for AutoJSAPI
|
||||
#include "nsContentUtils.h"
|
||||
#include "xpcpublic.h"
|
||||
@@ -202,6 +203,23 @@ LoadContext::GetOriginAttributes(JS::MutableHandleValue aAttrs)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
LoadContext::IsTrackingProtectionOn(bool* aIsTrackingProtectionOn)
|
||||
{
|
||||
MOZ_ASSERT(mIsNotNull);
|
||||
|
||||
if (Preferences::GetBool("privacy.trackingprotection.enabled", false)) {
|
||||
*aIsTrackingProtectionOn = true;
|
||||
} else if (mUsePrivateBrowsing &&
|
||||
Preferences::GetBool("privacy.trackingprotection.pbmode.enabled", false)) {
|
||||
*aIsTrackingProtectionOn = true;
|
||||
} else {
|
||||
*aIsTrackingProtectionOn = false;
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// LoadContext::nsIInterfaceRequestor
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user