Bug 1570971 - Enable all the annotation URL-Classifier features and remove their prefs, r=Ehsan

Differential Revision: https://phabricator.services.mozilla.com/D40420

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Andrea Marchesini 2019-08-05 11:34:24 +00:00
Родитель 8f0375b40d
Коммит 01a1f139a1
17 изменённых файлов: 35 добавлений и 93 удалений

Просмотреть файл

@ -1253,9 +1253,7 @@ pref("services.sync.prefs.sync.privacy.fuzzyfox.clockgrainus", false);
pref("services.sync.prefs.sync.privacy.sanitize.sanitizeOnShutdown", true);
pref("services.sync.prefs.sync.privacy.trackingprotection.enabled", true);
pref("services.sync.prefs.sync.privacy.trackingprotection.cryptomining.enabled", true);
pref("services.sync.prefs.sync.privacy.trackingprotection.cryptomining.annotate.enabled", true);
pref("services.sync.prefs.sync.privacy.trackingprotection.fingerprinting.enabled", true);
pref("services.sync.prefs.sync.privacy.trackingprotection.fingerprinting.annotate.enabled", true);
pref("services.sync.prefs.sync.privacy.trackingprotection.pbmode.enabled", true);
pref("services.sync.prefs.sync.privacy.resistFingerprinting", true);
pref("services.sync.prefs.sync.privacy.reduceTimerPrecision", true);

Просмотреть файл

