Bug 1499911 - Break down the labels for the issues submitted through the report breakage UI for the various cookie policies r=johannh

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Ehsan Akhgari 2018-10-18 14:46:20 +00:00
Родитель b913a19d0c
Коммит 89165de187
1 изменённых файлов: 18 добавлений и 1 удалений

Просмотреть файл

@ -126,7 +126,6 @@ var TrackingProtection = {
};
var ThirdPartyCookies = {
reportBreakageLabel: "cookierestrictions",
telemetryIdentifier: "cr",
PREF_ENABLED: "network.cookie.cookieBehavior",
PREF_REPORT_BREAKAGE_ENABLED: "browser.contentblocking.rejecttrackers.reportBreakage.enabled",
@ -144,6 +143,24 @@ var ThirdPartyCookies = {
document.getElementById("identity-popup-content-blocking-category-3rdpartycookies");
},
get reportBreakageLabel() {
switch (this.behaviorPref) {
case Ci.nsICookieService.BEHAVIOR_ACCEPT:
return "nocookiesblocked";
case Ci.nsICookieService.BEHAVIOR_REJECT_FOREIGN:
return "allthirdpartycookiesblocked";
case Ci.nsICookieService.BEHAVIOR_REJECT:
return "allcookiesblocked";
case Ci.nsICookieService.BEHAVIOR_LIMIT_FOREIGN:
return "cookiesfromunvisitedsitesblocked";
default:
Cu.reportError(`Error: Unknown cookieBehavior pref observed: ${this.behaviorPref}`);
// fall through
case Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER:
return "cookierestrictions";
}
},
init() {
XPCOMUtils.defineLazyPreferenceGetter(this, "behaviorPref", this.PREF_ENABLED,
Ci.nsICookieService.BEHAVIOR_ACCEPT);