diff --git a/mobile/app/profile/extensions/feedback@mobile.mozilla.org/content/content.js b/mobile/app/profile/extensions/feedback@mobile.mozilla.org/content/content.js index 27a2f20c578..0b684b0e716 100644 --- a/mobile/app/profile/extensions/feedback@mobile.mozilla.org/content/content.js +++ b/mobile/app/profile/extensions/feedback@mobile.mozilla.org/content/content.js @@ -1,14 +1,36 @@ function populateFeedback(aMessage) { - content.document.getElementById("id_url").value = aMessage.json.referrer; + let json = aMessage.json; - let device = content.document.getElementById("id_device"); - if (device) - device.value = aMessage.json.device || ""; + let referrer = json.referrer; + let URLElem = content.document.getElementById("id_url"); + if (URLElem) + URLElem.value = referrer; - let manufacturer = content.document.getElementById("id_manufacturer"); - if (manufacturer) - manufacturer.value = aMessage.json.manufacturer || ""; + let URLElems = content.document.getElementsByClassName("url"); + URLElems.forEach(function(aElement) { + aElement.value = referrer; + }); + + let device = json.device || ""; + let deviceElem = content.document.getElementById("id_device"); + if (deviceElem) + deviceElem.value = device; + + let deviceElems = content.document.getElementsByClassName("device"); + deviceElems.forEach(function(aElement) { + aElement.value = device; + }); + + let manufacturer = json.manufacturer || ""; + let manufacturerElem = content.document.getElementById("id_manufacturer"); + if (manufacturerElem) + manufacturerElem.value = manufacturer; + + let manufacturerElems = content.document.getElementsByClassName("manufacturer"); + manufacturerElems.forEach(function(aElement) { + aElement.value = manufacturer; + }); } addMessageListener("Feedback:InitPage", populateFeedback); diff --git a/mobile/app/profile/extensions/feedback@mobile.mozilla.org/content/overlay.js b/mobile/app/profile/extensions/feedback@mobile.mozilla.org/content/overlay.js index fe7ad2459b9..cf88401e3d1 100644 --- a/mobile/app/profile/extensions/feedback@mobile.mozilla.org/content/overlay.js +++ b/mobile/app/profile/extensions/feedback@mobile.mozilla.org/content/overlay.js @@ -41,14 +41,14 @@ var Feedback = { _manufacturer: "", init: function(aEvent) { - let appInfo = Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULAppInfo); - document.getElementById("feedback-about").setAttribute("desc", appInfo.version); - - // A simple frame script to fill in the referrer page and device info - messageManager.loadFrameScript("chrome://feedback/content/content.js", true); - // Delay the widget initialization during startup. window.addEventListener("UIReadyDelayed", function(aEvent) { + let appInfo = Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULAppInfo); + document.getElementById("feedback-about").setAttribute("desc", appInfo.version); + + // A simple frame script to fill in the referrer page and device info + messageManager.loadFrameScript("chrome://feedback/content/content.js", true); + window.removeEventListener(aEvent.type, arguments.callee, false); document.getElementById("feedback-container").hidden = false;