forked from mirrors/gecko-dev
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:
parent
f398701fb6
commit
09d4b61b43
15 changed files with 83 additions and 312 deletions
|
|
@ -1550,11 +1550,8 @@ pref("browser.contentblocking.rejecttrackers.reportBreakage.enabled", true);
|
||||||
|
|
||||||
pref("browser.contentblocking.reportBreakage.url", "https://tracking-protection-issues.herokuapp.com/new");
|
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("browser.contentblocking.introCount", 0);
|
||||||
|
|
||||||
pref("privacy.trackingprotection.introCount", 0);
|
|
||||||
pref("privacy.trackingprotection.introURL", "https://www.mozilla.org/%LOCALE%/firefox/%VERSION%/tracking-protection/start/");
|
pref("privacy.trackingprotection.introURL", "https://www.mozilla.org/%LOCALE%/firefox/%VERSION%/tracking-protection/start/");
|
||||||
|
|
||||||
// Always enable newtab segregation using containers
|
// Always enable newtab segregation using containers
|
||||||
|
|
|
||||||
|
|
@ -38,32 +38,6 @@ var TrackingProtection = {
|
||||||
document.getElementById("identity-popup-content-blocking-category-tracking-protection");
|
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() {
|
init() {
|
||||||
this.updateEnabled();
|
this.updateEnabled();
|
||||||
|
|
||||||
|
|
@ -88,36 +62,11 @@ var TrackingProtection = {
|
||||||
PrivateBrowsingUtils.isWindowPrivate(window));
|
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() {
|
updateEnabled() {
|
||||||
this.enabledGlobally =
|
this.enabledGlobally =
|
||||||
Services.prefs.getBoolPref(this.PREF_ENABLED_GLOBALLY);
|
Services.prefs.getBoolPref(this.PREF_ENABLED_GLOBALLY);
|
||||||
this.enabledInPrivateWindows =
|
this.enabledInPrivateWindows =
|
||||||
Services.prefs.getBoolPref(this.PREF_ENABLED_IN_PRIVATE_WINDOWS);
|
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) {
|
isBlockerActivated(state) {
|
||||||
|
|
@ -202,12 +151,10 @@ var ContentBlocking = {
|
||||||
// If the user ignores the doorhanger, we stop showing it after some time.
|
// If the user ignores the doorhanger, we stop showing it after some time.
|
||||||
MAX_INTROS: 20,
|
MAX_INTROS: 20,
|
||||||
PREF_ENABLED: "browser.contentblocking.enabled",
|
PREF_ENABLED: "browser.contentblocking.enabled",
|
||||||
PREF_UI_ENABLED: "browser.contentblocking.ui.enabled",
|
|
||||||
PREF_ANIMATIONS_ENABLED: "toolkit.cosmeticAnimations.enabled",
|
PREF_ANIMATIONS_ENABLED: "toolkit.cosmeticAnimations.enabled",
|
||||||
PREF_REPORT_BREAKAGE_ENABLED: "browser.contentblocking.reportBreakage.enabled",
|
PREF_REPORT_BREAKAGE_ENABLED: "browser.contentblocking.reportBreakage.enabled",
|
||||||
PREF_REPORT_BREAKAGE_URL: "browser.contentblocking.reportBreakage.url",
|
PREF_REPORT_BREAKAGE_URL: "browser.contentblocking.reportBreakage.url",
|
||||||
PREF_INTRO_COUNT_CB: "browser.contentblocking.introCount",
|
PREF_INTRO_COUNT_CB: "browser.contentblocking.introCount",
|
||||||
PREF_INTRO_COUNT_TP: "privacy.trackingprotection.introCount",
|
|
||||||
PREF_GLOBAL_TOGGLE: "browser.contentblocking.global-toggle.enabled",
|
PREF_GLOBAL_TOGGLE: "browser.contentblocking.global-toggle.enabled",
|
||||||
content: null,
|
content: null,
|
||||||
icon: null,
|
icon: null,
|
||||||
|
|
@ -215,7 +162,7 @@ var ContentBlocking = {
|
||||||
disabledTooltipText: null,
|
disabledTooltipText: null,
|
||||||
|
|
||||||
get prefIntroCount() {
|
get prefIntroCount() {
|
||||||
return this.contentBlockingUIEnabled ? this.PREF_INTRO_COUNT_CB : this.PREF_INTRO_COUNT_TP;
|
return this.PREF_INTRO_COUNT_CB;
|
||||||
},
|
},
|
||||||
|
|
||||||
get appMenuLabel() {
|
get appMenuLabel() {
|
||||||
|
|
@ -331,11 +278,11 @@ var ContentBlocking = {
|
||||||
this.updateEnabled.bind(this));
|
this.updateEnabled.bind(this));
|
||||||
XPCOMUtils.defineLazyPreferenceGetter(this, "reportBreakageEnabled",
|
XPCOMUtils.defineLazyPreferenceGetter(this, "reportBreakageEnabled",
|
||||||
this.PREF_REPORT_BREAKAGE_ENABLED, false);
|
this.PREF_REPORT_BREAKAGE_ENABLED, false);
|
||||||
XPCOMUtils.defineLazyPreferenceGetter(this, "contentBlockingUIEnabled", this.PREF_UI_ENABLED, false,
|
|
||||||
this.updateUIEnabled.bind(this));
|
|
||||||
|
|
||||||
this.updateEnabled();
|
this.updateEnabled();
|
||||||
this.updateUIEnabled();
|
|
||||||
|
this.appMenuLabel.setAttribute("label", this.strings.appMenuTitle);
|
||||||
|
this.appMenuLabel.setAttribute("tooltiptext", this.strings.appMenuTooltip);
|
||||||
|
|
||||||
this.activeTooltipText =
|
this.activeTooltipText =
|
||||||
gNavigatorBundle.getString("trackingProtection.icon.activeTooltip");
|
gNavigatorBundle.getString("trackingProtection.icon.activeTooltip");
|
||||||
|
|
@ -355,18 +302,16 @@ var ContentBlocking = {
|
||||||
},
|
},
|
||||||
|
|
||||||
get enabled() {
|
get enabled() {
|
||||||
return this.contentBlockingUIEnabled ? this.contentBlockingEnabled : TrackingProtection.enabled;
|
return this.contentBlockingEnabled;
|
||||||
},
|
},
|
||||||
|
|
||||||
updateEnabled() {
|
updateEnabled() {
|
||||||
this.content.toggleAttribute("enabled", this.enabled);
|
this.content.toggleAttribute("enabled", this.enabled);
|
||||||
|
|
||||||
if (this.contentBlockingUIEnabled) {
|
this.appMenuButton.setAttribute("tooltiptext", this.enabled ?
|
||||||
this.appMenuButton.setAttribute("tooltiptext", this.enabled ?
|
this.strings.disableTooltip : this.strings.enableTooltip);
|
||||||
this.strings.disableTooltip : this.strings.enableTooltip);
|
this.appMenuButton.setAttribute("enabled", this.enabled);
|
||||||
this.appMenuButton.setAttribute("enabled", this.enabled);
|
this.appMenuButton.setAttribute("aria-pressed", this.enabled);
|
||||||
this.appMenuButton.setAttribute("aria-pressed", this.enabled);
|
|
||||||
}
|
|
||||||
|
|
||||||
// The enabled state of blockers may also change since it depends on this.enabled.
|
// The enabled state of blockers may also change since it depends on this.enabled.
|
||||||
for (let blocker of this.blockers) {
|
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() {
|
onGlobalToggleCommand() {
|
||||||
if (this.contentBlockingUIEnabled) {
|
Services.prefs.setBoolPref(this.PREF_ENABLED, !this.enabled);
|
||||||
Services.prefs.setBoolPref(this.PREF_ENABLED, !this.enabled);
|
|
||||||
} else {
|
|
||||||
TrackingProtection.onGlobalToggleCommand();
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
hideIdentityPopupAndReload() {
|
hideIdentityPopupAndReload() {
|
||||||
|
|
@ -615,30 +545,22 @@ var ContentBlocking = {
|
||||||
let brandBundle = document.getElementById("bundle_brand");
|
let brandBundle = document.getElementById("bundle_brand");
|
||||||
let brandShortName = brandBundle.getString("brandShortName");
|
let brandShortName = brandBundle.getString("brandShortName");
|
||||||
|
|
||||||
let introTitle;
|
|
||||||
|
let introTitle = gNavigatorBundle.getFormattedString("contentBlocking.intro.title",
|
||||||
|
[brandShortName]);
|
||||||
let introDescription;
|
let introDescription;
|
||||||
// This will be sent to the onboarding website to let them know which
|
// This will be sent to the onboarding website to let them know which
|
||||||
// UI variation we're showing.
|
// UI variation we're showing.
|
||||||
let variation;
|
let variation;
|
||||||
|
// We show a different UI tour variation for users that already have TP
|
||||||
if (this.contentBlockingUIEnabled) {
|
// enabled globally.
|
||||||
introTitle = gNavigatorBundle.getFormattedString("contentBlocking.intro.title",
|
if (TrackingProtection.enabledGlobally) {
|
||||||
[brandShortName]);
|
introDescription = gNavigatorBundle.getString("contentBlocking.intro.v2.description");
|
||||||
// We show a different UI tour variation for users that already have TP
|
variation = 2;
|
||||||
// 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;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
introTitle = gNavigatorBundle.getString("trackingProtection.intro.title");
|
introDescription = gNavigatorBundle.getFormattedString("contentBlocking.intro.v1.description",
|
||||||
introDescription = gNavigatorBundle.getFormattedString("trackingProtection.intro.description2",
|
|
||||||
[brandShortName]);
|
[brandShortName]);
|
||||||
variation = 0;
|
variation = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
let openStep2 = () => {
|
let openStep2 = () => {
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const CB_PREF = "browser.contentblocking.enabled";
|
const CB_PREF = "browser.contentblocking.enabled";
|
||||||
const CB_UI_PREF = "browser.contentblocking.ui.enabled";
|
|
||||||
const TOGGLE_PREF = "browser.contentblocking.global-toggle.enabled";
|
const TOGGLE_PREF = "browser.contentblocking.global-toggle.enabled";
|
||||||
|
|
||||||
ChromeUtils.import("resource://testing-common/CustomizableUITestUtils.jsm", this);
|
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.
|
// normal windows and private windows.
|
||||||
add_task(async function testGlobalToggle() {
|
add_task(async function testGlobalToggle() {
|
||||||
await SpecialPowers.pushPrefEnv({set: [
|
await SpecialPowers.pushPrefEnv({set: [
|
||||||
[CB_UI_PREF, true],
|
|
||||||
[TOGGLE_PREF, true],
|
[TOGGLE_PREF, true],
|
||||||
]});
|
]});
|
||||||
|
|
||||||
|
|
@ -43,51 +41,3 @@ add_task(async function testGlobalToggle() {
|
||||||
|
|
||||||
Services.prefs.clearUserPref(CB_PREF);
|
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);
|
|
||||||
});
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const CB_PREF = "browser.contentblocking.enabled";
|
const CB_PREF = "browser.contentblocking.enabled";
|
||||||
const CB_UI_PREF = "browser.contentblocking.ui.enabled";
|
|
||||||
const TP_PREF = "privacy.trackingprotection.enabled";
|
const TP_PREF = "privacy.trackingprotection.enabled";
|
||||||
const FB_PREF = "browser.fastblock.enabled";
|
const FB_PREF = "browser.fastblock.enabled";
|
||||||
const TPC_PREF = "network.cookie.cookieBehavior";
|
const TPC_PREF = "network.cookie.cookieBehavior";
|
||||||
|
|
@ -69,7 +68,6 @@ add_task(async function testOpenPreferencesFromPrefsButton() {
|
||||||
add_task(async function testOpenPreferencesFromAddBlockingButtons() {
|
add_task(async function testOpenPreferencesFromAddBlockingButtons() {
|
||||||
SpecialPowers.pushPrefEnv({set: [
|
SpecialPowers.pushPrefEnv({set: [
|
||||||
[CB_PREF, true],
|
[CB_PREF, true],
|
||||||
[CB_UI_PREF, true],
|
|
||||||
[FB_PREF, false],
|
[FB_PREF, false],
|
||||||
[TP_PREF, false],
|
[TP_PREF, false],
|
||||||
[TPC_PREF, Ci.nsICookieService.BEHAVIOR_ACCEPT],
|
[TPC_PREF, Ci.nsICookieService.BEHAVIOR_ACCEPT],
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@
|
||||||
// browsing mode don't persist once the private browsing window closes.
|
// browsing mode don't persist once the private browsing window closes.
|
||||||
|
|
||||||
const CB_PREF = "browser.contentblocking.enabled";
|
const CB_PREF = "browser.contentblocking.enabled";
|
||||||
const CB_UI_PREF = "browser.contentblocking.ui.enabled";
|
|
||||||
const TP_PB_PREF = "privacy.trackingprotection.enabled";
|
const TP_PB_PREF = "privacy.trackingprotection.enabled";
|
||||||
const TRACKING_PAGE = "http://tracking.example.org/browser/browser/base/content/test/trackingUI/trackingPage.html";
|
const TRACKING_PAGE = "http://tracking.example.org/browser/browser/base/content/test/trackingUI/trackingPage.html";
|
||||||
var TrackingProtection = null;
|
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-not-detected"), "blocking not detected label is hidden");
|
||||||
ok(!hidden("#identity-popup-content-blocking-detected"), "blocking detected label is visible");
|
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-list"), "category list is visible");
|
ok(hidden("#identity-popup-content-blocking-category-tracking-protection > .identity-popup-content-blocking-category-add-blocking"),
|
||||||
ok(hidden("#identity-popup-content-blocking-category-tracking-protection > .identity-popup-content-blocking-category-add-blocking"),
|
"TP category item is not showing 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"),
|
||||||
ok(!hidden("#identity-popup-content-blocking-category-tracking-protection > .identity-popup-content-blocking-category-state-label"),
|
"TP category item is set to blocked");
|
||||||
"TP category item is set to blocked");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function testTrackingPageUnblocked() {
|
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-not-detected"), "blocking not detected label is hidden");
|
||||||
ok(!hidden("#identity-popup-content-blocking-detected"), "blocking detected label is visible");
|
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-list"), "category list is visible");
|
ok(hidden("#identity-popup-content-blocking-category-tracking-protection > .identity-popup-content-blocking-category-add-blocking"),
|
||||||
ok(hidden("#identity-popup-content-blocking-category-tracking-protection > .identity-popup-content-blocking-category-add-blocking"),
|
"TP category item is not showing 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"),
|
||||||
ok(hidden("#identity-popup-content-blocking-category-tracking-protection > .identity-popup-content-blocking-category-state-label"),
|
"TP category item is not set to blocked");
|
||||||
"TP category item is not set to blocked");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
add_task(async function testExceptionAddition() {
|
add_task(async function testExceptionAddition() {
|
||||||
|
|
|
||||||
|
|
@ -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 COOKIE_PAGE = "http://not-tracking.example.com/browser/browser/base/content/test/trackingUI/cookiePage.html";
|
||||||
|
|
||||||
const CB_PREF = "browser.contentblocking.enabled";
|
const CB_PREF = "browser.contentblocking.enabled";
|
||||||
const CB_UI_PREF = "browser.contentblocking.ui.enabled";
|
|
||||||
const TP_PREF = "privacy.trackingprotection.enabled";
|
const TP_PREF = "privacy.trackingprotection.enabled";
|
||||||
const PREF_REPORT_BREAKAGE_ENABLED = "browser.contentblocking.reportBreakage.enabled";
|
const PREF_REPORT_BREAKAGE_ENABLED = "browser.contentblocking.reportBreakage.enabled";
|
||||||
const PREF_REPORT_BREAKAGE_URL = "browser.contentblocking.reportBreakage.url";
|
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", {});
|
let {Preferences} = ChromeUtils.import("resource://gre/modules/Preferences.jsm", {});
|
||||||
|
|
||||||
add_task(async function setup() {
|
add_task(async function setup() {
|
||||||
await SpecialPowers.pushPrefEnv({set: [
|
|
||||||
[CB_UI_PREF, true],
|
|
||||||
]});
|
|
||||||
await UrlClassifierTestUtils.addTestTrackers();
|
await UrlClassifierTestUtils.addTestTrackers();
|
||||||
|
|
||||||
let oldCanRecord = Services.telemetry.canRecordExtended;
|
let oldCanRecord = Services.telemetry.canRecordExtended;
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const CB_PREF = "browser.contentblocking.enabled";
|
const CB_PREF = "browser.contentblocking.enabled";
|
||||||
const CB_UI_PREF = "browser.contentblocking.ui.enabled";
|
|
||||||
const TP_PREF = "privacy.trackingprotection.enabled";
|
const TP_PREF = "privacy.trackingprotection.enabled";
|
||||||
const TP_PB_PREF = "privacy.trackingprotection.pbmode.enabled";
|
const TP_PB_PREF = "privacy.trackingprotection.pbmode.enabled";
|
||||||
const FB_PREF = "browser.fastblock.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-not-detected"), "blocking not detected label is visible");
|
||||||
ok(hidden("#identity-popup-content-blocking-detected"), "blocking detected label is hidden");
|
ok(hidden("#identity-popup-content-blocking-detected"), "blocking detected label is hidden");
|
||||||
|
ok(hidden("#identity-popup-content-blocking-category-list"), "category list is hidden");
|
||||||
if (Services.prefs.getBoolPref(CB_UI_PREF)) {
|
|
||||||
ok(hidden("#identity-popup-content-blocking-category-list"), "category list is hidden");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function testBenignPageWithException() {
|
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-not-detected"), "blocking not detected label is visible");
|
||||||
ok(hidden("#identity-popup-content-blocking-detected"), "blocking detected label is hidden");
|
ok(hidden("#identity-popup-content-blocking-detected"), "blocking detected label is hidden");
|
||||||
|
ok(hidden("#identity-popup-content-blocking-category-list"), "category list is hidden");
|
||||||
if (Services.prefs.getBoolPref(CB_UI_PREF)) {
|
|
||||||
ok(hidden("#identity-popup-content-blocking-category-list"), "category list is hidden");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function areTrackersBlocked(isPrivateBrowsing) {
|
function areTrackersBlocked(isPrivateBrowsing) {
|
||||||
|
|
@ -148,7 +141,6 @@ function testTrackingPage(window) {
|
||||||
ok(hidden("#tracking-action-block"), "blockButton is hidden");
|
ok(hidden("#tracking-action-block"), "blockButton is hidden");
|
||||||
|
|
||||||
let isWindowPrivate = PrivateBrowsingUtils.isWindowPrivate(window);
|
let isWindowPrivate = PrivateBrowsingUtils.isWindowPrivate(window);
|
||||||
let cbUIEnabled = Services.prefs.getBoolPref(CB_UI_PREF);
|
|
||||||
if (isWindowPrivate) {
|
if (isWindowPrivate) {
|
||||||
ok(hidden("#tracking-action-unblock"), "unblockButton is hidden");
|
ok(hidden("#tracking-action-unblock"), "unblockButton is hidden");
|
||||||
is(!hidden("#tracking-action-unblock-private"), blockedByTP,
|
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-not-detected"), "blocking not detected label is hidden");
|
||||||
ok(!hidden("#identity-popup-content-blocking-detected"), "blocking detected label is visible");
|
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");
|
||||||
ok(!hidden("#identity-popup-content-blocking-category-list"), "category list is visible");
|
let category;
|
||||||
let category;
|
if (Services.prefs.getBoolPref(FB_PREF)) {
|
||||||
if (Services.prefs.getBoolPref(FB_PREF)) {
|
category = "#identity-popup-content-blocking-category-fastblock";
|
||||||
category = "#identity-popup-content-blocking-category-fastblock";
|
} else {
|
||||||
} else {
|
category = Services.prefs.getIntPref(TPC_PREF) == Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER ?
|
||||||
category = Services.prefs.getIntPref(TPC_PREF) == Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER ?
|
"#identity-popup-content-blocking-category-3rdpartycookies" :
|
||||||
"#identity-popup-content-blocking-category-3rdpartycookies" :
|
"#identity-popup-content-blocking-category-tracking-protection";
|
||||||
"#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");
|
|
||||||
}
|
}
|
||||||
|
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) {
|
if (Services.prefs.getIntPref(TPC_PREF) == Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER) {
|
||||||
ok(hidden("#identity-popup-content-blocking-category-label-default"),
|
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("detected"), "trackers are detected");
|
||||||
ok(ContentBlocking.content.hasAttribute("hasException"), "content shows exception");
|
ok(ContentBlocking.content.hasAttribute("hasException"), "content shows exception");
|
||||||
|
|
||||||
let isWindowPrivate = PrivateBrowsingUtils.isWindowPrivate(window);
|
let blockingEnabled = Services.prefs.getBoolPref(CB_PREF);
|
||||||
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;
|
|
||||||
ok(!ContentBlocking.content.hasAttribute("active"), "content is not active");
|
ok(!ContentBlocking.content.hasAttribute("active"), "content is not active");
|
||||||
ok(!ContentBlocking.iconBox.hasAttribute("active"), "shield is not active");
|
ok(!ContentBlocking.iconBox.hasAttribute("active"), "shield is not active");
|
||||||
is(ContentBlocking.iconBox.hasAttribute("hasException"), blockingEnabled,
|
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-not-detected"), "blocking not detected label is hidden");
|
||||||
ok(!hidden("#identity-popup-content-blocking-detected"), "blocking detected label is visible");
|
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-list"), "category list is visible");
|
let category;
|
||||||
let category;
|
if (Services.prefs.getBoolPref(FB_PREF)) {
|
||||||
if (Services.prefs.getBoolPref(FB_PREF)) {
|
category = "#identity-popup-content-blocking-category-fastblock";
|
||||||
category = "#identity-popup-content-blocking-category-fastblock";
|
} else {
|
||||||
} else {
|
category = Services.prefs.getIntPref(TPC_PREF) == Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER ?
|
||||||
category = Services.prefs.getIntPref(TPC_PREF) == Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER ?
|
"#identity-popup-content-blocking-category-3rdpartycookies" :
|
||||||
"#identity-popup-content-blocking-category-3rdpartycookies" :
|
"#identity-popup-content-blocking-category-tracking-protection";
|
||||||
"#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");
|
|
||||||
}
|
}
|
||||||
|
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() {
|
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-not-detected"), "blocking not detected label is hidden");
|
||||||
ok(!hidden("#identity-popup-content-blocking-detected"), "blocking detected label is visible");
|
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-list"), "category list is visible");
|
ok(!hidden("#identity-popup-content-blocking-category-tracking-protection > .identity-popup-content-blocking-category-add-blocking"),
|
||||||
ok(!hidden("#identity-popup-content-blocking-category-tracking-protection > .identity-popup-content-blocking-category-add-blocking"),
|
"TP category item is showing 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"),
|
||||||
ok(hidden("#identity-popup-content-blocking-category-tracking-protection > .identity-popup-content-blocking-category-state-label"),
|
"TP category item is not set to blocked");
|
||||||
"TP category item is not set to blocked");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function testContentBlockingEnabled(tab) {
|
async function testContentBlockingEnabled(tab) {
|
||||||
|
|
@ -353,13 +336,8 @@ add_task(async function testNormalBrowsing() {
|
||||||
|
|
||||||
await testContentBlockingEnabled(tab);
|
await testContentBlockingEnabled(tab);
|
||||||
|
|
||||||
if (Services.prefs.getBoolPref(CB_UI_PREF)) {
|
Services.prefs.setBoolPref(CB_PREF, false);
|
||||||
Services.prefs.setBoolPref(CB_PREF, false);
|
ok(!ContentBlocking.enabled, "CB is disabled after setting the pref");
|
||||||
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");
|
|
||||||
}
|
|
||||||
|
|
||||||
await testContentBlockingDisabled(tab);
|
await testContentBlockingDisabled(tab);
|
||||||
|
|
||||||
|
|
@ -370,13 +348,8 @@ add_task(async function testNormalBrowsing() {
|
||||||
|
|
||||||
await testContentBlockingEnabled(tab);
|
await testContentBlockingEnabled(tab);
|
||||||
|
|
||||||
if (Services.prefs.getBoolPref(CB_UI_PREF)) {
|
Services.prefs.setBoolPref(CB_PREF, false);
|
||||||
Services.prefs.setBoolPref(CB_PREF, false);
|
ok(!ContentBlocking.enabled, "CB is disabled after setting the pref");
|
||||||
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");
|
|
||||||
}
|
|
||||||
|
|
||||||
await testContentBlockingDisabled(tab);
|
await testContentBlockingDisabled(tab);
|
||||||
|
|
||||||
|
|
@ -406,13 +379,8 @@ add_task(async function testPrivateBrowsing() {
|
||||||
|
|
||||||
await testContentBlockingEnabled(tab);
|
await testContentBlockingEnabled(tab);
|
||||||
|
|
||||||
if (Services.prefs.getBoolPref(CB_UI_PREF)) {
|
Services.prefs.setBoolPref(CB_PREF, false);
|
||||||
Services.prefs.setBoolPref(CB_PREF, false);
|
ok(!ContentBlocking.enabled, "CB is disabled after setting the pref");
|
||||||
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");
|
|
||||||
}
|
|
||||||
|
|
||||||
await testContentBlockingDisabled(tab);
|
await testContentBlockingDisabled(tab);
|
||||||
|
|
||||||
|
|
@ -423,13 +391,8 @@ add_task(async function testPrivateBrowsing() {
|
||||||
|
|
||||||
await testContentBlockingEnabled(tab);
|
await testContentBlockingEnabled(tab);
|
||||||
|
|
||||||
if (Services.prefs.getBoolPref(CB_UI_PREF)) {
|
Services.prefs.setBoolPref(CB_PREF, false);
|
||||||
Services.prefs.setBoolPref(CB_PREF, false);
|
ok(!ContentBlocking.enabled, "CB is disabled after setting the pref");
|
||||||
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");
|
|
||||||
}
|
|
||||||
|
|
||||||
await testContentBlockingDisabled(tab);
|
await testContentBlockingDisabled(tab);
|
||||||
|
|
||||||
|
|
@ -440,11 +403,6 @@ add_task(async function testPrivateBrowsing() {
|
||||||
});
|
});
|
||||||
|
|
||||||
add_task(async function testFastBlock() {
|
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();
|
await UrlClassifierTestUtils.addTestTrackers();
|
||||||
|
|
||||||
tabbrowser = gBrowser;
|
tabbrowser = gBrowser;
|
||||||
|
|
@ -464,7 +422,6 @@ add_task(async function testFastBlock() {
|
||||||
|
|
||||||
await testContentBlockingEnabled(tab);
|
await testContentBlockingEnabled(tab);
|
||||||
|
|
||||||
ok(Services.prefs.getBoolPref(CB_UI_PREF), "CB UI must be enabled here");
|
|
||||||
Services.prefs.setBoolPref(CB_PREF, false);
|
Services.prefs.setBoolPref(CB_PREF, false);
|
||||||
ok(!ContentBlocking.enabled, "CB is disabled after setting the pref");
|
ok(!ContentBlocking.enabled, "CB is disabled after setting the pref");
|
||||||
|
|
||||||
|
|
@ -479,7 +436,6 @@ add_task(async function testFastBlock() {
|
||||||
|
|
||||||
await testContentBlockingEnabled(tab);
|
await testContentBlockingEnabled(tab);
|
||||||
|
|
||||||
ok(Services.prefs.getBoolPref(CB_UI_PREF), "CB UI must be enabled here");
|
|
||||||
Services.prefs.setBoolPref(CB_PREF, false);
|
Services.prefs.setBoolPref(CB_PREF, false);
|
||||||
ok(!ContentBlocking.enabled, "CB is disabled after setting the pref");
|
ok(!ContentBlocking.enabled, "CB is disabled after setting the pref");
|
||||||
|
|
||||||
|
|
@ -493,11 +449,6 @@ add_task(async function testFastBlock() {
|
||||||
});
|
});
|
||||||
|
|
||||||
add_task(async function testThirdPartyCookies() {
|
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();
|
await UrlClassifierTestUtils.addTestTrackers();
|
||||||
gTrackingPageURL = COOKIE_PAGE;
|
gTrackingPageURL = COOKIE_PAGE;
|
||||||
|
|
||||||
|
|
@ -518,7 +469,6 @@ add_task(async function testThirdPartyCookies() {
|
||||||
|
|
||||||
await testContentBlockingEnabled(tab);
|
await testContentBlockingEnabled(tab);
|
||||||
|
|
||||||
ok(Services.prefs.getBoolPref(CB_UI_PREF), "CB UI must be enabled here");
|
|
||||||
Services.prefs.setBoolPref(CB_PREF, false);
|
Services.prefs.setBoolPref(CB_PREF, false);
|
||||||
ok(!ContentBlocking.enabled, "CB is disabled after setting the pref");
|
ok(!ContentBlocking.enabled, "CB is disabled after setting the pref");
|
||||||
|
|
||||||
|
|
@ -531,7 +481,6 @@ add_task(async function testThirdPartyCookies() {
|
||||||
|
|
||||||
await testContentBlockingEnabled(tab);
|
await testContentBlockingEnabled(tab);
|
||||||
|
|
||||||
ok(Services.prefs.getBoolPref(CB_UI_PREF), "CB UI must be enabled here");
|
|
||||||
Services.prefs.setBoolPref(CB_PREF, false);
|
Services.prefs.setBoolPref(CB_PREF, false);
|
||||||
ok(!ContentBlocking.enabled, "CB is disabled after setting the pref");
|
ok(!ContentBlocking.enabled, "CB is disabled after setting the pref");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -59,9 +59,6 @@
|
||||||
when-connection="not-secure secure secure-ev secure-cert-user-overridden extension">
|
when-connection="not-secure secure secure-ev secure-cert-user-overridden extension">
|
||||||
<vbox id="identity-popup-content-blocking-content" flex="1">
|
<vbox id="identity-popup-content-blocking-content" flex="1">
|
||||||
<hbox align="start">
|
<hbox align="start">
|
||||||
<label id="tracking-protection-label"
|
|
||||||
class="identity-popup-headline"
|
|
||||||
flex="1">&trackingProtection.title;</label>
|
|
||||||
<label id="content-blocking-label"
|
<label id="content-blocking-label"
|
||||||
class="identity-popup-headline"
|
class="identity-popup-headline"
|
||||||
flex="1">&contentBlocking.title;</label>
|
flex="1">&contentBlocking.title;</label>
|
||||||
|
|
@ -76,7 +73,6 @@
|
||||||
</hbox>
|
</hbox>
|
||||||
<toolbarbutton id="tracking-protection-preferences-button"
|
<toolbarbutton id="tracking-protection-preferences-button"
|
||||||
class="identity-popup-preferences-button subviewbutton"
|
class="identity-popup-preferences-button subviewbutton"
|
||||||
tooltiptext="&trackingProtection.tooltip;"
|
|
||||||
oncommand="ContentBlocking.openPreferences('identityPopup-TP-preferencesButton'); gIdentityHandler.recordClick('cb_prefs_button');" />
|
oncommand="ContentBlocking.openPreferences('identityPopup-TP-preferencesButton'); gIdentityHandler.recordClick('cb_prefs_button');" />
|
||||||
</hbox>
|
</hbox>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -226,10 +226,8 @@
|
||||||
<toolbarseparator class="sync-ui-item"/>
|
<toolbarseparator class="sync-ui-item"/>
|
||||||
<toolbaritem closemenu="none">
|
<toolbaritem closemenu="none">
|
||||||
<toolbarbutton id="appMenu-tp-label"
|
<toolbarbutton id="appMenu-tp-label"
|
||||||
tooltiptext="&trackingProtection.tooltip;"
|
|
||||||
class="subviewbutton subviewbutton-iconic"
|
class="subviewbutton subviewbutton-iconic"
|
||||||
oncommand="ContentBlocking.openPreferences('appMenu-trackingprotection'); PanelUI.hide();"
|
oncommand="ContentBlocking.openPreferences('appMenu-trackingprotection'); PanelUI.hide();"/>
|
||||||
label="&trackingProtection.title;"/>
|
|
||||||
<toolbarseparator id="appMenu-tp-vertical-separator" orient="vertical"/>
|
<toolbarseparator id="appMenu-tp-vertical-separator" orient="vertical"/>
|
||||||
<toolbarbutton id="appMenu-tp-toggle"
|
<toolbarbutton id="appMenu-tp-toggle"
|
||||||
enabled="false"
|
enabled="false"
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const PREF_INTRO_COUNT = "browser.contentblocking.introCount";
|
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_TP_ENABLED = "privacy.trackingprotection.enabled";
|
||||||
const PREF_FB_ENABLED = "browser.fastblock.enabled";
|
const PREF_FB_ENABLED = "browser.fastblock.enabled";
|
||||||
const PREF_FB_TIMEOUT = "browser.fastblock.timeout";
|
const PREF_FB_TIMEOUT = "browser.fastblock.timeout";
|
||||||
|
|
@ -14,7 +14,7 @@ var {UrlClassifierTestUtils} = ChromeUtils.import("resource://testing-common/Url
|
||||||
|
|
||||||
registerCleanupFunction(function() {
|
registerCleanupFunction(function() {
|
||||||
UrlClassifierTestUtils.cleanupTestTrackers();
|
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_TP_ENABLED);
|
||||||
Services.prefs.clearUserPref(PREF_FB_ENABLED);
|
Services.prefs.clearUserPref(PREF_FB_ENABLED);
|
||||||
Services.prefs.clearUserPref(PREF_FB_TIMEOUT);
|
Services.prefs.clearUserPref(PREF_FB_TIMEOUT);
|
||||||
|
|
@ -26,7 +26,7 @@ function allowOneIntro() {
|
||||||
}
|
}
|
||||||
|
|
||||||
add_task(async function setup_test() {
|
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);
|
Services.prefs.setBoolPref(PREF_TP_ENABLED, true);
|
||||||
await UrlClassifierTestUtils.addTestTrackers();
|
await UrlClassifierTestUtils.addTestTrackers();
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const PREF_INTRO_COUNT = "privacy.trackingprotection.introCount";
|
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_TP_ENABLED = "privacy.trackingprotection.enabled";
|
||||||
const BENIGN_PAGE = "http://tracking.example.org/browser/browser/base/content/test/trackingUI/benignPage.html";
|
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 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() {
|
registerCleanupFunction(function() {
|
||||||
UrlClassifierTestUtils.cleanupTestTrackers();
|
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_TP_ENABLED);
|
||||||
Services.prefs.clearUserPref(PREF_INTRO_COUNT);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
function allowOneIntro() {
|
function allowOneIntro() {
|
||||||
|
|
@ -22,7 +21,7 @@ function allowOneIntro() {
|
||||||
}
|
}
|
||||||
|
|
||||||
add_task(async function setup_test() {
|
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);
|
Services.prefs.setBoolPref(PREF_TP_ENABLED, true);
|
||||||
await UrlClassifierTestUtils.addTestTrackers();
|
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");
|
is(Services.prefs.getIntPref(PREF_INTRO_COUNT), window.ContentBlocking.MAX_INTROS, "Check intro count increased");
|
||||||
|
|
||||||
let step2URL = Services.urlFormatter.formatURLPref("privacy.trackingprotection.introURL") +
|
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");
|
let buttons = document.getElementById("UITourTooltipButtons");
|
||||||
|
|
||||||
info("Click the step text and nothing should happen");
|
info("Click the step text and nothing should happen");
|
||||||
|
|
|
||||||
|
|
@ -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.sendReport.label "Send Report">
|
||||||
<!ENTITY contentBlocking.breakageReportView.cancel.label "Cancel">
|
<!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):
|
<!-- LOCALIZATION NOTE (trackingProtection.unblock3.label, trackingProtection.unblock3.accesskey):
|
||||||
The associated button with this label and accesskey is only shown when opening the control
|
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. -->
|
center while looking at a site with trackers in NON-private browsing mode. -->
|
||||||
|
|
|
||||||
|
|
@ -512,25 +512,14 @@ contentBlocking.tooltip=Open Content Blocking Preferences
|
||||||
contentBlocking.toggle.enable.tooltip=Enable Content Blocking
|
contentBlocking.toggle.enable.tooltip=Enable Content Blocking
|
||||||
contentBlocking.toggle.disable.tooltip=Disable 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.
|
# LOCALIZATION NOTE (contentBlocking.intro.title): %S is brandShortName.
|
||||||
contentBlocking.intro.title=New in %S: Content Blocking
|
contentBlocking.intro.title=New in %S: Content Blocking
|
||||||
# LOCALIZATION NOTE (contentBlocking.v1.intro.description): %S is brandShortName.
|
# 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.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.
|
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.
|
||||||
|
# LOCALIZATION NOTE (trackingProtection.intro.step1of3): Indicates that the intro panel is step one of three in a tour.
|
||||||
trackingProtection.toggle.enable.tooltip=Enable Tracking Protection
|
trackingProtection.intro.step1of3=1 of 3
|
||||||
trackingProtection.toggle.disable.tooltip=Disable Tracking Protection
|
trackingProtection.intro.nextButton.label=Next
|
||||||
trackingProtection.toggle.enable.pbmode.tooltip=Enable Tracking Protection in Private Browsing
|
|
||||||
trackingProtection.toggle.disable.pbmode.tooltip=Disable Tracking Protection in Private Browsing
|
|
||||||
|
|
||||||
trackingProtection.icon.activeTooltip=Tracking attempts blocked
|
trackingProtection.icon.activeTooltip=Tracking attempts blocked
|
||||||
trackingProtection.icon.disabledTooltip=Tracking content detected
|
trackingProtection.icon.disabledTooltip=Tracking content detected
|
||||||
|
|
|
||||||
|
|
@ -383,15 +383,6 @@ description#identity-popup-content-verifier,
|
||||||
background-image: url("chrome://browser/skin/controlcenter/tracking-protection.svg");
|
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 */
|
/* Disabled label */
|
||||||
|
|
||||||
#identity-popup-content-blocking-disabled-label {
|
#identity-popup-content-blocking-disabled-label {
|
||||||
|
|
@ -419,11 +410,6 @@ description#identity-popup-content-verifier,
|
||||||
stroke: #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 {
|
#identity-popup-content-blocking-content:not([enabled]) #identity-popup-content-blocking-disabled-label-exception {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,6 @@ const TRACKING_PAGE = `http://tracking.example.org/${RESOURCE_PATH}/tracking.htm
|
||||||
var ControlCenter = {
|
var ControlCenter = {
|
||||||
init(libDir) {
|
init(libDir) {
|
||||||
// Disable the FTU tours.
|
// Disable the FTU tours.
|
||||||
Services.prefs.setIntPref("privacy.trackingprotection.introCount", 20);
|
|
||||||
Services.prefs.setIntPref("browser.contentblocking.introCount", 20);
|
Services.prefs.setIntPref("browser.contentblocking.introCount", 20);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue