зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1483378 - Part 4: Enable hiding the "reject trackers" menu item based on a preference; r=johannh
This commit is contained in:
Родитель
225319893d
Коммит
8e069da931
|
@ -1488,6 +1488,7 @@ pref("browser.ping-centre.production.endpoint", "https://tiles.services.mozilla.
|
|||
pref("media.gmp-provider.enabled", true);
|
||||
|
||||
pref("browser.contentblocking.enabled", true);
|
||||
pref("browser.contentblocking.cookies-site-data.ui.reject-trackers.enabled", true);
|
||||
pref("browser.contentblocking.cookies-site-data.ui.reject-trackers.recommended", true);
|
||||
#ifdef NIGHTLY_BUILD
|
||||
pref("browser.contentblocking.ui.enabled", true);
|
||||
|
|
|
@ -29,6 +29,9 @@ XPCOMUtils.defineLazyPreferenceGetter(this, "contentBlockingCookiesAndSiteDataUi
|
|||
XPCOMUtils.defineLazyPreferenceGetter(this, "contentBlockingCookiesAndSiteDataRejectTrackersRecommended",
|
||||
"browser.contentblocking.cookies-site-data.ui.reject-trackers.recommended");
|
||||
|
||||
XPCOMUtils.defineLazyPreferenceGetter(this, "contentBlockingCookiesAndSiteDataRejectTrackersEnabled",
|
||||
"browser.contentblocking.cookies-site-data.ui.reject-trackers.enabled");
|
||||
|
||||
XPCOMUtils.defineLazyPreferenceGetter(this, "contentBlockingEnabled",
|
||||
"browser.contentblocking.enabled");
|
||||
|
||||
|
@ -531,6 +534,10 @@ var gPrivacyPane = {
|
|||
if (contentBlockingCookiesAndSiteDataRejectTrackersRecommended) {
|
||||
document.l10n.setAttributes(blockCookiesFromTrackers, "sitedata-block-trackers-option-recommended");
|
||||
}
|
||||
// Allow hiding the Reject Trackers option based on a pref
|
||||
if (!contentBlockingCookiesAndSiteDataRejectTrackersEnabled) {
|
||||
blockCookiesFromTrackers.remove();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -71,6 +71,7 @@ run-if = nightly_build
|
|||
[browser_privacypane_1.js]
|
||||
[browser_privacypane_2.js]
|
||||
[browser_privacypane_3.js]
|
||||
[browser_privacypane_4.js]
|
||||
[browser_privacypane_5.js]
|
||||
[browser_sanitizeOnShutdown_prefLocked.js]
|
||||
[browser_searchShowSuggestionsFirst.js]
|
||||
|
|
|
@ -8,7 +8,8 @@ if (jar) {
|
|||
Services.scriptloader.loadSubScript(rootDir + "privacypane_tests_perwindow.js", this);
|
||||
|
||||
SpecialPowers.pushPrefEnv({"set":
|
||||
[["browser.contentblocking.cookies-site-data.ui.enabled", true]]
|
||||
[["browser.contentblocking.cookies-site-data.ui.enabled", true],
|
||||
["browser.contentblocking.cookies-site-data.ui.reject-trackers.enabled", true]]
|
||||
});
|
||||
|
||||
run_test_subset([
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
let rootDir = getRootDirectory(gTestPath);
|
||||
let jar = getJar(rootDir);
|
||||
if (jar) {
|
||||
let tmpdir = extractJarToTmp(jar);
|
||||
rootDir = "file://" + tmpdir.path + "/";
|
||||
}
|
||||
/* import-globals-from privacypane_tests_perwindow.js */
|
||||
Services.scriptloader.loadSubScript(rootDir + "privacypane_tests_perwindow.js", this);
|
||||
|
||||
SpecialPowers.pushPrefEnv({"set":
|
||||
[["browser.contentblocking.cookies-site-data.ui.enabled", true],
|
||||
["browser.contentblocking.cookies-site-data.ui.reject-trackers.enabled", false]]
|
||||
});
|
||||
|
||||
run_test_subset([
|
||||
test_pane_visibility,
|
||||
test_dependent_elements,
|
||||
test_dependent_cookie_elements,
|
||||
test_dependent_clearonclose_elements,
|
||||
test_dependent_prefs,
|
||||
]);
|
|
@ -163,7 +163,11 @@ function test_dependent_cookie_elements(win) {
|
|||
expect_disabled(true, [keepUntil, keepCookiesUntil]);
|
||||
expect_disabled(false, [blockCookiesLabel, blockCookiesMenu]);
|
||||
|
||||
if (win.contentBlockingCookiesAndSiteDataRejectTrackersEnabled) {
|
||||
blockCookiesMenu.value = "trackers";
|
||||
} else {
|
||||
blockCookiesMenu.value = "unvisited";
|
||||
}
|
||||
controlChanged(blockCookiesMenu);
|
||||
expect_disabled(false);
|
||||
} else {
|
||||
|
|
Загрузка…
Ссылка в новой задаче