Bug 956724 - Fix broken onload handler for DOMWindows r=rnewman
authorTim Taubert <ttaubert@mozilla.com>
Mon, 06 Jan 2014 16:23:40 +0100
changeset 162203 be6ad59e25f5c836e0697eeade989438eae49c78
parent 162202 1720e3409e728588a66de93ae820a938b739233d
child 162204 8cbf45406b3053d6234b9515e26ce5ab2d983f77
push id4198
push userttaubert@mozilla.com
push dateMon, 06 Jan 2014 23:52:04 +0000
treeherderfx-team@3f6e82f8f9f8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrnewman
bugs956724
milestone29.0a1
Bug 956724 - Fix broken onload handler for DOMWindows r=rnewman From fdb5e3aab7479a9cf0ff7b78dcd373e296707e56 Mon Sep 17 00:00:00 2001
services/sync/modules/engines/tabs.js
--- a/services/sync/modules/engines/tabs.js
+++ b/services/sync/modules/engines/tabs.js
@@ -299,22 +299,24 @@ TabTracker.prototype = {
     }
   },
 
   observe: function (subject, topic, data) {
     Tracker.prototype.observe.call(this, subject, topic, data);
 
     switch (topic) {
       case "domwindowopened":
-        // Add tab listeners now that a window has opened.
-        subject.addEventListener("load", (event) => {
+        let onLoad = () => {
           subject.removeEventListener("load", onLoad, false);
           // Only register after the window is done loading to avoid unloads.
           this._registerListenersForWindow(subject);
-        }, false);
+        };
+
+        // Add tab listeners now that a window has opened.
+        subject.addEventListener("load", onLoad, false);
         break;
     }
   },
 
   onTab: function onTab(event) {
     if (event.originalTarget.linkedBrowser) {
       let win = event.originalTarget.linkedBrowser.contentWindow;
       if (PrivateBrowsingUtils.isWindowPrivate(win) &&