@ -902,7 +902,7 @@ var ThirdPartyCookies = {
};
var SocialTracking = {
PREF_ENABLED: "privacy.trackingprotection.socialtracking.annotate.enabled",
PREF_ENABLED: "privacy.socialtracking.block_cookies.enabled",
PREF_NOTIFICATION_UI_ENABLED: "privacy.socialtracking.notification.enabled",
PREF_SESSION_PAGELOAD_MIN:
"privacy.socialtracking.notification.session.pageload.min",

Просмотреть файл

@ -6,8 +6,6 @@
const TRACKING_PAGE =
"http://example.org/browser/browser/base/content/test/trackingUI/trackingPage.html";
const CM_PROTECTION_PREF = "privacy.trackingprotection.cryptomining.enabled";
const CM_ANNOTATION_PREF =
"privacy.trackingprotection.cryptomining.annotate.enabled";
let cmHistogram;
add_task(async function setup() {
@ -24,7 +22,7 @@ add_task(async function setup() {
["privacy.trackingprotection.enabled", false],
["privacy.trackingprotection.annotate_channels", false],
["privacy.trackingprotection.fingerprinting.enabled", false],
["privacy.trackingprotection.fingerprinting.annotate.enabled", false],
["urlclassifier.features.fingerprinting.annotate.blacklistHosts", ""],
],
});
cmHistogram = Services.telemetry.getHistogramById(
@ -192,7 +190,6 @@ function testTelemetry(pagesVisited, pagesWithBlockableContent, hasException) {
add_task(async function test() {
Services.prefs.setBoolPref(CM_PROTECTION_PREF, true);
Services.prefs.setBoolPref(CM_ANNOTATION_PREF, true);
await testIdentityState(false);
await testIdentityState(true);
@ -201,5 +198,4 @@ add_task(async function test() {
await testSubview(true);
Services.prefs.clearUserPref(CM_PROTECTION_PREF);
Services.prefs.clearUserPref(CM_ANNOTATION_PREF);
});

Просмотреть файл

@ -6,8 +6,6 @@
const TRACKING_PAGE =
"http://example.org/browser/browser/base/content/test/trackingUI/trackingPage.html";
const FP_PROTECTION_PREF = "privacy.trackingprotection.fingerprinting.enabled";
const FP_ANNOTATION_PREF =
"privacy.trackingprotection.fingerprinting.annotate.enabled";
let fpHistogram;
add_task(async function setup() {
@ -24,7 +22,8 @@ add_task(async function setup() {
["privacy.trackingprotection.enabled", false],
["privacy.trackingprotection.annotate_channels", false],
["privacy.trackingprotection.cryptomining.enabled", false],
["privacy.trackingprotection.cryptomining.annotate.enabled", false],
["urlclassifier.features.cryptomining.annotate.blacklistHosts", ""],
["urlclassifier.features.cryptomining.annotate.blacklistTables", ""],
],
});
fpHistogram = Services.telemetry.getHistogramById(
@ -191,7 +190,6 @@ function testTelemetry(pagesVisited, pagesWithBlockableContent, hasException) {
add_task(async function test() {
Services.prefs.setBoolPref(FP_PROTECTION_PREF, true);
Services.prefs.setBoolPref(FP_ANNOTATION_PREF, true);
await testIdentityState(false);
await testIdentityState(true);
@ -200,5 +198,4 @@ add_task(async function test() {
await testSubview(true);
Services.prefs.clearUserPref(FP_PROTECTION_PREF);
Services.prefs.clearUserPref(FP_ANNOTATION_PREF);
});

Просмотреть файл

@ -39,7 +39,6 @@ add_task(async function setup() {
await SpecialPowers.pushPrefEnv({
set: [
["privacy.trackingprotection.fingerprinting.annotate.enabled", true],
[
"urlclassifier.features.fingerprinting.blacklistHosts",
"fingerprinting.example.com",

Просмотреть файл

@ -9,8 +9,8 @@ const TRACKING_PAGE =
add_task(async function setup() {
await SpecialPowers.pushPrefEnv({
set: [
["privacy.socialtracking.block_cookies.enabled", true],
["privacy.trackingprotection.socialtracking.enabled", true],
["privacy.trackingprotection.socialtracking.annotate.enabled", true],
[
"urlclassifier.features.socialtracking.blacklistHosts",
"socialtracking.example.com",
@ -22,9 +22,11 @@ add_task(async function setup() {
["privacy.trackingprotection.enabled", false],
["privacy.trackingprotection.annotate_channels", false],
["privacy.trackingprotection.cryptomining.enabled", false],
["privacy.trackingprotection.cryptomining.annotate.enabled", false],
["urlclassifier.features.cryptomining.annotate.blacklistHosts", ""],
["urlclassifier.features.cryptomining.annotate.blacklistTables", ""],
["privacy.trackingprotection.fingerprinting.enabled", false],
["privacy.trackingprotection.fingerprinting.annotate.enabled", false],
["urlclassifier.features.fingerprinting.annotate.blacklistHosts", ""],
["urlclassifier.features.fingerprinting.annotate.blacklistTables", ""],
],
});
});

Просмотреть файл

@ -5742,36 +5742,18 @@
value: false
mirror: always
# Annotate fingerprinting resources.
- name: privacy.trackingprotection.fingerprinting.annotate.enabled
type: bool
value: true
mirror: always
# Block 3rd party cryptomining resources.
- name: privacy.trackingprotection.cryptomining.enabled
type: bool
value: false
mirror: always
# Annotate cryptomining resources.
- name: privacy.trackingprotection.cryptomining.annotate.enabled
type: bool
value: true
mirror: always
# Block 3rd party socialtracking resources.
- name: privacy.trackingprotection.socialtracking.enabled
type: bool
value: false
mirror: always
# Annotate socialtracking resources.
- name: privacy.trackingprotection.socialtracking.annotate.enabled
type: bool
value: false
mirror: always
# Consider socialtracking annotation as trackers (see ETP)
- name: privacy.socialtracking.block_cookies.enabled
type: bool

Просмотреть файл

@ -529,15 +529,13 @@ interface nsIHttpChannel : nsIChannel
cenum ClassificationFlags : 32 {
/**
* The resource is on the fingerprinting list. This is only available if
* the privacy.trackingprotection.fingerprinting_annotate_enabled pref.
* The resource is on the fingerprinting list.
*/
CLASSIFIED_FINGERPRINTING = 0x0001,
CLASSIFIED_FINGERPRINTING_CONTENT = 0x0080,
/**
* The resource is on the cryptomining list. This is only available if
* the privacy.trackingprotection.cryptomining_annotate_enabled pref is set.
* The resource is on the cryptomining list.
*/
CLASSIFIED_CRYPTOMINING = 0x0002,
CLASSIFIED_CRYPTOMINING_CONTENT = 0x0100,
@ -557,10 +555,10 @@ interface nsIHttpChannel : nsIChannel
/**
* The following are about social tracking.
*/
CLASSIFIED_SOCIALTRACKING = 0x0100,
CLASSIFIED_SOCIALTRACKING_FACEBOOK = 0x0200,
CLASSIFIED_SOCIALTRACKING_LINKEDIN = 0x0400,
CLASSIFIED_SOCIALTRACKING_TWITTER = 0x0800,
CLASSIFIED_SOCIALTRACKING = 0x0200,
CLASSIFIED_SOCIALTRACKING_FACEBOOK = 0x0400,
CLASSIFIED_SOCIALTRACKING_LINKEDIN = 0x0800,
CLASSIFIED_SOCIALTRACKING_TWITTER = 0x1000,
/**
* This is exposed to help to identify tracking classification using the

Просмотреть файл

@ -8,7 +8,6 @@
#include "mozilla/AntiTrackingCommon.h"
#include "mozilla/net/UrlClassifierCommon.h"
#include "mozilla/StaticPrefs_privacy.h"
#include "nsContentUtils.h"
#include "nsNetUtil.h"
@ -88,11 +87,6 @@ UrlClassifierFeatureCryptominingAnnotation::MaybeCreate(nsIChannel* aChannel) {
("UrlClassifierFeatureCryptominingAnnotation: MaybeCreate for channel %p",
aChannel));
if (!StaticPrefs::
privacy_trackingprotection_cryptomining_annotate_enabled()) {
return nullptr;
}
if (!UrlClassifierCommon::ShouldEnableClassifier(aChannel)) {
return nullptr;
}

Просмотреть файл

@ -8,7 +8,6 @@
#include "mozilla/AntiTrackingCommon.h"
#include "mozilla/net/UrlClassifierCommon.h"
#include "mozilla/StaticPrefs_privacy.h"
#include "nsContentUtils.h"
#include "nsNetUtil.h"
@ -90,11 +89,6 @@ UrlClassifierFeatureFingerprintingAnnotation::MaybeCreate(
"%p",
aChannel));
if (!StaticPrefs::
privacy_trackingprotection_fingerprinting_annotate_enabled()) {
return nullptr;
}
if (!UrlClassifierCommon::ShouldEnableClassifier(aChannel)) {
return nullptr;
}

Просмотреть файл

@ -8,7 +8,6 @@
#include "mozilla/AntiTrackingCommon.h"
#include "mozilla/net/UrlClassifierCommon.h"
#include "mozilla/StaticPrefs_privacy.h"
#include "nsContentUtils.h"
#include "nsNetUtil.h"
@ -90,11 +89,6 @@ UrlClassifierFeatureSocialTrackingAnnotation::MaybeCreate(
"%p",
aChannel));
if (!StaticPrefs::
privacy_trackingprotection_socialtracking_annotate_enabled()) {
return nullptr;
}
if (!UrlClassifierCommon::ShouldEnableClassifier(aChannel)) {
return nullptr;
}

Просмотреть файл

@ -12,7 +12,6 @@ function runTest(obj) {
["privacy.trackingprotection.annotate_channels", true],
["privacy.storagePrincipal.enabledForTrackers", false],
["urlclassifier.features.socialtracking.annotate.blacklistHosts", "not-tracking.example.com"],
["privacy.trackingprotection.socialtracking.annotate.enabled", obj.annotationEnabled],
["urlclassifier.features.socialtracking.blacklistHosts", "not-tracking.example.com"],
["privacy.trackingprotection.socialtracking.enabled", obj.protectionEnabled],
["privacy.socialtracking.block_cookies.enabled", obj.cookieBlocking],
@ -75,18 +74,8 @@ function runTest(obj) {
});
}
runTest({
testName: "Socialtracking-annotation feature not enabled",
annotationEnabled: false,
protectionEnabled: false,
loading: true,
cookieBlocking: false,
result: true,
});
runTest({
testName: "Socialtracking-annotation feature enabled but not considered for tracking detection.",
annotationEnabled: true,
protectionEnabled: false,
loading: true,
cookieBlocking: false,
@ -95,7 +84,6 @@ runTest({
runTest({
testName: "Socialtracking-annotation feature enabled and considered for tracking detection.",
annotationEnabled: true,
protectionEnabled: false,
loading: true,
cookieBlocking: true,
@ -104,7 +92,6 @@ runTest({
runTest({
testName: "Socialtracking-protection feature enabled.",
annotationEnabled: true,
protectionEnabled: true,
loading: false,
cookieBlocking: true,

Просмотреть файл

@ -174,10 +174,7 @@ const FEATURES = [
"urlclassifier.features.fingerprinting.annotate.whitelistTables",
],
enabled() {
return Services.prefs.getBoolPref(
"privacy.trackingprotection.fingerprinting.annotate.enabled",
false
);
return true;
},
update() {
return Services.prefs.getBoolPref(
@ -250,10 +247,7 @@ const FEATURES = [
"urlclassifier.features.socialtracking.annotate.whitelistTables",
],
enabled() {
return Services.prefs.getBoolPref(
"privacy.trackingprotection.socialtracking.annotate.enabled",
false
);
return true;
},
update() {
return Services.prefs.getBoolPref(

Просмотреть файл

@ -14,10 +14,14 @@ runTests(SpecialPowers.Ci.nsIHttpChannel.CLASSIFIED_TRACKING,
[
["privacy.trackingprotection.enabled", true],
["privacy.trackingprotection.annotate_channels", true],
["privacy.trackingprotection.fingerprinting.annotate.enabled", false],
["urlclassifier.features.fingerprinting.annotate.blacklistTables", ""],
["urlclassifier.features.fingerprinting.annotate.blacklistHosts", ""],
["privacy.trackingprotection.fingerprinting.enabled", false],
["privacy.trackingprotection.cryptomining.annotate.enabled", false],
["urlclassifier.features.cryptomining.annotate.blacklistTables", ""],
["urlclassifier.features.cryptomining.annotate.blacklistHosts", ""],
["privacy.trackingprotection.cryptomining.enabled", false],
["urlclassifier.features.socialtracking.annotate.blacklistTables", ""],
["urlclassifier.features.socialtracking.annotate.blacklistHosts", ""],
],
true /* a tracking resource */);
SimpleTest.waitForExplicitFinish();

Просмотреть файл

@ -14,11 +14,12 @@ runTests(SpecialPowers.Ci.nsIHttpChannel.CLASSIFIED_CRYPTOMINING,
[
["privacy.trackingprotection.enabled", false],
["privacy.trackingprotection.annotate_channels", false],
["privacy.trackingprotection.fingerprinting.annotate.enabled", false],
["urlclassifier.features.fingerprinting.annotate.blacklistHosts", ""],
["urlclassifier.features.fingerprinting.annotate.blacklistTables", ""],
["privacy.trackingprotection.fingerprinting.enabled", false],
["privacy.trackingprotection.cryptomining.annotate.enabled", true],
["privacy.trackingprotection.cryptomining.enabled", true],
["privacy.trackingprotection.socialtracking.annotate.enabled", false],
["urlclassifier.features.socialtracking.annotate.blacklistHosts", ""],
["urlclassifier.features.socialtracking.annotate.blacklistTables", ""],
["privacy.trackingprotection.socialtracking.enabled", false],
],
false /* a tracking resource */);

Просмотреть файл

@ -14,11 +14,12 @@ runTests(SpecialPowers.Ci.nsIHttpChannel.CLASSIFIED_FINGERPRINTING,
[
["privacy.trackingprotection.enabled", false],
["privacy.trackingprotection.annotate_channels", false],
["privacy.trackingprotection.fingerprinting.annotate.enabled", true],
["privacy.trackingprotection.fingerprinting.enabled", true],
["privacy.trackingprotection.cryptomining.annotate.enabled", false],
["urlclassifier.features.cryptomining.annotate.blacklistHosts", ""],
["urlclassifier.features.cryptomining.annotate.blacklistTables", ""],
["privacy.trackingprotection.cryptomining.enabled", false],
["privacy.trackingprotection.socialtracking.annotate.enabled", false],
["urlclassifier.features.socialtracking.annotate.blacklistHosts", ""],
["urlclassifier.features.socialtracking.annotate.blacklistTables", ""],
["privacy.trackingprotection.socialtracking.enabled", false],
],
true /* a tracking resource */);

Просмотреть файл

@ -14,11 +14,12 @@ runTests(SpecialPowers.Ci.nsIHttpChannel.CLASSIFIED_SOCIALTRACKING,
[
["privacy.trackingprotection.enabled", false],
["privacy.trackingprotection.annotate_channels", false],
["privacy.trackingprotection.fingerprinting.annotate.enabled", false],
["urlclassifier.features.fingerprinting.annotate.blacklistHosts", ""],
["urlclassifier.features.fingerprinting.annotate.blacklistTables", ""],
["privacy.trackingprotection.fingerprinting.enabled", false],
["privacy.trackingprotection.cryptomining.annotate.enabled", false],
["urlclassifier.features.cryptomining.annotate.blacklistHosts", ""],
["urlclassifier.features.cryptomining.annotate.blacklistTables", ""],
["privacy.trackingprotection.cryptomining.enabled", false],
["privacy.trackingprotection.socialtracking.annotate.enabled", true],
["privacy.trackingprotection.socialtracking.enabled", true],
],
false /* a tracking resource */);