Bug 1392407 - Fix about:telemetry issue with btoa r?chutten draft
authorflyingrub <flyinggrub@gmail.com>
Thu, 24 Aug 2017 13:41:28 +0200
changeset 653222 558922ad27ed251f32a5c15b602f40bd342f188e
parent 651826 d1c70c20e7b52f7295411343e4dc5db8ee7c92b9
child 728283 8e1b170fe6cf36a85c7815806b7e2254365bc2e9
push id76266
push userbmo:flyinggrub@gmail.com
push dateFri, 25 Aug 2017 18:30:34 +0000
reviewerschutten
bugs1392407
milestone57.0a1
Bug 1392407 - Fix about:telemetry issue with btoa r?chutten MozReview-Commit-ID: K2kvFTQKLwT
toolkit/content/aboutTelemetry.js
--- 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();