Bug 1392407 - Fix about:telemetry issue with btoa r?chutten
MozReview-Commit-ID: K2kvFTQKLwT
--- a/toolkit/content/aboutTelemetry.js
+++ b/toolkit/content/aboutTelemetry.js
@@ -2054,17 +2054,22 @@ function urlStateRestore() {
let subcategory = document.querySelector(selector);
showSubSection(subcategory);
}
}
}
}
function openJsonInFirefoxJsonViewer(json) {
- window.open("data:application/json;base64," + btoa(json));
+ json = unescape(encodeURIComponent(json));
+ try {
+ window.open("data:application/json;base64," + btoa(json));
+ } catch (e) {
+ show(document.querySelector(".category[value=raw-payload-section]"));
+ }
}
function onLoad() {
window.removeEventListener("load", onLoad);
// Set the text in the page header
setupPageHeader();