Bug 1501286 - Part 2: Remove support for tracking protection UI from Control Centre r=johannh

Depends on D9519

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Ehsan Akhgari 2018-10-25 16:52:19 +00:00
parent f398701fb6
commit 09d4b61b43
15 changed files with 83 additions and 312 deletions

View file

@ -1550,11 +1550,8 @@ pref("browser.contentblocking.rejecttrackers.reportBreakage.enabled", true);
pref("browser.contentblocking.reportBreakage.url", "https://tracking-protection-issues.herokuapp.com/new");
// Content Blocking has a separate pref for the intro count, since the former TP intro
// was updated when we introduced content blocking and we want people to see it again.
pref("browser.contentblocking.introCount", 0);
pref("privacy.trackingprotection.introCount", 0);
pref("privacy.trackingprotection.introURL", "https://www.mozilla.org/%LOCALE%/firefox/%VERSION%/tracking-protection/start/");
// Always enable newtab segregation using containers

View file

@ -38,32 +38,6 @@ var TrackingProtection = {
document.getElementById("identity-popup-content-blocking-category-tracking-protection");
},
strings: {
get enableTooltip() {
delete this.enableTooltip;
return this.enableTooltip =
gNavigatorBundle.getString("trackingProtection.toggle.enable.tooltip");
},
get disableTooltip() {
delete this.disableTooltip;
return this.disableTooltip =
gNavigatorBundle.getString("trackingProtection.toggle.disable.tooltip");
},
get disableTooltipPB() {
delete this.disableTooltipPB;
return this.disableTooltipPB =
gNavigatorBundle.getString("trackingProtection.toggle.disable.pbmode.tooltip");
},
get enableTooltipPB() {
delete this.enableTooltipPB;
return this.enableTooltipPB =
gNavigatorBundle.getString("trackingProtection.toggle.enable.pbmode.tooltip");
},
},
init() {
this.updateEnabled();
@ -88,36 +62,11 @@ var TrackingProtection = {
PrivateBrowsingUtils.isWindowPrivate(window));
},
onGlobalToggleCommand() {
if (PrivateBrowsingUtils.isWindowPrivate(window)) {
Services.prefs.setBoolPref(this.PREF_ENABLED_IN_PRIVATE_WINDOWS, !this.enabledInPrivateWindows);
} else {
Services.prefs.setBoolPref(this.PREF_ENABLED_GLOBALLY, !this.enabledGlobally);
}
},
updateEnabled() {
this.enabledGlobally =
Services.prefs.getBoolPref(this.PREF_ENABLED_GLOBALLY);
this.enabledInPrivateWindows =
Services.prefs.getBoolPref(this.PREF_ENABLED_IN_PRIVATE_WINDOWS);
if (!ContentBlocking.contentBlockingUIEnabled) {
ContentBlocking.updateEnabled();
let appMenuButton = ContentBlocking.appMenuButton;
if (PrivateBrowsingUtils.isWindowPrivate(window)) {
appMenuButton.setAttribute("tooltiptext", this.enabledInPrivateWindows ?
this.strings.disableTooltipPB : this.strings.enableTooltipPB);
appMenuButton.setAttribute("enabled", this.enabledInPrivateWindows);
appMenuButton.setAttribute("aria-pressed", this.enabledInPrivateWindows);
} else {
appMenuButton.setAttribute("tooltiptext", this.enabledGlobally ?
this.strings.disableTooltip : this.strings.enableTooltip);
appMenuButton.setAttribute("enabled", this.enabledGlobally);
appMenuButton.setAttribute("aria-pressed", this.enabledGlobally);
}
}
},
isBlockerActivated(state) {
@ -202,12 +151,10 @@ var ContentBlocking = {
// If the user ignores the doorhanger, we stop showing it after some time.
MAX_INTROS: 20,
PREF_ENABLED: "browser.contentblocking.enabled",
PREF_UI_ENABLED: "browser.contentblocking.ui.enabled",
PREF_ANIMATIONS_ENABLED: "toolkit.cosmeticAnimations.enabled",
PREF_REPORT_BREAKAGE_ENABLED: "browser.contentblocking.reportBreakage.enabled",
PREF_REPORT_BREAKAGE_URL: "browser.contentblocking.reportBreakage.url",
PREF_INTRO_COUNT_CB: "browser.contentblocking.introCount",
PREF_INTRO_COUNT_TP: "privacy.trackingprotection.introCount",
PREF_GLOBAL_TOGGLE: "browser.contentblocking.global-toggle.enabled",
content: null,
icon: null,
@ -215,7 +162,7 @@ var ContentBlocking = {
disabledTooltipText: null,
get prefIntroCount() {
return this.contentBlockingUIEnabled ? this.PREF_INTRO_COUNT_CB : this.PREF_INTRO_COUNT_TP;
return this.PREF_INTRO_COUNT_CB;
},
get appMenuLabel() {
@ -331,11 +278,11 @@ var ContentBlocking = {
this.updateEnabled.bind(this));
XPCOMUtils.defineLazyPreferenceGetter(this, "reportBreakageEnabled",
this.PREF_REPORT_BREAKAGE_ENABLED, false);
XPCOMUtils.defineLazyPreferenceGetter(this, "contentBlockingUIEnabled", this.PREF_UI_ENABLED, false,
this.updateUIEnabled.bind(this));
this.updateEnabled();
this.updateUIEnabled();
this.appMenuLabel.setAttribute("label", this.strings.appMenuTitle);
this.appMenuLabel.setAttribute("tooltiptext", this.strings.appMenuTooltip);
this.activeTooltipText =
gNavigatorBundle.getString("trackingProtection.icon.activeTooltip");
@ -355,18 +302,16 @@ var ContentBlocking = {
},
get enabled() {
return this.contentBlockingUIEnabled ? this.contentBlockingEnabled : TrackingProtection.enabled;
return this.contentBlockingEnabled;
},
updateEnabled() {
this.content.toggleAttribute("enabled", this.enabled);
if (this.contentBlockingUIEnabled) {
this.appMenuButton.setAttribute("tooltiptext", this.enabled ?
this.strings.disableTooltip : this.strings.enableTooltip);
this.appMenuButton.setAttribute("enabled", this.enabled);
this.appMenuButton.setAttribute("aria-pressed", this.enabled);
}
this.appMenuButton.setAttribute("tooltiptext", this.enabled ?
this.strings.disableTooltip : this.strings.enableTooltip);
this.appMenuButton.setAttribute("enabled", this.enabled);
this.appMenuButton.setAttribute("aria-pressed", this.enabled);
// The enabled state of blockers may also change since it depends on this.enabled.
for (let blocker of this.blockers) {
@ -374,23 +319,8 @@ var ContentBlocking = {
}
},
updateUIEnabled() {
this.content.toggleAttribute("contentBlockingUI", this.contentBlockingUIEnabled);
if (this.contentBlockingUIEnabled) {
this.appMenuLabel.setAttribute("label", this.strings.appMenuTitle);
this.appMenuLabel.setAttribute("tooltiptext", this.strings.appMenuTooltip);
}
this.updateEnabled();
},
onGlobalToggleCommand() {
if (this.contentBlockingUIEnabled) {
Services.prefs.setBoolPref(this.PREF_ENABLED, !this.enabled);
} else {
TrackingProtection.onGlobalToggleCommand();
}
Services.prefs.setBoolPref(this.PREF_ENABLED, !this.enabled);
},
hideIdentityPopupAndReload() {
@ -615,30 +545,22 @@ var ContentBlocking = {
let brandBundle = document.getElementById("bundle_brand");
let brandShortName = brandBundle.getString("brandShortName");
let introTitle;
let introTitle = gNavigatorBundle.getFormattedString("contentBlocking.intro.title",
[brandShortName]);
let introDescription;
// This will be sent to the onboarding website to let them know which
// UI variation we're showing.
let variation;
if (this.contentBlockingUIEnabled) {
introTitle = gNavigatorBundle.getFormattedString("contentBlocking.intro.title",
[brandShortName]);
// We show a different UI tour variation for users that already have TP
// enabled globally.
if (TrackingProtection.enabledGlobally) {
introDescription = gNavigatorBundle.getString("contentBlocking.intro.v2.description");
variation = 2;
} else {
introDescription = gNavigatorBundle.getFormattedString("contentBlocking.intro.v1.description",
[brandShortName]);
variation = 1;
}
// We show a different UI tour variation for users that already have TP
// enabled globally.
if (TrackingProtection.enabledGlobally) {
introDescription = gNavigatorBundle.getString("contentBlocking.intro.v2.description");
variation = 2;
} else {
introTitle = gNavigatorBundle.getString("trackingProtection.intro.title");
introDescription = gNavigatorBundle.getFormattedString("trackingProtection.intro.description2",
introDescription = gNavigatorBundle.getFormattedString("contentBlocking.intro.v1.description",
[brandShortName]);
variation = 0;
variation = 1;
}
let openStep2 = () => {

View file

@ -4,7 +4,6 @@
"use strict";
const CB_PREF = "browser.contentblocking.enabled";
const CB_UI_PREF = "browser.contentblocking.ui.enabled";
const TOGGLE_PREF = "browser.contentblocking.global-toggle.enabled";
ChromeUtils.import("resource://testing-common/CustomizableUITestUtils.jsm", this);
@ -13,7 +12,6 @@ ChromeUtils.import("resource://testing-common/CustomizableUITestUtils.jsm", this
// normal windows and private windows.
add_task(async function testGlobalToggle() {
await SpecialPowers.pushPrefEnv({set: [
[CB_UI_PREF, true],
[TOGGLE_PREF, true],
]});
@ -43,51 +41,3 @@ add_task(async function testGlobalToggle() {
Services.prefs.clearUserPref(CB_PREF);
});
// Test that the app menu toggle correctly flips the TP pref in
// normal windows and private windows.
add_task(async function testGlobalToggleTP() {
await SpecialPowers.pushPrefEnv({set: [
[CB_UI_PREF, false],
[TOGGLE_PREF, true],
]});
async function runTest(privateWindow) {
let win = await BrowserTestUtils.openNewBrowserWindow({private: privateWindow});
let panelUIButton = await TestUtils.waitForCondition(() => win.document.getElementById("PanelUI-menu-button"));
let prefName = privateWindow ? "privacy.trackingprotection.pbmode.enabled" :
"privacy.trackingprotection.enabled";
info("Opening main menu");
let promiseShown = BrowserTestUtils.waitForEvent(win.PanelUI.mainView, "ViewShown");
panelUIButton.click();
await promiseShown;
info("Opened main menu");
let toggle = win.document.getElementById("appMenu-tp-toggle");
Services.prefs.setBoolPref(prefName, false);
await TestUtils.waitForCondition(() => toggle.getAttribute("enabled") == "false");
Services.prefs.setBoolPref(prefName, true);
await TestUtils.waitForCondition(() => toggle.getAttribute("enabled") == "true");
toggle.click();
is(Services.prefs.getBoolPref(prefName), false);
toggle.click();
is(Services.prefs.getBoolPref(prefName), true);
Services.prefs.clearUserPref(prefName);
await BrowserTestUtils.closeWindow(win);
}
// Run once in private and once in normal window.
await runTest(true);
await runTest(false);
});

View file

@ -4,7 +4,6 @@
"use strict";
const CB_PREF = "browser.contentblocking.enabled";
const CB_UI_PREF = "browser.contentblocking.ui.enabled";
const TP_PREF = "privacy.trackingprotection.enabled";
const FB_PREF = "browser.fastblock.enabled";
const TPC_PREF = "network.cookie.cookieBehavior";
@ -69,7 +68,6 @@ add_task(async function testOpenPreferencesFromPrefsButton() {
add_task(async function testOpenPreferencesFromAddBlockingButtons() {
SpecialPowers.pushPrefEnv({set: [
[CB_PREF, true],
[CB_UI_PREF, true],
[FB_PREF, false],
[TP_PREF, false],
[TPC_PREF, Ci.nsICookieService.BEHAVIOR_ACCEPT],

View file

@ -5,7 +5,6 @@
// browsing mode don't persist once the private browsing window closes.
const CB_PREF = "browser.contentblocking.enabled";
const CB_UI_PREF = "browser.contentblocking.ui.enabled";
const TP_PB_PREF = "privacy.trackingprotection.enabled";
const TRACKING_PAGE = "http://tracking.example.org/browser/browser/base/content/test/trackingUI/trackingPage.html";
var TrackingProtection = null;
@ -61,13 +60,11 @@ function testTrackingPage(window) {
ok(hidden("#identity-popup-content-blocking-not-detected"), "blocking not detected label is hidden");
ok(!hidden("#identity-popup-content-blocking-detected"), "blocking detected label is visible");
if (Services.prefs.getBoolPref(CB_UI_PREF)) {
ok(!hidden("#identity-popup-content-blocking-category-list"), "category list is visible");
ok(hidden("#identity-popup-content-blocking-category-tracking-protection > .identity-popup-content-blocking-category-add-blocking"),
"TP category item is not showing add blocking");
ok(!hidden("#identity-popup-content-blocking-category-tracking-protection > .identity-popup-content-blocking-category-state-label"),
"TP category item is set to blocked");
}
ok(!hidden("#identity-popup-content-blocking-category-list"), "category list is visible");
ok(hidden("#identity-popup-content-blocking-category-tracking-protection > .identity-popup-content-blocking-category-add-blocking"),
"TP category item is not showing add blocking");
ok(!hidden("#identity-popup-content-blocking-category-tracking-protection > .identity-popup-content-blocking-category-state-label"),
"TP category item is set to blocked");
}
function testTrackingPageUnblocked() {
@ -88,13 +85,11 @@ function testTrackingPageUnblocked() {
ok(hidden("#identity-popup-content-blocking-not-detected"), "blocking not detected label is hidden");
ok(!hidden("#identity-popup-content-blocking-detected"), "blocking detected label is visible");
if (Services.prefs.getBoolPref(CB_UI_PREF)) {
ok(!hidden("#identity-popup-content-blocking-category-list"), "category list is visible");
ok(hidden("#identity-popup-content-blocking-category-tracking-protection > .identity-popup-content-blocking-category-add-blocking"),
"TP category item is not showing add blocking");
ok(hidden("#identity-popup-content-blocking-category-tracking-protection > .identity-popup-content-blocking-category-state-label"),
"TP category item is not set to blocked");
}
ok(!hidden("#identity-popup-content-blocking-category-list"), "category list is visible");
ok(hidden("#identity-popup-content-blocking-category-tracking-protection > .identity-popup-content-blocking-category-add-blocking"),
"TP category item is not showing add blocking");
ok(hidden("#identity-popup-content-blocking-category-tracking-protection > .identity-popup-content-blocking-category-state-label"),
"TP category item is not set to blocked");
}
add_task(async function testExceptionAddition() {

View file

@ -8,7 +8,6 @@ const BENIGN_PAGE = "http://tracking.example.org/browser/browser/base/content/te
const COOKIE_PAGE = "http://not-tracking.example.com/browser/browser/base/content/test/trackingUI/cookiePage.html";
const CB_PREF = "browser.contentblocking.enabled";
const CB_UI_PREF = "browser.contentblocking.ui.enabled";
const TP_PREF = "privacy.trackingprotection.enabled";
const PREF_REPORT_BREAKAGE_ENABLED = "browser.contentblocking.reportBreakage.enabled";
const PREF_REPORT_BREAKAGE_URL = "browser.contentblocking.reportBreakage.url";
@ -18,9 +17,6 @@ let {CommonUtils} = ChromeUtils.import("resource://services-common/utils.js", {}
let {Preferences} = ChromeUtils.import("resource://gre/modules/Preferences.jsm", {});
add_task(async function setup() {
await SpecialPowers.pushPrefEnv({set: [
[CB_UI_PREF, true],
]});
await UrlClassifierTestUtils.addTestTrackers();
let oldCanRecord = Services.telemetry.canRecordExtended;

View file

@ -15,7 +15,6 @@
*/
const CB_PREF = "browser.contentblocking.enabled";
const CB_UI_PREF = "browser.contentblocking.ui.enabled";
const TP_PREF = "privacy.trackingprotection.enabled";
const TP_PB_PREF = "privacy.trackingprotection.pbmode.enabled";
const FB_PREF = "browser.fastblock.enabled";
@ -80,10 +79,7 @@ function testBenignPage() {
ok(!hidden("#identity-popup-content-blocking-not-detected"), "blocking not detected label is visible");
ok(hidden("#identity-popup-content-blocking-detected"), "blocking detected label is hidden");
if (Services.prefs.getBoolPref(CB_UI_PREF)) {
ok(hidden("#identity-popup-content-blocking-category-list"), "category list is hidden");
}
ok(hidden("#identity-popup-content-blocking-category-list"), "category list is hidden");
}
function testBenignPageWithException() {
@ -107,10 +103,7 @@ function testBenignPageWithException() {
ok(!hidden("#identity-popup-content-blocking-not-detected"), "blocking not detected label is visible");
ok(hidden("#identity-popup-content-blocking-detected"), "blocking detected label is hidden");
if (Services.prefs.getBoolPref(CB_UI_PREF)) {
ok(hidden("#identity-popup-content-blocking-category-list"), "category list is hidden");
}
ok(hidden("#identity-popup-content-blocking-category-list"), "category list is hidden");
}
function areTrackersBlocked(isPrivateBrowsing) {
@ -148,7 +141,6 @@ function testTrackingPage(window) {
ok(hidden("#tracking-action-block"), "blockButton is hidden");
let isWindowPrivate = PrivateBrowsingUtils.isWindowPrivate(window);
let cbUIEnabled = Services.prefs.getBoolPref(CB_UI_PREF);
if (isWindowPrivate) {
ok(hidden("#tracking-action-unblock"), "unblockButton is hidden");
is(!hidden("#tracking-action-unblock-private"), blockedByTP,
@ -162,21 +154,19 @@ function testTrackingPage(window) {
ok(hidden("#identity-popup-content-blocking-not-detected"), "blocking not detected label is hidden");
ok(!hidden("#identity-popup-content-blocking-detected"), "blocking detected label is visible");
if (cbUIEnabled) {
ok(!hidden("#identity-popup-content-blocking-category-list"), "category list is visible");
let category;
if (Services.prefs.getBoolPref(FB_PREF)) {
category = "#identity-popup-content-blocking-category-fastblock";
} else {
category = Services.prefs.getIntPref(TPC_PREF) == Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER ?
"#identity-popup-content-blocking-category-3rdpartycookies" :
"#identity-popup-content-blocking-category-tracking-protection";
}
is(hidden(category + " > .identity-popup-content-blocking-category-add-blocking"), blockedByTP,
"Category item is" + (blockedByTP ? " not" : "") + " showing add blocking");
is(hidden(category + " > .identity-popup-content-blocking-category-state-label"), !blockedByTP,
"Category item is" + (blockedByTP ? "" : " not") + " set to blocked");
ok(!hidden("#identity-popup-content-blocking-category-list"), "category list is visible");
let category;
if (Services.prefs.getBoolPref(FB_PREF)) {
category = "#identity-popup-content-blocking-category-fastblock";
} else {
category = Services.prefs.getIntPref(TPC_PREF) == Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER ?
"#identity-popup-content-blocking-category-3rdpartycookies" :
"#identity-popup-content-blocking-category-tracking-protection";
}
is(hidden(category + " > .identity-popup-content-blocking-category-add-blocking"), blockedByTP,
"Category item is" + (blockedByTP ? " not" : "") + " showing add blocking");
is(hidden(category + " > .identity-popup-content-blocking-category-state-label"), !blockedByTP,
"Category item is" + (blockedByTP ? "" : " not") + " set to blocked");
if (Services.prefs.getIntPref(TPC_PREF) == Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER) {
ok(hidden("#identity-popup-content-blocking-category-label-default"),
@ -196,10 +186,7 @@ function testTrackingPageUnblocked(blockedByTP, window) {
ok(ContentBlocking.content.hasAttribute("detected"), "trackers are detected");
ok(ContentBlocking.content.hasAttribute("hasException"), "content shows exception");
let isWindowPrivate = PrivateBrowsingUtils.isWindowPrivate(window);
let cbUIEnabled = Services.prefs.getBoolPref(CB_UI_PREF);
let tpEnabled = isWindowPrivate ? Services.prefs.getBoolPref(TP_PB_PREF) : Services.prefs.getBoolPref(TP_PREF);
let blockingEnabled = cbUIEnabled ? Services.prefs.getBoolPref(CB_PREF) : tpEnabled;
let blockingEnabled = Services.prefs.getBoolPref(CB_PREF);
ok(!ContentBlocking.content.hasAttribute("active"), "content is not active");
ok(!ContentBlocking.iconBox.hasAttribute("active"), "shield is not active");
is(ContentBlocking.iconBox.hasAttribute("hasException"), blockingEnabled,
@ -217,22 +204,20 @@ function testTrackingPageUnblocked(blockedByTP, window) {
ok(hidden("#identity-popup-content-blocking-not-detected"), "blocking not detected label is hidden");
ok(!hidden("#identity-popup-content-blocking-detected"), "blocking detected label is visible");
if (Services.prefs.getBoolPref(CB_UI_PREF)) {
ok(!hidden("#identity-popup-content-blocking-category-list"), "category list is visible");
let category;
if (Services.prefs.getBoolPref(FB_PREF)) {
category = "#identity-popup-content-blocking-category-fastblock";
} else {
category = Services.prefs.getIntPref(TPC_PREF) == Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER ?
"#identity-popup-content-blocking-category-3rdpartycookies" :
"#identity-popup-content-blocking-category-tracking-protection";
}
is(hidden(category + " > .identity-popup-content-blocking-category-add-blocking"), blockedByTP,
"Category item is" + (blockedByTP ? " not" : "") + " showing add blocking");
// Always hidden no matter if blockedByTP or not, since we have an exception.
ok(hidden("#identity-popup-content-blocking-category-tracking-protection > .identity-popup-content-blocking-category-state-label"),
"TP category item is not set to blocked");
ok(!hidden("#identity-popup-content-blocking-category-list"), "category list is visible");
let category;
if (Services.prefs.getBoolPref(FB_PREF)) {
category = "#identity-popup-content-blocking-category-fastblock";
} else {
category = Services.prefs.getIntPref(TPC_PREF) == Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER ?
"#identity-popup-content-blocking-category-3rdpartycookies" :
"#identity-popup-content-blocking-category-tracking-protection";
}
is(hidden(category + " > .identity-popup-content-blocking-category-add-blocking"), blockedByTP,
"Category item is" + (blockedByTP ? " not" : "") + " showing add blocking");
// Always hidden no matter if blockedByTP or not, since we have an exception.
ok(hidden("#identity-popup-content-blocking-category-tracking-protection > .identity-popup-content-blocking-category-state-label"),
"TP category item is not set to blocked");
}
function testTrackingPageWithCBDisabled() {
@ -253,13 +238,11 @@ function testTrackingPageWithCBDisabled() {
ok(hidden("#identity-popup-content-blocking-not-detected"), "blocking not detected label is hidden");
ok(!hidden("#identity-popup-content-blocking-detected"), "blocking detected label is visible");
if (Services.prefs.getBoolPref(CB_UI_PREF)) {
ok(!hidden("#identity-popup-content-blocking-category-list"), "category list is visible");
ok(!hidden("#identity-popup-content-blocking-category-tracking-protection > .identity-popup-content-blocking-category-add-blocking"),
"TP category item is showing add blocking");
ok(hidden("#identity-popup-content-blocking-category-tracking-protection > .identity-popup-content-blocking-category-state-label"),
"TP category item is not set to blocked");
}
ok(!hidden("#identity-popup-content-blocking-category-list"), "category list is visible");
ok(!hidden("#identity-popup-content-blocking-category-tracking-protection > .identity-popup-content-blocking-category-add-blocking"),
"TP category item is showing add blocking");
ok(hidden("#identity-popup-content-blocking-category-tracking-protection > .identity-popup-content-blocking-category-state-label"),
"TP category item is not set to blocked");
}
async function testContentBlockingEnabled(tab) {
@ -353,13 +336,8 @@ add_task(async function testNormalBrowsing() {
await testContentBlockingEnabled(tab);
if (Services.prefs.getBoolPref(CB_UI_PREF)) {
Services.prefs.setBoolPref(CB_PREF, false);
ok(!ContentBlocking.enabled, "CB is disabled after setting the pref");
} else {
Services.prefs.setBoolPref(TP_PREF, false);
ok(!TrackingProtection.enabled, "TP is disabled after setting the pref");
}
Services.prefs.setBoolPref(CB_PREF, false);
ok(!ContentBlocking.enabled, "CB is disabled after setting the pref");
await testContentBlockingDisabled(tab);
@ -370,13 +348,8 @@ add_task(async function testNormalBrowsing() {
await testContentBlockingEnabled(tab);
if (Services.prefs.getBoolPref(CB_UI_PREF)) {
Services.prefs.setBoolPref(CB_PREF, false);
ok(!ContentBlocking.enabled, "CB is disabled after setting the pref");
} else {
Services.prefs.setBoolPref(TP_PREF, false);
ok(!TrackingProtection.enabled, "TP is disabled after setting the pref");
}
Services.prefs.setBoolPref(CB_PREF, false);
ok(!ContentBlocking.enabled, "CB is disabled after setting the pref");
await testContentBlockingDisabled(tab);
@ -406,13 +379,8 @@ add_task(async function testPrivateBrowsing() {
await testContentBlockingEnabled(tab);
if (Services.prefs.getBoolPref(CB_UI_PREF)) {
Services.prefs.setBoolPref(CB_PREF, false);
ok(!ContentBlocking.enabled, "CB is disabled after setting the pref");
} else {
Services.prefs.setBoolPref(TP_PB_PREF, false);
ok(!TrackingProtection.enabled, "TP is disabled after setting the pref");
}
Services.prefs.setBoolPref(CB_PREF, false);
ok(!ContentBlocking.enabled, "CB is disabled after setting the pref");
await testContentBlockingDisabled(tab);
@ -423,13 +391,8 @@ add_task(async function testPrivateBrowsing() {
await testContentBlockingEnabled(tab);
if (Services.prefs.getBoolPref(CB_UI_PREF)) {
Services.prefs.setBoolPref(CB_PREF, false);
ok(!ContentBlocking.enabled, "CB is disabled after setting the pref");
} else {
Services.prefs.setBoolPref(TP_PB_PREF, false);
ok(!TrackingProtection.enabled, "TP is disabled after setting the pref");
}
Services.prefs.setBoolPref(CB_PREF, false);
ok(!ContentBlocking.enabled, "CB is disabled after setting the pref");
await testContentBlockingDisabled(tab);
@ -440,11 +403,6 @@ add_task(async function testPrivateBrowsing() {
});
add_task(async function testFastBlock() {
if (!SpecialPowers.getBoolPref(CB_UI_PREF)) {
info("The FastBlock test is disabled when the Content Blocking UI is disabled");
return;
}
await UrlClassifierTestUtils.addTestTrackers();
tabbrowser = gBrowser;
@ -464,7 +422,6 @@ add_task(async function testFastBlock() {
await testContentBlockingEnabled(tab);
ok(Services.prefs.getBoolPref(CB_UI_PREF), "CB UI must be enabled here");
Services.prefs.setBoolPref(CB_PREF, false);
ok(!ContentBlocking.enabled, "CB is disabled after setting the pref");
@ -479,7 +436,6 @@ add_task(async function testFastBlock() {
await testContentBlockingEnabled(tab);
ok(Services.prefs.getBoolPref(CB_UI_PREF), "CB UI must be enabled here");
Services.prefs.setBoolPref(CB_PREF, false);
ok(!ContentBlocking.enabled, "CB is disabled after setting the pref");
@ -493,11 +449,6 @@ add_task(async function testFastBlock() {
});
add_task(async function testThirdPartyCookies() {
if (!SpecialPowers.getBoolPref(CB_UI_PREF)) {
info("The ThirdPartyCookies test is disabled when the Content Blocking UI is disabled");
return;
}
await UrlClassifierTestUtils.addTestTrackers();
gTrackingPageURL = COOKIE_PAGE;
@ -518,7 +469,6 @@ add_task(async function testThirdPartyCookies() {
await testContentBlockingEnabled(tab);
ok(Services.prefs.getBoolPref(CB_UI_PREF), "CB UI must be enabled here");
Services.prefs.setBoolPref(CB_PREF, false);
ok(!ContentBlocking.enabled, "CB is disabled after setting the pref");
@ -531,7 +481,6 @@ add_task(async function testThirdPartyCookies() {
await testContentBlockingEnabled(tab);
ok(Services.prefs.getBoolPref(CB_UI_PREF), "CB UI must be enabled here");
Services.prefs.setBoolPref(CB_PREF, false);
ok(!ContentBlocking.enabled, "CB is disabled after setting the pref");

View file

@ -59,9 +59,6 @@
when-connection="not-secure secure secure-ev secure-cert-user-overridden extension">
<vbox id="identity-popup-content-blocking-content" flex="1">
<hbox align="start">
<label id="tracking-protection-label"
class="identity-popup-headline"
flex="1">&trackingProtection.title;</label>
<label id="content-blocking-label"
class="identity-popup-headline"
flex="1">&contentBlocking.title;</label>
@ -76,7 +73,6 @@
</hbox>
<toolbarbutton id="tracking-protection-preferences-button"
class="identity-popup-preferences-button subviewbutton"
tooltiptext="&trackingProtection.tooltip;"
oncommand="ContentBlocking.openPreferences('identityPopup-TP-preferencesButton'); gIdentityHandler.recordClick('cb_prefs_button');" />
</hbox>

View file

@ -226,10 +226,8 @@
<toolbarseparator class="sync-ui-item"/>
<toolbaritem closemenu="none">
<toolbarbutton id="appMenu-tp-label"
tooltiptext="&trackingProtection.tooltip;"
class="subviewbutton subviewbutton-iconic"
oncommand="ContentBlocking.openPreferences('appMenu-trackingprotection'); PanelUI.hide();"
label="&trackingProtection.title;"/>
oncommand="ContentBlocking.openPreferences('appMenu-trackingprotection'); PanelUI.hide();"/>
<toolbarseparator id="appMenu-tp-vertical-separator" orient="vertical"/>
<toolbarbutton id="appMenu-tp-toggle"
enabled="false"

View file

@ -1,7 +1,7 @@
"use strict";
const PREF_INTRO_COUNT = "browser.contentblocking.introCount";
const PREF_CB_UI_ENABLED = "browser.contentblocking.ui.enabled";
const PREF_CB_ENABLED = "browser.contentblocking.enabled";
const PREF_TP_ENABLED = "privacy.trackingprotection.enabled";
const PREF_FB_ENABLED = "browser.fastblock.enabled";
const PREF_FB_TIMEOUT = "browser.fastblock.timeout";
@ -14,7 +14,7 @@ var {UrlClassifierTestUtils} = ChromeUtils.import("resource://testing-common/Url
registerCleanupFunction(function() {
UrlClassifierTestUtils.cleanupTestTrackers();
Services.prefs.clearUserPref(PREF_CB_UI_ENABLED);
Services.prefs.clearUserPref(PREF_CB_ENABLED);
Services.prefs.clearUserPref(PREF_TP_ENABLED);
Services.prefs.clearUserPref(PREF_FB_ENABLED);
Services.prefs.clearUserPref(PREF_FB_TIMEOUT);
@ -26,7 +26,7 @@ function allowOneIntro() {
}
add_task(async function setup_test() {
Services.prefs.setBoolPref(PREF_CB_UI_ENABLED, true);
Services.prefs.setBoolPref(PREF_CB_ENABLED, true);
Services.prefs.setBoolPref(PREF_TP_ENABLED, true);
await UrlClassifierTestUtils.addTestTrackers();
});

View file

@ -1,7 +1,7 @@
"use strict";
const PREF_INTRO_COUNT = "privacy.trackingprotection.introCount";
const PREF_CB_UI_ENABLED = "browser.contentblocking.ui.enabled";
const PREF_INTRO_COUNT = "browser.contentblocking.introCount";
const PREF_CB_ENABLED = "browser.contentblocking.enabled";
const PREF_TP_ENABLED = "privacy.trackingprotection.enabled";
const BENIGN_PAGE = "http://tracking.example.org/browser/browser/base/content/test/trackingUI/benignPage.html";
const TRACKING_PAGE = "http://tracking.example.org/browser/browser/base/content/test/trackingUI/trackingPage.html";
@ -12,9 +12,8 @@ var {UrlClassifierTestUtils} = ChromeUtils.import("resource://testing-common/Url
registerCleanupFunction(function() {
UrlClassifierTestUtils.cleanupTestTrackers();
Services.prefs.clearUserPref(PREF_CB_UI_ENABLED);
Services.prefs.clearUserPref(PREF_CB_ENABLED);
Services.prefs.clearUserPref(PREF_TP_ENABLED);
Services.prefs.clearUserPref(PREF_INTRO_COUNT);
});
function allowOneIntro() {
@ -22,7 +21,7 @@ function allowOneIntro() {
}
add_task(async function setup_test() {
Services.prefs.setBoolPref(PREF_CB_UI_ENABLED, false);
Services.prefs.setBoolPref(PREF_CB_ENABLED, true);
Services.prefs.setBoolPref(PREF_TP_ENABLED, true);
await UrlClassifierTestUtils.addTestTrackers();
});
@ -54,7 +53,7 @@ add_task(async function test_trackingPages() {
is(Services.prefs.getIntPref(PREF_INTRO_COUNT), window.ContentBlocking.MAX_INTROS, "Check intro count increased");
let step2URL = Services.urlFormatter.formatURLPref("privacy.trackingprotection.introURL") +
"?step=2&newtab=true&variation=0";
"?step=2&newtab=true&variation=2";
let buttons = document.getElementById("UITourTooltipButtons");
info("Click the step text and nothing should happen");

View file

@ -1029,9 +1029,6 @@ you can use these alternative items. Otherwise, their values should be empty. -
<!ENTITY contentBlocking.breakageReportView.sendReport.label "Send Report">
<!ENTITY contentBlocking.breakageReportView.cancel.label "Cancel">
<!ENTITY trackingProtection.title "Tracking Protection">
<!ENTITY trackingProtection.tooltip "Open Tracking Protection Preferences">
<!-- LOCALIZATION NOTE (trackingProtection.unblock3.label, trackingProtection.unblock3.accesskey):
The associated button with this label and accesskey is only shown when opening the control
center while looking at a site with trackers in NON-private browsing mode. -->

View file

@ -512,25 +512,14 @@ contentBlocking.tooltip=Open Content Blocking Preferences
contentBlocking.toggle.enable.tooltip=Enable Content Blocking
contentBlocking.toggle.disable.tooltip=Disable Content Blocking
trackingProtection.intro.title=How Tracking Protection works
# LOCALIZATION NOTE (trackingProtection.intro.description2):
# %S is brandShortName. This string should match the one from Step 1 of the tour
# when it starts from the button shown when a new private window is opened.
trackingProtection.intro.description2=When you see the shield, %S is blocking some parts of the page that could track your browsing activity.
# LOCALIZATION NOTE (trackingProtection.intro.step1of3): Indicates that the intro panel is step one of three in a tour.
trackingProtection.intro.step1of3=1 of 3
trackingProtection.intro.nextButton.label=Next
# LOCALIZATION NOTE (contentBlocking.intro.title): %S is brandShortName.
contentBlocking.intro.title=New in %S: Content Blocking
# LOCALIZATION NOTE (contentBlocking.v1.intro.description): %S is brandShortName.
contentBlocking.intro.v1.description=When you see the shield, %S is blocking parts of the page that can slow your browsing or track you online.
contentBlocking.intro.v2.description=The privacy benefits of Tracking Protection are now just one part of content blocking. When you see the shield, content blocking is on.
trackingProtection.toggle.enable.tooltip=Enable Tracking Protection
trackingProtection.toggle.disable.tooltip=Disable Tracking Protection
trackingProtection.toggle.enable.pbmode.tooltip=Enable Tracking Protection in Private Browsing
trackingProtection.toggle.disable.pbmode.tooltip=Disable Tracking Protection in Private Browsing
# LOCALIZATION NOTE (trackingProtection.intro.step1of3): Indicates that the intro panel is step one of three in a tour.
trackingProtection.intro.step1of3=1 of 3
trackingProtection.intro.nextButton.label=Next
trackingProtection.icon.activeTooltip=Tracking attempts blocked
trackingProtection.icon.disabledTooltip=Tracking content detected

View file

@ -383,15 +383,6 @@ description#identity-popup-content-verifier,
background-image: url("chrome://browser/skin/controlcenter/tracking-protection.svg");
}
/* We can currently show either the old tracking protection-only UI, which has "Tracking Protection"
* as a label, or the new content blocking UI which has a different label and also a list of
* categories of blockers. This rule hides elements depending on which UI we want to show */
#identity-popup-content-blocking-content[contentBlockingUI] #tracking-protection-label,
#identity-popup-content-blocking-content:not([contentBlockingUI]) #content-blocking-label,
#identity-popup-content-blocking-content:not([contentBlockingUI]) > #identity-popup-content-blocking-category-list {
display: none;
}
/* Disabled label */
#identity-popup-content-blocking-disabled-label {
@ -419,11 +410,6 @@ description#identity-popup-content-verifier,
stroke: #d70022;
}
#identity-popup-content-blocking-content:not([contentBlockingUI]):not([enabled]) #identity-popup-content-blocking-disabled-label {
background-color: #b1b1b3;
stroke: #b1b1b3;
}
#identity-popup-content-blocking-content:not([enabled]) #identity-popup-content-blocking-disabled-label-exception {
display: none;
}

View file

@ -28,7 +28,6 @@ const TRACKING_PAGE = `http://tracking.example.org/${RESOURCE_PATH}/tracking.htm
var ControlCenter = {
init(libDir) {
// Disable the FTU tours.
Services.prefs.setIntPref("privacy.trackingprotection.introCount", 20);
Services.prefs.setIntPref("browser.contentblocking.introCount", 20);
},