Bug 1465952 - about:support displays JSON of successfully parsed policies r?felipe
MozReview-Commit-ID: 8l7RE5ZO0jb
--- a/toolkit/content/aboutSupport.js
+++ b/toolkit/content/aboutSupport.js
@@ -89,17 +89,32 @@ var snapshotFormatters = {
case Services.policies.ACTIVE:
policiesText = strings.GetStringFromName("policies.active");
break;
default:
policiesText = strings.GetStringFromName("policies.error");
break;
}
- $("policies-status").textContent = policiesText;
+
+ if (data.policiesStatus == Services.policies.ACTIVE) {
+ let activePolicies = $.new("a", policiesText);
+ activePolicies.addEventListener("click", function(event) {
+ let activePoliciesJson = {};
+ activePoliciesJson.policies = Services.policies.getActivePolicies();
+ let activePoliciesJsonBlob = new Blob([JSON.stringify(activePoliciesJson)],
+ {type: "application/json"});
+ let jsonURL = URL.createObjectURL(activePoliciesJsonBlob);
+ window.open(jsonURL);
+ URL.revokeObjectURL(jsonURL);
+ });
+ $("policies-status").appendChild(activePolicies);
+ } else {
+ $("policies-status").textContent = policiesText;
+ }
} else {
$("policies-status-row").hidden = true;
}
let keyGoogleFound = data.keyGoogleFound ? "found" : "missing";
$("key-google-box").textContent = strings.GetStringFromName(keyGoogleFound);
let keyMozillaFound = data.keyMozillaFound ? "found" : "missing";