Bug 596323 - Try delay loading the feedback UI to improve startup time [r=mbrubeck]
--- a/mobile/app/profile/extensions/feedback@mobile.mozilla.org/content/overlay.js
+++ b/mobile/app/profile/extensions/feedback@mobile.mozilla.org/content/overlay.js
@@ -34,16 +34,25 @@
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
var Feedback = {
init: function(aEvent) {
let appInfo = Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULAppInfo);
document.getElementById("feedback-about").setAttribute("desc", appInfo.version);
+
+ // Try to delay the widget initialization during startup
+ messageManager.addMessageListener("DOMContentLoaded", function() {
+ // We only want to delay one time
+ messageManager.removeMessageListener("DOMContentLoaded", arguments.callee, true);
+
+ // We unhide the panelUI so the XBL and settings can initialize
+ document.getElementById("feedback-container").hidden = false;
+ });
},
openReadme: function() {
let formatter = Cc["@mozilla.org/toolkit/URLFormatterService;1"].getService(Ci.nsIURLFormatter);
let url = formatter.formatURLPref("app.releaseNotesURL");
BrowserUI.newTab(url);
},
--- a/mobile/app/profile/extensions/feedback@mobile.mozilla.org/content/overlay.xul
+++ b/mobile/app/profile/extensions/feedback@mobile.mozilla.org/content/overlay.xul
@@ -47,17 +47,17 @@
<overlay id="feedback-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/javascript" src="chrome://feedback/content/overlay.js"/>
<box id="panel-controls">
<toolbarbutton id="tool-feedback" autocheck="true" type="radio" group="1" class="panel-button button-dark" linkedpanel="feedback-container" insertbefore="tool-addons"/>
</box>
<deck id="panel-items">
- <vbox id="feedback-container" flex="1">
+ <vbox id="feedback-container" flex="1" hidden="true">
<hbox id="feedback-header" class="panel-header">
<label value="&feedbackHeader.label;" flex="1"/>
</hbox>
<notificationbox id="feedback-messages" flex="1">
<richlistbox id="feedback-list" flex="1" onselect="this.ensureSelectedElementIsVisible()">
<settings id="feedback-communicate" label="&feedback.communicate.title;">
<setting title="&feedback.feedback.title;" type="control">
<button id="feedback-feedback-happy" class="button-dark" oncommand="BrowserUI.newTab('http://m.input.mozilla.com/en-US/happy');"/>