Bug 731532 - Fix issues in test pilot validation. r+a=Standard8
authorIrving Reid <irving@mozilla.com>
Fri, 02 Mar 2012 15:05:38 -0500
changeset 10664 9502ae8490b06603d9ff2aafbb9955a868354605
parent 10663 6c906871129de19a1f7bce7a8950d8ea6b2de2d0
child 10665 64a9433733cad55c71193d1e667b4b407fd67ef2
push idunknown
push userunknown
push dateunknown
bugs731532
Bug 731532 - Fix issues in test pilot validation. r+a=Standard8
mail/app/profile/extensions/tbtestpilot@labs.mozilla.com/content/all-studies-window.js
mail/app/profile/extensions/tbtestpilot@labs.mozilla.com/content/all-studies.js
mail/app/profile/extensions/tbtestpilot@labs.mozilla.com/content/experiment-page.js
mail/app/profile/extensions/tbtestpilot@labs.mozilla.com/content/survey-generator.js
mail/app/profile/extensions/tbtestpilot@labs.mozilla.com/content/welcome-page.js
mail/app/profile/extensions/tbtestpilot@labs.mozilla.com/modules/lib/xhr.js
--- a/mail/app/profile/extensions/tbtestpilot@labs.mozilla.com/content/all-studies-window.js
+++ b/mail/app/profile/extensions/tbtestpilot@labs.mozilla.com/content/all-studies-window.js
@@ -96,25 +96,29 @@ var TestPilotXulWindow = {
 
   addXulLink: function (container, text, url, openInTab) {
     let linkContainer = document.createElement("hbox");
     let link = document.createElement("label");
     let spacer = document.createElement("spacer");
     link.setAttribute("value", text);
     link.setAttribute("class", "text-link");
     if (openInTab) {
-      link.setAttribute(
-        "onclick",
-        "if (event.button==0) { " +
-        "TestPilotWindowUtils.openInTab('" + url + "'); }");
+      link.addEventListener("click",
+        function(event) {
+          if (event.button == 0) {
+            TestPilotWindowUtils.openInTab(url);
+          }
+        }, false);
     } else {
-      link.setAttribute(
-        "onclick",
-        "if (event.button==0) { " +
-        "TestPilotWindowUtils.openChromeless('" + url + "'); }");
+      link.addEventListener("click",
+        function(event) {
+          if (event.button == 0) {
+            TestPilotWindowUtils.openChromeless(url);
+          }
+        }, false);
     }
     linkContainer.appendChild(link);
     spacer.setAttribute("flex", "1");
     linkContainer.appendChild(spacer);
     container.appendChild(linkContainer);
   },
 
   addLabel: function(container, text, styleClass) {
@@ -176,19 +180,19 @@ var TestPilotXulWindow = {
     desc.setAttribute("crop", "none");
     txtNode = document.createTextNode(paragraph);
     desc.appendChild(txtNode);
     container.appendChild(desc);
   },
 
   addButton: function(container, label, id, onClickHandler) {
     let button = document.createElement("button");
-    button.setAttribute("label", label);
+    button.setAttribute("label", this._stringBundle.getString(label));
     button.setAttribute("id", id);
-    button.setAttribute("oncommand", onClickHandler);
+    button.addEventListener("command", onClickHandler, false);
     container.appendChild(button);
   },
 
   _sortNewestFirst: function(experiments) {
     experiments.sort(
       function sortFunc(a, b) {
         if (a.endDate && b.endDate) {
           return b.endDate - a.endDate;
@@ -285,19 +289,19 @@ var TestPilotXulWindow = {
       let statusVbox = document.createElement("vbox");
       if (task.status == TaskConstants.STATUS_FINISHED) {
         this.addLabel(
           statusVbox,
           this._stringBundle.getFormattedString(
             "testpilot.studiesWindow.finishedOn",
             [(new Date(task.endDate)).toLocaleDateString()]));
         this.addButton(statusVbox,
-          this._stringBundle.getString("testpilot.submit"),
+          "testpilot.submit",
           "submit-button-" + task.id,
-          "TestPilotXulWindow.onSubmitButton(" + task.id + ");");
+          function() {TestPilotXulWindow.onSubmitButton(task.id)});
       }
       if (task.status == TaskConstants.STATUS_CANCELLED) {
         let hbox = document.createElement("hbox");
         newRow.setAttribute("class", "tp-opted-out");
         statusVbox.appendChild(this.makeSpacer());
         statusVbox.appendChild(hbox);
         this.addLabel(
           statusVbox,
@@ -309,38 +313,38 @@ var TestPilotXulWindow = {
       }
       if (task.status == TaskConstants.STATUS_NEW ||
           task.status == TaskConstants.STATUS_PENDING ) {
         newRow.setAttribute("class", "tp-new-results");
 
         if (task.taskType == TaskConstants.TYPE_SURVEY) {
           this.addButton(
             statusVbox,
-            this._stringBundle.getString("testpilot.takeSurvey"),
+            "testpilot.takeSurvey",
             "survey-button",
-            "TestPilotXulWindow.onTakeSurveyButton('" + task.id + "');");
+            function(){TestPilotXulWindow.onTakeSurveyButton(task.id)});
         } else if (task.taskType == TaskConstants.TYPE_EXPERIMENT) {
           if (task.startDate) {
             this.addLabel(
               statusVbox,
               this._stringBundle.getFormattedString(
                 "testpilot.studiesWindow.willStart",
                 [(new Date(task.startDate)).toLocaleDateString()]));
           }
         }
       }
       if (task.status == TaskConstants.STATUS_IN_PROGRESS ||
           task.status == TaskConstants.STATUS_STARTING) {
 
         if (task.taskType == TaskConstants.TYPE_SURVEY) {
           this.addButton(
             statusVbox,
-            this._stringBundle.getString("testpilot.takeSurvey"),
+            "testpilot.takeSurvey",
             "survey-button",
-            "TestPilotXulWindow.onTakeSurveyButton('" + task.id + "');");
+            function(){TestPilotXulWindow.onTakeSurveyButton(task.id)});
         } else if (task.taskType == TaskConstants.TYPE_EXPERIMENT) {
           this.addLabel(
             statusVbox,
             this._stringBundle.getString(
              "testpilot.studiesWindow.gatheringData"));
              let now = (new Date()).getTime();
           let progress =
             100 * (now - task.startDate) / (task.endDate - task.startDate);
--- a/mail/app/profile/extensions/tbtestpilot@labs.mozilla.com/content/all-studies.js
+++ b/mail/app/profile/extensions/tbtestpilot@labs.mozilla.com/content/all-studies.js
@@ -78,25 +78,25 @@ function fillAllStudiesPage() {
 
   let experiments = _sortNewestFirst(TestPilotSetup.getAllTasks());
 
   for (let i = 0; i < experiments.length; i++) {
     let task = experiments[i];
     let newRow = document.createElement("tr");
 
     let newCell = document.createElement("td");
-    newCell.innerHTML = task.title;
+    newCell.textContent = task.title;
     newRow.appendChild(newCell);
     newCell = document.createElement("td");
-    newCell.innerHTML = task.summary;
+    newCell.textContent = task.summary;
     newRow.appendChild(newCell);
 
     let link = document.createElement("a");
     link.setAttribute("href", task.defaultUrl);
-    link.innerHTML = "More Info";
+    link.textContent = "More Info";
 
     newCell = document.createElement("td");
     newCell.appendChild(link);
     newRow.appendChild(newCell);
 
     table.appendChild(newRow);
   }
-}
\ No newline at end of file
+}
--- a/mail/app/profile/extensions/tbtestpilot@labs.mozilla.com/content/experiment-page.js
+++ b/mail/app/profile/extensions/tbtestpilot@labs.mozilla.com/content/experiment-page.js
@@ -70,27 +70,27 @@ var stringBundle;
         task.setRecurPref(TaskConstants.ALWAYS_SUBMIT);
       }
     }
 
     // Study web content must provide an element with id 'upload-status'.
     // Fill it first with a message about data being uploaded; if there's
     // an error, replace it with the error message.
     let uploadStatus = document.getElementById("upload-status");
-    uploadStatus.innerHTML =
+    uploadStatus.textContent =
       stringBundle.GetStringFromName("testpilot.statusPage.uploadingData");
     task.upload( function(success) {
       if (success) {
         onStatusPageLoad();
       } else {
         // Replace 'now uploading' message
         let errorParagraph = document.createElement("p");
-        errorParagraph.innerHTML = stringBundle.GetStringFromName("testpilot.statusPage.uploadErrorMsg");
+        errorParagraph.textContent = stringBundle.GetStringFromName("testpilot.statusPage.uploadErrorMsg");
         let willRetryParagraph = document.createElement("p");
-        willRetryParagraph.innerHTML = stringBundle.GetStringFromName("testpilot.statusPage.willRetry");
+        willRetryParagraph.textContent = stringBundle.GetStringFromName("testpilot.statusPage.willRetry");
         uploadStatus.innerHTML = "";
         uploadStatus.appendChild(errorParagraph);
         uploadStatus.appendChild(willRetryParagraph);
       }
     });
   }
 
   function deleteData() {
@@ -228,63 +228,63 @@ var stringBundle;
     var task = TestPilotSetup.getTaskById(experimentId);
     var endDate = new Date(task.endDate);
     var diff = (endDate - Date.now());
     var span = document.getElementById("test-end-time");
     if (!span) {
       return;
     }
     if (diff < 0) {
-      span.innerHTML =
+      span.textContent =
         stringBundle.GetStringFromName("testpilot.statusPage.endedAlready");
       return;
     }
     var hours = diff / (60 * 60 * 1000);
     if (hours < 24) {
-      span.innerHTML =
+      span.textContent =
         stringBundle.formatStringFromName(
 	  "testpilot.statusPage.todayAt", [endDate.toLocaleTimeString()], 1);
     } else {
-      span.innerHTML =
+      span.textContent =
         stringBundle.formatStringFromName(
 	  "testpilot.statusPage.endOn", [endDate.toLocaleString()], 1);
     }
   }
 
   function showMetaData() {
     Components.utils.import("resource://testpilot/modules/metadata.js");
     Components.utils.import("resource://gre/modules/PluralForm.jsm");
     MetadataCollector.getMetadata(function(md) {
       var mdLocale = document.getElementById("md-locale");
       if (mdLocale)
-        mdLocale.innerHTML = md.location;
+        mdLocale.textContent = md.location;
       var mdVersion = document.getElementById("md-version");
       if (mdVersion)
-        mdVersion.innerHTML = md.version;
+        mdVersion.textContent = md.version;
       var mdOs = document.getElementById("md-os");
       if (mdOs)
-        mdOs.innerHTML = md.operatingSystem;
+        mdOs.textContent = md.operatingSystem;
       var mdNumExt = document.getElementById("md-num-ext");
       if (mdNumExt) {
         // This computes the correctly localized singular or plural string
         // of the number of extensions, e.g. "1 extension", "2 extensions", etc.
         let str = stringBundle.GetStringFromName("testpilot.statusPage.numExtensions");
         var numExt = md.extensions.length;
-        mdNumExt.innerHTML = PluralForm.get(numExt, str).replace("#1", numExt);
+        mdNumExt.textContent = PluralForm.get(numExt, str).replace("#1", numExt);
       }
     });
   }
 
   function onQuitPageLoad() {
     Components.utils.import("resource://testpilot/modules/setup.js");
     setStrings(PAGE_TYPE_QUIT);
     let eid = getUrlParam("eid");
     let task = TestPilotSetup.getTaskById(eid);
     let header = document.getElementById("about-quit-title");
-    header.innerHTML =
+    header.textContent =
       stringBundle.formatStringFromName(
 	"testpilot.quitPage.aboutToQuit", [task.title], 1);
 
     if (task._recursAutomatically) {
       document.getElementById("recur-options").setAttribute("style", "");
       document.getElementById("recur-checkbox-container").
         setAttribute("style", "");
     }
@@ -325,52 +325,52 @@ var stringBundle;
 
   function showRecurControls(experiment) {
     Components.utils.import("resource://testpilot/modules/tasks.js");
     let recurPrefSpan = document.getElementById("recur-pref");
     if (!recurPrefSpan) {
       return;
     }
     let days = experiment._recurrenceInterval;
-    recurPrefSpan.innerHTML =
+    recurPrefSpan.textContent =
       stringBundle.formatStringFromName(
 	"testpilot.statusPage.recursEveryNumberOfDays", [days], 1);
 
     let controls = document.getElementById("recur-controls");
     let selector = document.createElement("select");
     controls.appendChild(selector);
-    selector.setAttribute("onchange", "updateRecurSettings();");
+    selector.addEventListener("change", updateRecurSettings, false);
     selector.setAttribute("id", "recur-selector");
 
     let option = document.createElement("option");
     option.setAttribute("value", TaskConstants.ASK_EACH_TIME);
     if (experiment.recurPref == TaskConstants.ASK_EACH_TIME) {
       option.setAttribute("selected", "true");
     }
-    option.innerHTML =
+    option.textContent =
       stringBundle.GetStringFromName(
 	"testpilot.statusPage.askMeBeforeSubmitData");
     selector.appendChild(option);
 
     option = document.createElement("option");
     option.setAttribute("value", TaskConstants.ALWAYS_SUBMIT);
     if (experiment.recurPref == TaskConstants.ALWAYS_SUBMIT) {
       option.setAttribute("selected", "true");
     }
-    option.innerHTML =
+    option.textContent =
       stringBundle.GetStringFromName(
 	"testpilot.statusPage.alwaysSubmitData");
     selector.appendChild(option);
 
     option = document.createElement("option");
     option.setAttribute("value", TaskConstants.NEVER_SUBMIT);
     if (experiment.recurPref == TaskConstants.NEVER_SUBMIT) {
       option.setAttribute("selected", "true");
     }
-    option.innerHTML =
+    option.textContent =
       stringBundle.GetStringFromName(
 	"testpilot.statusPage.neverSubmitData");
     selector.appendChild(option);
   }
 
   function loadExperimentPage() {
     Components.utils.import("resource://testpilot/modules/setup.js");
     Components.utils.import("resource://testpilot/modules/tasks.js");
@@ -477,17 +477,17 @@ var stringBundle;
     mapLength = map.length;
     for (let i = 0; i < mapLength; i++) {
       let entry = map[i];
       let elem = document.getElementById(entry.id);
       if (!elem) {
         Services.console.logStringMessage("No elem as " + entry.id +".\n");
         continue;
       }
-      elem.innerHTML = stringBundle.GetStringFromName(entry.stringKey);
+      elem.textContent = stringBundle.GetStringFromName(entry.stringKey);
     }
   }
 
 function showDbContentsHtml() {
   Components.utils.import("resource://testpilot/modules/setup.js");
   var experimentId = getUrlParam("eid");
   var experiment = TestPilotSetup.getTaskById(experimentId);
   var dataStore = experiment.dataStore;
@@ -516,9 +516,9 @@ function showDbContentsHtml() {
   });
 
 }
 
 function showQuitUi() {
   $('#quit-ui').slideDown();
   $("#main-experiment-ui").slideUp();
   onQuitPageLoad();
-}
\ No newline at end of file
+}
--- a/mail/app/profile/extensions/tbtestpilot@labs.mozilla.com/content/survey-generator.js
+++ b/mail/app/profile/extensions/tbtestpilot@labs.mozilla.com/content/survey-generator.js
@@ -49,51 +49,56 @@ function onBuiltinSurveyLoad() {
   Components.utils.import("resource://testpilot/modules/tasks.js");
   setStrings();
   let eid = getUrlParam("eid");
   let task = TestPilotSetup.getTaskById(eid);
   let contentDiv = document.getElementById("survey-contents");
   let explanation = document.getElementById("survey-explanation");
   if (!task) {
     // Tasks haven't all loaded yet.  Try again in a few seconds.
-    contentDiv.innerHTML =
+    contentDiv.textContent =
       stringBundle.GetStringFromName("testpilot.surveyPage.loading");
     window.setTimeout(function() { onBuiltinSurveyLoad(); }, 2000);
     return;
   }
 
   let title = document.getElementById("survey-title");
-  title.innerHTML = task.title;
+  title.textContent = task.title;
 
   let submitButton = document.getElementById("survey-submit");
   if (task.relatedStudyId) {
-     submitButton.innerHTML =
+     submitButton.textContent =
       stringBundle.GetStringFromName("testpilot.surveyPage.submitAnswers");
   } else {
-    submitButton.innerHTML =
+    submitButton.textContent =
       stringBundle.GetStringFromName("testpilot.surveyPage.saveAnswers");
   }
 
+  explanation.innerHTML = "";
+  contentDiv.innerHTML = "";
   if (task.status == TaskConstants.STATUS_SUBMITTED) {
-    contentDiv.innerHTML =
-      "<p>" +
-      stringBundle.GetStringFromName(
-        "testpilot.surveyPage.thankYouForFinishingSurvey") + "</p><p>" +
-      stringBundle.GetStringFromName(
-        "testpilot.surveyPage.reviewOrChangeYourAnswers") + "</p>";
-    explanation.innerHTML = "";
+    let thanks = document.createElement("p");
+    thanks.textContent =
+      stringBundle.GetStringFromName("testpilot.surveyPage.thankYouForFinishingSurvey");
+    contentDiv.appendElement(thanks);
+    let review = document.createElement("p");
+    review.textContent = 
+      stringBundle.GetStringFromName("testpilot.surveyPage.reviewOrChangeYourAnswers");
+    contentDiv.appendElement(review);
     submitButton.setAttribute("style", "display:none");
     let changeButton = document.getElementById("change-answers");
     changeButton.setAttribute("style", "");
   } else {
-    contentDiv.innerHTML = "";
     if (task.surveyExplanation) {
-      explanation.innerHTML = task.surveyExplanation;
-    } else {
-      explanation.innerHTML = "";
+      // parse and sanitize HTML for surveyExplanation
+      // https://developer.mozilla.org/en/XUL_School/DOM_Building_and_HTML_Insertion#Safely_Using_Remote_HTML
+      let expl = Components.classes["@mozilla.org/feed-unescapehtml;1"]  
+                   .getService(Components.interfaces.nsIScriptableUnescapeHTML)  
+                   .parseFragment(task.surveyExplanation, false, null, document);  
+      explanation.appendElement(expl);
     }
     drawSurveyForm(task, contentDiv);
     // Allow surveys to define arbitrary page load handlers - call them
     // after creating the rest of the page:
     task.onPageLoad(task, document);
   }
 }
 
@@ -115,38 +120,39 @@ function drawSurveyForm(task, contentDiv
   // Loop through questions and render html form input elements for each
   // one.
   for (let i = 0; i < surveyQuestions.length; i++) {
     let question = surveyQuestions[i].question;
     let explanation = surveyQuestions[i].explanation;
     let elem, j;
 
     elem = document.createElement("h3");
-    elem.innerHTML = (i+1) + ". " + question;
+    elem.textContent = (i+1) + ". " + question;
     contentDiv.appendChild(elem);
     if (explanation) {
       elem = document.createElement("p");
       elem.setAttribute("class", "survey-question-explanation");
-      elem.innerHTML = explanation;
+      // XXX this might need to support HTML
+      elem.textContent = explanation;
       contentDiv.appendChild(elem);
     }
     // If you've done this survey before, preset all inputs using old answers
     let choices = surveyQuestions[i].choices;
     switch (surveyQuestions[i].type) {
     case MULTIPLE_CHOICE:
       for (j = 0; j < choices.length; j++) {
         let newRadio = document.createElement("input");
         newRadio.setAttribute("type", "radio");
         newRadio.setAttribute("name", "answer_to_" + i);
         newRadio.setAttribute("value", j);
         if (oldAnswers && oldAnswers[i] == String(j)) {
           newRadio.setAttribute("checked", "true");
         }
         let label = document.createElement("span");
-        label.innerHTML = choices[j];
+        label.textContent = choices[j];
         contentDiv.appendChild(newRadio);
         contentDiv.appendChild(label);
         contentDiv.appendChild(document.createElement("br"));
       }
       break;
     case CHECK_BOXES:
     case CHECK_BOXES_WITH_FREE_ENTRY:
       let checkboxName = "answer_to_" + i;
@@ -160,17 +166,17 @@ function drawSurveyForm(task, contentDiv
           for each (let an in oldAnswers[i]) {
             if (an == String(j)) {
               newCheck.setAttribute("checked", "true");
               break;
             }
           }
         }
         let label = document.createElement("span");
-        label.innerHTML = choices[j];
+        label.textContent = choices[j];
         contentDiv.appendChild(newCheck);
         contentDiv.appendChild(label);
         contentDiv.appendChild(document.createElement("br"));
       }
       // Text area:
       if (surveyQuestions[i].type == CHECK_BOXES_WITH_FREE_ENTRY &&
           surveyQuestions[i].free_entry) {
         let freeformId = "freeform_" + i;
@@ -180,17 +186,17 @@ function drawSurveyForm(task, contentDiv
         newCheck.setAttribute("value", freeformId);
         newCheck.addEventListener(
           "click", function(event) {
             if (!event.target.checked) {
               document.getElementById(freeformId).value = "";
             }
           }, false);
         let label = document.createElement("span");
-        label.innerHTML = surveyQuestions[i].free_entry + "&nbsp:&nbsp";
+        label.textContent = surveyQuestions[i].free_entry + "&nbsp:&nbsp";
         let inputBox = document.createElement("textarea");
         inputBox.setAttribute("id", freeformId);
         inputBox.addEventListener(
           "keypress", function() {
             let elements = document.getElementsByName(checkboxName);
             for (j = (elements.length - 1); j >= 0; j--) {
               if (elements[j].value == freeformId) {
                 elements[j].checked = true;
@@ -209,32 +215,32 @@ function drawSurveyForm(task, contentDiv
         }
         contentDiv.appendChild(newCheck);
         contentDiv.appendChild(label);
         contentDiv.appendChild(inputBox);
       }
       break;
     case SCALE:
       let label = document.createElement("span");
-      label.innerHTML = surveyQuestions[i].min_label;
+      label.textContent = surveyQuestions[i].min_label;
       contentDiv.appendChild(label);
       for (j = surveyQuestions[i].scale_minimum;
            j <= surveyQuestions[i].scale_maximum;
            j++) {
         let newRadio = document.createElement("input");
         newRadio.setAttribute("type", "radio");
         newRadio.setAttribute("name", "answer_to_" + i);
         newRadio.setAttribute("value", j);
         if (oldAnswers && oldAnswers[i] == String(j)) {
           newRadio.setAttribute("checked", "true");
         }
         contentDiv.appendChild(newRadio);
       }
       label = document.createElement("span");
-      label.innerHTML = surveyQuestions[i].max_label;
+      label.textContent = surveyQuestions[i].max_label;
       contentDiv.appendChild(label);
       break;
     case FREE_ENTRY:
       let inputBox = document.createElement("textarea");
       inputBox.setAttribute("id", "freeform_" + i);
 
       if (oldAnswers && oldAnswers[i] && (oldAnswers[i].length > 0)) {
         inputBox.value = oldAnswers[i];
@@ -254,34 +260,34 @@ function drawSurveyForm(task, contentDiv
         newRadio.addEventListener(
           "click", function() {
             let inputBox = document.getElementById(freeformId);
             if (inputBox) {
               inputBox.value = "";
             }
           }, false);
         let label = document.createElement("span");
-        label.innerHTML = choices[j];
+        label.textContent = choices[j];
         if (oldAnswers && oldAnswers[i] == String(j)) {
           newRadio.setAttribute("checked", "true");
           checked = true;
         }
         contentDiv.appendChild(newRadio);
         contentDiv.appendChild(label);
         contentDiv.appendChild(document.createElement("br"));
       }
 
       // Text area:
       if (surveyQuestions[i].free_entry) {
         let newRadio = document.createElement("input");
         newRadio.setAttribute("type", "radio");
         newRadio.setAttribute("name", radioName);
         newRadio.setAttribute("value", freeformId);
         let label = document.createElement("span");
-        label.innerHTML = surveyQuestions[i].free_entry + "&nbsp:&nbsp";
+        label.textContent = surveyQuestions[i].free_entry + "&nbsp:&nbsp";
         let inputBox = document.createElement("textarea");
         inputBox.setAttribute("id", freeformId);
         inputBox.addEventListener(
           "keypress", function() {
             let elements = document.getElementsByName(radioName);
             for (let j = 0; j < elements.length; j++) {
               if (elements[j].value == freeformId) {
                 elements[j].checked = true;
@@ -362,12 +368,12 @@ function setStrings() {
     { id: "testpilot-twitter-link",
       stringKey: "testpilot.page.testpilotOnTwitter" },
     { id: "change-answers",
       stringKey: "testpilot.surveyPage.changeAnswers" }
   ];
   let mapLength = map.length;
   for (let i = 0; i < mapLength; i++) {
     let entry = map[i];
-    document.getElementById(entry.id).innerHTML =
+    document.getElementById(entry.id).textContent =
       stringBundle.GetStringFromName(entry.stringKey);
   }
 }
--- a/mail/app/profile/extensions/tbtestpilot@labs.mozilla.com/content/welcome-page.js
+++ b/mail/app/profile/extensions/tbtestpilot@labs.mozilla.com/content/welcome-page.js
@@ -99,13 +99,13 @@ var TestPilotWelcomePage = {
 	stringKey: "testpilot.welcomePage.privacyPolicy" },
       { id: "legal-notices-link",
 	stringKey: "testpilot.welcomePage.legalNotices" }
       ];
 
     let mapLength = map.length;
     for (let i = 0; i < mapLength; i++) {
       let entry = map[i];
-      document.getElementById(entry.id).innerHTML =
+      document.getElementById(entry.id).textContent =
         stringBundle.GetStringFromName(entry.stringKey);
     }
   }
-};
\ No newline at end of file
+};
--- a/mail/app/profile/extensions/tbtestpilot@labs.mozilla.com/modules/lib/xhr.js
+++ b/mail/app/profile/extensions/tbtestpilot@labs.mozilla.com/modules/lib/xhr.js
@@ -90,17 +90,17 @@ XMLHttpRequest.prototype = {
     this._cleanup();
   },
   addEventListener: function addEventListener() {
     throw new Error("not implemented");
   },
   removeEventListener: function removeEventListener() {
     throw new Error("not implemented");
   },
-  set upload() {
+  set upload(ignored) {
     throw new Error("not implemented");
   },
   get onreadystatechange() {
     return this._orsc;
   },
   set onreadystatechange(cb) {
     this._orsc = cb;
     if (cb) {