Bug 1053458 - Ignore failures sending Browser:Init message (r=felipe)
authorBill McCloskey <wmccloskey@mozilla.com>
Tue, 19 Aug 2014 15:48:58 -0700
changeset 200468 5e4e1eb46d52ddc5b094c40df1f8b818ce356fad
parent 200467 7d959a7a6f54bb6eb1001f8f3c50af065b429f20
child 200469 6e84c39a1420d3d2b9569df9d41ab4df947e69b6
push id27345
push useremorley@mozilla.com
push dateWed, 20 Aug 2014 13:28:47 +0000
treeherdermozilla-central@1ddfd9afba40 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfelipe
bugs1053458
milestone34.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 1053458 - Ignore failures sending Browser:Init message (r=felipe)
toolkit/content/browser-child.js
--- a/toolkit/content/browser-child.js
+++ b/toolkit/content/browser-child.js
@@ -429,13 +429,17 @@ let AutoCompletePopup = {
   selectBy: function(reverse, page) {
     this._index = sendSyncMessage("FormAutoComplete:SelectBy", {
       reverse: reverse,
       page: page
     });
   }
 }
 
-let [initData] = sendSyncMessage("Browser:Init");
-docShell.useGlobalHistory = initData.useGlobalHistory;
-if (initData.initPopup) {
-  setTimeout(function() AutoCompletePopup.init(), 0);
+// We may not get any responses to Browser:Init if the browser element
+// is torn down too quickly.
+let initData = sendSyncMessage("Browser:Init");
+if (initData.length) {
+  docShell.useGlobalHistory = initData[0].useGlobalHistory;
+  if (initData[0].initPopup) {
+    setTimeout(() => AutoCompletePopup.init(), 0);
+  }
 }