зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1473685 - When a user "disables protection" on a site, and no trackers are detected, indicate that TP is turned off instead of on. r=nhnt11
MozReview-Commit-ID: 9JjCK1GYMbC --HG-- extra : rebase_source : 86096c64d2fa533dc8d8632660b16e18e0b6995c
This commit is contained in:
Родитель
e2ce31efc1
Коммит
5f6d7909f1
|
@ -69,6 +69,7 @@ function testBenignPageWithException() {
|
|||
info("Non-tracking content must not be blocked");
|
||||
ok(!TrackingProtection.container.hidden, "The container is visible");
|
||||
ok(!TrackingProtection.content.hasAttribute("state"), "content: no state");
|
||||
ok(TrackingProtection.content.hasAttribute("hasException"), "content has exception attribute");
|
||||
ok(!TrackingProtection.icon.hasAttribute("state"), "icon: no state");
|
||||
ok(!TrackingProtection.icon.hasAttribute("tooltiptext"), "icon: no tooltip");
|
||||
|
||||
|
@ -192,11 +193,22 @@ async function testTrackingProtectionDisabled(tab) {
|
|||
testBenignPage();
|
||||
|
||||
info("Load a test page not containing tracking elements which has an exception.");
|
||||
let isPrivateBrowsing = PrivateBrowsingUtils.isWindowPrivate(tab.ownerGlobal);
|
||||
let uri = Services.io.newURI("https://example.org/");
|
||||
Services.perms.add(uri, "trackingprotection", Services.perms.ALLOW_ACTION);
|
||||
if (isPrivateBrowsing) {
|
||||
PrivateBrowsingUtils.addToTrackingAllowlist(uri);
|
||||
} else {
|
||||
Services.perms.add(uri, "trackingprotection", Services.perms.ALLOW_ACTION);
|
||||
}
|
||||
|
||||
await promiseTabLoadEvent(tab, uri.spec);
|
||||
testBenignPageWithException();
|
||||
Services.perms.remove(uri, "trackingprotection");
|
||||
|
||||
if (isPrivateBrowsing) {
|
||||
PrivateBrowsingUtils.removeFromTrackingAllowlist(uri);
|
||||
} else {
|
||||
Services.perms.remove(uri, "trackingprotection");
|
||||
}
|
||||
|
||||
info("Load a test page containing tracking elements");
|
||||
await promiseTabLoadEvent(tab, TRACKING_PAGE);
|
||||
|
|
|
@ -307,6 +307,7 @@ description#identity-popup-content-verifier,
|
|||
}
|
||||
|
||||
#tracking-protection-content[enabled="false"],
|
||||
#tracking-protection-content[hasException],
|
||||
#tracking-protection-content[state="loaded-tracking-content"] {
|
||||
background-image: url("chrome://browser/skin/controlcenter/tracking-protection-disabled.svg");
|
||||
}
|
||||
|
@ -314,12 +315,14 @@ description#identity-popup-content-verifier,
|
|||
/* Show the "on" label by default, except when TP is disabled or there's a local exception. */
|
||||
#tracking-protection-label-off,
|
||||
#tracking-protection-content[enabled="false"] #tracking-protection-label-on,
|
||||
#tracking-protection-content[hasException] #tracking-protection-label-on,
|
||||
#tracking-protection-content[state="loaded-tracking-content"] #tracking-protection-label-on {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#tracking-protection-label-on,
|
||||
#tracking-protection-content[enabled="false"] #tracking-protection-label-off,
|
||||
#tracking-protection-content[hasException] #tracking-protection-label-off,
|
||||
#tracking-protection-content[state="loaded-tracking-content"] #tracking-protection-label-off {
|
||||
display: -moz-box;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче