Bug 1372509 - Fix eslint warnings in about:webrtc. r=jesup, a=jcristau
authorJan-Ivar Bruaroey <jib@mozilla.com>
Tue, 11 Jul 2017 16:27:47 -0400
changeset 411987 b37c3164182342ef630f6ce58631eb5fe490361b
parent 411986 a7b3f2eb7ff490e787d35e7c10be53497e4d82f7
child 411988 e26b1f5d635e2b62ba99f5ec90a0c10509a6eee9
push id7514
push userryanvm@gmail.com
push dateMon, 17 Jul 2017 13:37:24 +0000
treeherdermozilla-beta@e26b1f5d635e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup, jcristau
bugs1372509
milestone55.0
Bug 1372509 - Fix eslint warnings in about:webrtc. r=jesup, a=jcristau
toolkit/content/aboutwebrtc/aboutWebrtc.js
--- a/toolkit/content/aboutwebrtc/aboutWebrtc.js
+++ b/toolkit/content/aboutwebrtc/aboutWebrtc.js
@@ -134,21 +134,23 @@ Control.prototype = {
 
   get message() {
     return this._messageVal;
   },
 
   update() {
     this.ctrl.textContent = this._label;
 
+    this.msg.textContent = "";
     if (this._message) {
-      this.msg.innerHTML =
-        `<span class="info-label">${this._messageHeader}:</span> ${this._message}`;
-    } else {
-      this.msg.innerHTML = null;
+      this.msg.appendChild(Object.assign(document.createElement("span"), {
+        className: "info-label",
+        textContent: `${this._messageHeader}: `,
+      }));
+      this.msg.appendChild(document.createTextNode(this._message));
     }
   },
 
   onClick(event) {
     return true;
   }
 };
 
@@ -300,17 +302,17 @@ var AboutWebRTC = {
     this._content = parent;
     this._setData(data);
 
     if (data.error) {
       let msg = document.createElement("h3");
       msg.textContent = getString("cannot_retrieve_log");
       parent.appendChild(msg);
       msg = document.createElement("p");
-      msg.innerHTML = `${data.error.name}: ${data.error.message}`;
+      msg.textContent = `${data.error.name}: ${data.error.message}`;
       parent.appendChild(msg);
       return;
     }
 
     this._peerConnections = this.renderPeerConnections();
     this._connectionLog = this.renderConnectionLog();
     this._content.appendChild(this._peerConnections);
     this._content.appendChild(this._connectionLog);