Bug 670082 - Make sure Weave.Service is accessed prior to accessing Engines in Sync setup wizard. r=philikon
authorRichard Newman <rnewman@mozilla.com>
Fri, 02 Sep 2011 14:49:22 -0700
changeset 76742 ac2f7fe1b6bf301958501e2359248bd106d26bf0
parent 76741 7924c7d102ab9876c69b2747e0c82188f7e2e334
child 76743 f9a690b1bd21b496784e70b39bdb6b6a36e7dc37
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewersphilikon
bugs670082
milestone9.0a1
Bug 670082 - Make sure Weave.Service is accessed prior to accessing Engines in Sync setup wizard. r=philikon
browser/base/content/syncSetup.js
--- a/browser/base/content/syncSetup.js
+++ b/browser/base/content/syncSetup.js
@@ -108,16 +108,22 @@ var gSyncSetup = {
           Weave.Svc.Obs.add(topic, self[func], self);
         else
           Weave.Svc.Obs.remove(topic, self[func], self);
       });
     };
     addRem(true);
     window.addEventListener("unload", function() addRem(false), false);
 
+    window.setTimeout(function () {
+      // Force Service to be loaded so that engines are registered.
+      // See Bug 670082.
+      Weave.Service;
+    }, 0);
+
     this.captchaBrowser = document.getElementById("captcha");
     this.wizard = document.getElementById("accountSetup");
 
     if (window.arguments && window.arguments[0] == true) {
       // we're resetting sync
       this._resettingSync = true;
       this.wizard.pageIndex = OPTIONS_PAGE;
     }