Bug 1467112 - Use listener instead of javascript: URL to conform to CSP. r=Gijs
authorKartikaya Gupta <kgupta@mozilla.com>
Wed, 06 Jun 2018 10:24:35 -0400
changeset 421604 997adbec4c49d42858a05a02b22badfb8a127628
parent 421603 e79ad2cef7add5f37904b09f4b1d3b3cafce50d2
child 421605 d5fbac7b54578bb9b1f2d74ee64aa8053e11aa4b
push id34099
push userncsoregi@mozilla.com
push dateWed, 06 Jun 2018 22:00:08 +0000
treeherdermozilla-central@1ab062fd31db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1467112
milestone62.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1467112 - Use listener instead of javascript: URL to conform to CSP. r=Gijs MozReview-Commit-ID: HAS9AwPD52h
toolkit/components/aboutcheckerboard/content/aboutCheckerboard.js
--- a/toolkit/components/aboutcheckerboard/content/aboutCheckerboard.js
+++ b/toolkit/components/aboutcheckerboard/content/aboutCheckerboard.js
@@ -8,20 +8,21 @@ var trace;
 var service;
 var reports;
 
 function onLoad() {
   trace = document.getElementById("trace");
   service = new CheckerboardReportService();
   updateEnabled();
   reports = service.getReports();
-  for (var i = 0; i < reports.length; i++) {
+  for (let i = 0; i < reports.length; i++) {
     let text = "Severity " + reports[i].severity + " at " + new Date(reports[i].timestamp).toString();
     let link = document.createElement("a");
-    link.href = "javascript:showReport(" + i + ")";
+    link.href = "#";
+    link.addEventListener("click", function() { showReport(i); return false; });
     link.textContent = text;
     let bullet = document.createElement("li");
     bullet.appendChild(link);
     document.getElementById(reports[i].reason).appendChild(bullet);
   }
 }
 
 function updateEnabled() {