--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -1545,21 +1545,18 @@ pref("browser.contentblocking.reportBrea
#else
pref("browser.contentblocking.reportBreakage.enabled", false);
#endif
// Show report breakage for tracking cookies in all channels.
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
pref("privacy.usercontext.about_newtab_segregation.enabled", true);
// Enable Contextual Identity Containers
#ifdef NIGHTLY_BUILD
pref("privacy.userContext.enabled", true);
pref("privacy.userContext.ui.enabled", true);
--- a/browser/base/content/browser-contentblocking.js
+++ b/browser/base/content/browser-contentblocking.js
@@ -33,42 +33,16 @@ var TrackingProtection = {
enabledInPrivateWindows: false,
get categoryItem() {
delete this.categoryItem;
return this.categoryItem =
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();
Services.prefs.addObserver(this.PREF_ENABLED_GLOBALLY, this);
Services.prefs.addObserver(this.PREF_ENABLED_IN_PRIVATE_WINDOWS, this);
XPCOMUtils.defineLazyPreferenceGetter(this, "visible", this.PREF_UI_ENABLED, false);
},
@@ -83,46 +57,21 @@ var TrackingProtection = {
},
get enabled() {
return this.enabledGlobally ||
(this.enabledInPrivateWindows &&
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) {
return state & Ci.nsIWebProgressListener.STATE_BLOCKED_TRACKING_CONTENT;
},
};
var ThirdPartyCookies = {
@@ -197,30 +146,28 @@ var ThirdPartyCookies = {
},
};
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,
activeTooltipText: null,
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() {
delete this.appMenuLabel;
return this.appMenuLabel = document.getElementById("appMenu-tp-label");
},
get appMenuButton() {
@@ -326,21 +273,21 @@ var ContentBlocking = {
this.updateAnimationsEnabled();
Services.prefs.addObserver(this.PREF_ANIMATIONS_ENABLED, this.updateAnimationsEnabled);
XPCOMUtils.defineLazyPreferenceGetter(this, "contentBlockingEnabled", this.PREF_ENABLED, false,
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");
this.disabledTooltipText =
gNavigatorBundle.getString("trackingProtection.icon.disabledTooltip");
},
uninit() {
@@ -350,52 +297,35 @@ var ContentBlocking = {
}
}
Services.prefs.removeObserver(this.PREF_ANIMATIONS_ENABLED, this.updateAnimationsEnabled);
Services.prefs.removeObserver(this.PREF_GLOBAL_TOGGLE, this.updateGlobalToggleVisibility);
},
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) {
blocker.categoryItem.classList.toggle("blocked", this.enabled && blocker.enabled);
}
},
- 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() {
document.getElementById("identity-popup").hidePopup();
BrowserReload();
},
openPreferences(origin) {
@@ -610,40 +540,32 @@ var ContentBlocking = {
Services.prefs.savePrefFile(null);
}
},
async showIntroPanel() {
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 = () => {
// When the user proceeds in the tour, adjust the counter to indicate that
// the user doesn't need to see the intro anymore.
this.dontShowIntroPanelAgain();
let nextURL = Services.urlFormatter.formatURLPref("privacy.trackingprotection.introURL") +
--- a/browser/base/content/test/trackingUI/browser_trackingUI_appMenu_toggle.js
+++ b/browser/base/content/test/trackingUI/browser_trackingUI_appMenu_toggle.js
@@ -1,24 +1,22 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"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);
// Test that the app menu toggle correctly flips the TP pref in
// normal windows and private windows.
add_task(async function testGlobalToggle() {
await SpecialPowers.pushPrefEnv({set: [
- [CB_UI_PREF, true],
[TOGGLE_PREF, true],
]});
let panelUIButton = await TestUtils.waitForCondition(() => document.getElementById("PanelUI-menu-button"));
info("Opening main menu");
let promiseShown = BrowserTestUtils.waitForEvent(PanelUI.mainView, "ViewShown");
@@ -38,56 +36,8 @@ add_task(async function testGlobalToggle
toggle.click();
is(Services.prefs.getBoolPref(CB_PREF), false);
toggle.click();
is(Services.prefs.getBoolPref(CB_PREF), true);
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);
-});
--- a/browser/base/content/test/trackingUI/browser_trackingUI_open_preferences.js
+++ b/browser/base/content/test/trackingUI/browser_trackingUI_open_preferences.js
@@ -1,15 +1,14 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"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";
const FB_UI_PREF = "browser.contentblocking.fastblock.control-center.ui.enabled";
const TP_UI_PREF = "browser.contentblocking.trackingprotection.control-center.ui.enabled";
const RT_UI_PREF = "browser.contentblocking.rejecttrackers.control-center.ui.enabled";
const TRACKING_PAGE = "http://tracking.example.org/browser/browser/base/content/test/trackingUI/trackingPage.html";
@@ -64,17 +63,16 @@ add_task(async function testOpenPreferen
});
});
// Tests that clicking the contentblocking category items "add blocking" labels
// links to about:preferences
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],
[FB_UI_PREF, true],
[TP_UI_PREF, true],
[RT_UI_PREF, true],
]});
--- a/browser/base/content/test/trackingUI/browser_trackingUI_pbmode_exceptions.js
+++ b/browser/base/content/test/trackingUI/browser_trackingUI_pbmode_exceptions.js
@@ -1,16 +1,15 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
// Test that sites added to the Tracking Protection whitelist in private
// 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;
var ContentBlocking = null;
var browser = null;
registerCleanupFunction(function() {
Services.prefs.clearUserPref(TP_PB_PREF);
@@ -56,23 +55,21 @@ function testTrackingPage(window) {
} else {
ok(!hidden("#tracking-action-unblock"), "unblockButton is visible");
ok(hidden("#tracking-action-unblock-private"), "unblockButtonPrivate is hidden");
}
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() {
info("Tracking content must be white-listed and not blocked");
ok(ContentBlocking.content.hasAttribute("detected"), "trackers are detected");
ok(ContentBlocking.content.hasAttribute("hasException"), "content shows exception");
ok(!ContentBlocking.iconBox.hasAttribute("active"), "shield is active");
@@ -83,23 +80,21 @@ function testTrackingPageUnblocked() {
ok(BrowserTestUtils.is_visible(ContentBlocking.iconBox), "icon box is visible");
ok(!hidden("#tracking-action-block"), "blockButton is visible");
ok(hidden("#tracking-action-unblock"), "unblockButton is hidden");
ok(!hidden("#identity-popup-content-blocking-disabled-label"), "disabled label is visible");
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() {
await UrlClassifierTestUtils.addTestTrackers();
let privateWin = await BrowserTestUtils.openNewBrowserWindow({private: true});
browser = privateWin.gBrowser;
let tab = await BrowserTestUtils.openNewForegroundTab({ gBrowser: browser, waitForLoad: true, waitForStateStop: true });
--- a/browser/base/content/test/trackingUI/browser_trackingUI_report_breakage.js
+++ b/browser/base/content/test/trackingUI/browser_trackingUI_report_breakage.js
@@ -3,29 +3,25 @@
"use strict";
const TRACKING_PAGE = "http://tracking.example.org/browser/browser/base/content/test/trackingUI/trackingPage.html";
const BENIGN_PAGE = "http://tracking.example.org/browser/browser/base/content/test/trackingUI/benignPage.html";
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";
let {HttpServer} = ChromeUtils.import("resource://testing-common/httpd.js", {});
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;
Services.telemetry.canRecordExtended = true;
registerCleanupFunction(() => {
Services.telemetry.canRecordExtended = oldCanRecord;
});
--- a/browser/base/content/test/trackingUI/browser_trackingUI_state.js
+++ b/browser/base/content/test/trackingUI/browser_trackingUI_state.js
@@ -10,17 +10,16 @@
* With TP disabled
* 1) A page with no tracking elements is loaded.
* 2) A page with tracking elements is loaded.
*
* See also Bugs 1175327, 1043801, 1178985
*/
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";
const FB_TIMEOUT_PREF = "browser.fastblock.timeout";
const FB_LIMIT_PREF = "browser.fastblock.limit";
const TPC_PREF = "network.cookie.cookieBehavior";
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";
@@ -75,20 +74,17 @@ function testBenignPage() {
ok(BrowserTestUtils.is_hidden(ContentBlocking.iconBox), "icon box is hidden");
ok(hidden("#tracking-action-block"), "blockButton is hidden");
ok(hidden("#tracking-action-unblock"), "unblockButton is hidden");
is(!hidden("#identity-popup-content-blocking-disabled-label"), !ContentBlocking.enabled,
"disabled label is visible if CB is off");
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() {
info("Non-tracking content must not be blocked");
ok(!ContentBlocking.content.hasAttribute("detected"), "no trackers are detected");
ok(ContentBlocking.content.hasAttribute("hasException"), "content shows exception");
ok(!ContentBlocking.content.hasAttribute("active"), "content is not active");
@@ -102,20 +98,17 @@ function testBenignPageWithException() {
"icon box is not hidden if CB is on");
is(!hidden("#tracking-action-block"), ContentBlocking.enabled,
"blockButton is visible if CB is on");
ok(hidden("#tracking-action-unblock"), "unblockButton is hidden");
ok(!hidden("#identity-popup-content-blocking-disabled-label"), "disabled label is visible");
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) {
let cbEnabled = Services.prefs.getBoolPref(CB_PREF);
let blockedByTP = cbEnabled &&
Services.prefs.getBoolPref(isPrivateBrowsing ? TP_PB_PREF : TP_PREF);
let blockedByFB = cbEnabled &&
Services.prefs.getBoolPref(FB_PREF) &&
@@ -143,45 +136,42 @@ function testTrackingPage(window) {
ok(!ContentBlocking.iconBox.hasAttribute("hasException"), "icon box shows no exception");
is(ContentBlocking.iconBox.getAttribute("tooltiptext"),
blockedByTP ? gNavigatorBundle.getString("trackingProtection.icon.activeTooltip") : "",
"correct tooltip");
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,
"unblockButtonPrivate is" + (blockedByTP ? "" : " not") + " visible");
} else {
ok(hidden("#tracking-action-unblock-private"), "unblockButtonPrivate is hidden");
is(!hidden("#tracking-action-unblock"), blockedByTP,
"unblockButton is" + (blockedByTP ? "" : " not") + " visible");
}
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"),
"Not showing default cookie restrictions label.");
ok(!hidden("#identity-popup-content-blocking-category-label-trackers"),
"Showing trackers cookie restrictions label.");
} else {
ok(hidden("#identity-popup-content-blocking-category-label-trackers"),
@@ -191,20 +181,17 @@ function testTrackingPage(window) {
}
}
function testTrackingPageUnblocked(blockedByTP, window) {
info("Tracking content must be white-listed and not blocked");
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,
"shield" + (blockingEnabled ? " shows" : " doesn't show") + " exception");
is(ContentBlocking.iconBox.getAttribute("tooltiptext"),
gNavigatorBundle.getString("trackingProtection.icon.disabledTooltip"), "correct tooltip");
is(BrowserTestUtils.is_visible(ContentBlocking.iconBox), blockingEnabled,
@@ -212,32 +199,30 @@ function testTrackingPageUnblocked(block
is(hidden("#tracking-action-block"), !blockingEnabled,
"blockButton is" + (blockingEnabled ? " not" : "") + " visible");
ok(hidden("#tracking-action-unblock"), "unblockButton is hidden");
ok(!hidden("#identity-popup-content-blocking-disabled-label"), "disabled label is visible");
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() {
info("Tracking content must be white-listed and not blocked");
ok(ContentBlocking.content.hasAttribute("detected"), "trackers are detected");
ok(!ContentBlocking.content.hasAttribute("hasException"), "content shows no exception");
ok(!ContentBlocking.content.hasAttribute("active"), "content is not active");
@@ -248,23 +233,21 @@ function testTrackingPageWithCBDisabled(
ok(BrowserTestUtils.is_hidden(ContentBlocking.iconBox), "icon box is hidden");
ok(hidden("#tracking-action-block"), "blockButton is hidden");
ok(hidden("#tracking-action-unblock"), "unblockButton is hidden");
ok(!hidden("#identity-popup-content-blocking-disabled-label"), "disabled label is visible");
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) {
info("Testing with Tracking Protection ENABLED.");
info("Load a test page not containing tracking elements");
await promiseTabLoadEvent(tab, BENIGN_PAGE);
testBenignPage();
@@ -348,40 +331,30 @@ add_task(async function testNormalBrowsi
is(TrackingProtection.enabled, Services.prefs.getBoolPref(TP_PREF),
"TP.enabled is based on the original pref value");
Services.prefs.setBoolPref(FB_PREF, false);
Services.prefs.setIntPref(TPC_PREF, Ci.nsICookieService.BEHAVIOR_ACCEPT);
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);
Services.prefs.setBoolPref(TP_PREF, true);
ok(TrackingProtection.enabled, "TP is enabled after setting the pref");
Services.prefs.setBoolPref(CB_PREF, true);
ok(ContentBlocking.enabled, "CB is enabled after setting the pref");
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);
gBrowser.removeCurrentTab();
Services.prefs.clearUserPref(FB_PREF);
Services.prefs.clearUserPref(TPC_PREF);
});
@@ -401,55 +374,40 @@ add_task(async function testPrivateBrows
ok(ContentBlocking, "CB is attached to the private window");
TrackingProtection = tabbrowser.ownerGlobal.TrackingProtection;
ok(TrackingProtection, "TP is attached to the private window");
is(TrackingProtection.enabled, Services.prefs.getBoolPref(TP_PB_PREF),
"TP.enabled is based on the pb pref value");
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);
Services.prefs.setBoolPref(TP_PB_PREF, true);
ok(TrackingProtection.enabled, "TP is enabled after setting the pref");
Services.prefs.setBoolPref(CB_PREF, true);
ok(TrackingProtection.enabled, "CB is enabled after setting the pref");
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);
privateWin.close();
Services.prefs.clearUserPref(FB_PREF);
Services.prefs.clearUserPref(TPC_PREF);
});
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;
let tab = tabbrowser.selectedTab = BrowserTestUtils.addTab(tabbrowser);
Services.prefs.setBoolPref(FB_PREF, false);
Services.prefs.setIntPref(TPC_PREF, Ci.nsICookieService.BEHAVIOR_ACCEPT);
@@ -459,50 +417,43 @@ add_task(async function testFastBlock()
ok(FastBlock, "TP is attached to the browser window");
is(FastBlock.enabled, Services.prefs.getBoolPref(FB_PREF),
"FB.enabled is based on the original pref value");
Services.prefs.setBoolPref(CB_PREF, true);
ok(ContentBlocking.enabled, "CB is enabled after setting the pref");
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");
await testContentBlockingDisabled(tab);
Services.prefs.setBoolPref(FB_PREF, true);
Services.prefs.setIntPref(FB_TIMEOUT_PREF, 0);
Services.prefs.setIntPref(FB_LIMIT_PREF, 0);
ok(FastBlock.enabled, "FB is enabled after setting the pref");
Services.prefs.setBoolPref(CB_PREF, true);
ok(ContentBlocking.enabled, "CB is enabled after setting the pref");
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");
await testContentBlockingDisabled(tab);
Services.prefs.clearUserPref(FB_PREF);
Services.prefs.clearUserPref(FB_TIMEOUT_PREF);
Services.prefs.clearUserPref(FB_LIMIT_PREF);
Services.prefs.clearUserPref(TPC_PREF);
gBrowser.removeCurrentTab();
});
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;
Services.prefs.setBoolPref(FB_PREF, false);
tabbrowser = gBrowser;
let tab = tabbrowser.selectedTab = BrowserTestUtils.addTab(tabbrowser);
@@ -513,30 +464,28 @@ add_task(async function testThirdPartyCo
is(ThirdPartyCookies.enabled,
Services.prefs.getIntPref(TPC_PREF) == Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER,
"TPC.enabled is based on the original pref value");
Services.prefs.setBoolPref(CB_PREF, true);
ok(ContentBlocking.enabled, "CB is enabled after setting the pref");
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");
await testContentBlockingDisabled(tab);
Services.prefs.setIntPref(TPC_PREF, Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER);
ok(ThirdPartyCookies.enabled, "TPC is enabled after setting the pref");
Services.prefs.setBoolPref(CB_PREF, true);
ok(ContentBlocking.enabled, "CB is enabled after setting the pref");
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");
await testContentBlockingDisabled(tab);
Services.prefs.clearUserPref(FB_PREF);
Services.prefs.clearUserPref(TPC_PREF);
gBrowser.removeCurrentTab();
--- a/browser/components/controlcenter/content/panel.inc.xul
+++ b/browser/components/controlcenter/content/panel.inc.xul
@@ -54,34 +54,30 @@
</hbox>
<!-- Tracking Protection Section -->
<hbox id="tracking-protection-container"
class="identity-popup-section"
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>
<hbox id="identity-popup-content-blocking-disabled-label">
<image/>
<label id="identity-popup-content-blocking-disabled-label-exception"
value="&contentBlocking.disabled.label;"
tooltiptext="&contentBlocking.exception.tooltip;"/>
<label id="identity-popup-content-blocking-disabled-label-global"
value="&contentBlocking.disabled.label;"
tooltiptext="&contentBlocking.disabled.tooltip;"/>
</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>
<description id="identity-popup-content-blocking-detected"
crop="end">&contentBlocking.detected;</description>
<description id="identity-popup-content-blocking-not-detected"
crop="end">&contentBlocking.notDetected;</description>
--- a/browser/components/customizableui/content/panelUI.inc.xul
+++ b/browser/components/customizableui/content/panelUI.inc.xul
@@ -221,20 +221,18 @@
class="subviewbutton subviewbutton-iconic"
onmouseover="gSync.refreshSyncButtonsTooltip();"
oncommand="gSync.doSync();"
closemenu="none"/>
</toolbaritem>
<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"
oncommand="ContentBlocking.onGlobalToggleCommand();" />
</toolbaritem>
<toolbarseparator id="appMenu-tp-separator"/>
<toolbarbutton id="appMenu-new-window-button"
class="subviewbutton subviewbutton-iconic"
--- a/browser/components/uitour/test/browser_contentBlocking.js
+++ b/browser/components/uitour/test/browser_contentBlocking.js
@@ -1,37 +1,37 @@
"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";
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";
const TOOLTIP_PANEL = document.getElementById("UITourTooltip");
const TOOLTIP_ANCHOR = document.getElementById("tracking-protection-icon-animatable-box");
var {UrlClassifierTestUtils} = ChromeUtils.import("resource://testing-common/UrlClassifierTestUtils.jsm", {});
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);
Services.prefs.clearUserPref(PREF_INTRO_COUNT);
});
function allowOneIntro() {
Services.prefs.setIntPref(PREF_INTRO_COUNT, window.ContentBlocking.MAX_INTROS - 1);
}
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();
});
add_task(async function test_benignPage() {
info("Load a test page not containing tracking elements");
allowOneIntro();
await BrowserTestUtils.withNewTab(BENIGN_PAGE, async function() {
--- a/browser/components/uitour/test/browser_trackingProtection.js
+++ b/browser/components/uitour/test/browser_trackingProtection.js
@@ -1,33 +1,32 @@
"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";
const TOOLTIP_PANEL = document.getElementById("UITourTooltip");
const TOOLTIP_ANCHOR = document.getElementById("tracking-protection-icon-animatable-box");
var {UrlClassifierTestUtils} = ChromeUtils.import("resource://testing-common/UrlClassifierTestUtils.jsm", {});
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() {
Services.prefs.setIntPref(PREF_INTRO_COUNT, window.ContentBlocking.MAX_INTROS - 1);
}
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();
});
add_task(async function test_benignPage() {
info("Load a test page not containing tracking elements");
allowOneIntro();
await BrowserTestUtils.withNewTab({gBrowser, url: BENIGN_PAGE}, async function() {
--- a/browser/locales/en-US/chrome/browser/browser.dtd
+++ b/browser/locales/en-US/chrome/browser/browser.dtd
@@ -1024,19 +1024,16 @@ you can use these alternative items. Oth
<!ENTITY contentBlocking.breakageReportView.label "Report Problems">
<!ENTITY contentBlocking.breakageReportView2.description "Content blocking can cause problems with some websites. When you report problems, you’ll help make &brandShortName; better for everyone. (This will send a URL as well as information about your browser settings to Mozilla.)">
<!ENTITY contentBlocking.breakageReportView.learnMore "Learn More">
<!ENTITY contentBlocking.breakageReportView.collection.url.label "URL">
<!ENTITY contentBlocking.breakageReportView.collection.comments.label "What problems did you have? (Optional)">
<!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. -->
<!ENTITY trackingProtection.unblock4.label "Disable Blocking For This Site">
<!ENTITY trackingProtection.unblock4.accesskey "D">
<!-- LOCALIZATION NOTE (trackingProtection.unblockPrivate3.label, trackingProtection.unblockPrivate3.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 PRIVATE browsing mode. -->
--- a/browser/locales/en-US/chrome/browser/browser.properties
+++ b/browser/locales/en-US/chrome/browser/browser.properties
@@ -507,35 +507,24 @@ identity.extension.label=Extension (%S)
identity.extension.tooltip=Loaded by extension: %S
identity.showDetails.tooltip=Show connection details
contentBlocking.title=Content Blocking
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
# Edit Bookmark UI
editBookmarkPanel.newBookmarkTitle=New Bookmark
editBookmarkPanel.editBookmarkTitle=Edit This Bookmark
editBookmarkPanel.cancel.label=Cancel
--- a/browser/themes/shared/controlcenter/panel.inc.css
+++ b/browser/themes/shared/controlcenter/panel.inc.css
@@ -378,25 +378,16 @@ description#identity-popup-content-verif
#identity-popup-breakageReportView-collection-comments {
height: 120px;
}
#identity-popup-content-blocking-content {
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 {
padding: 2px 5px;
border-radius: 3px;
margin: 5px;
display: none;
color: #fff;
@@ -414,21 +405,16 @@ description#identity-popup-content-verif
}
#identity-popup-content-blocking-content:not([enabled]) #identity-popup-content-blocking-disabled-label {
display: -moz-box;
background-color: #d70022;
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;
}
#identity-popup-content-blocking-disabled-label > label {
margin: 0;
}
--- a/browser/tools/mozscreenshots/mozscreenshots/extension/configurations/ControlCenter.jsm
+++ b/browser/tools/mozscreenshots/mozscreenshots/extension/configurations/ControlCenter.jsm
@@ -23,17 +23,16 @@ const HTTP_PASSWORD_PAGE = `http://test2
const MIXED_CONTENT_URL = `https://example.com/${RESOURCE_PATH}/mixed.html`;
const MIXED_ACTIVE_CONTENT_URL = `https://example.com/${RESOURCE_PATH}/mixed_active.html`;
const MIXED_PASSIVE_CONTENT_URL = `https://example.com/${RESOURCE_PATH}/mixed_passive.html`;
const TRACKING_PAGE = `http://tracking.example.org/${RESOURCE_PATH}/tracking.html`;
var ControlCenter = {
init(libDir) {
// Disable the FTU tours.
- Services.prefs.setIntPref("privacy.trackingprotection.introCount", 20);
Services.prefs.setIntPref("browser.contentblocking.introCount", 20);
},
configurations: {
about: {
selectors: ["#navigator-toolbox", "#identity-popup"],
async applyConfig() {
await loadPage("about:rights");