Bug 640969 - JavaScript error: chrome://browser/content/bindings.xml, line 474: Weave is not defined [r=mfinkle]
authorVivien Nicolas <21@vingtetun.org>
Fri, 25 Mar 2011 10:33:45 +0100
changeset 67539 5ea6b5645d91fe81f35a1f71c2345f0b5a5a8b66
parent 67538 f1d32995682c8df2b3741cc0475ad0bcda070e11
child 67540 54f24b529eefa5f475ab0de97fb0a634d34095ba
push id19389
push userffxbld
push dateWed, 06 Apr 2011 21:33:21 +0000
treeherdermozilla-central@8e9f90073a20 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs640969
Bug 640969 - JavaScript error: chrome://browser/content/bindings.xml, line 474: Weave is not defined [r=mfinkle]
mobile/chrome/content/browser-scripts.js
mobile/chrome/content/sync.js
--- a/mobile/chrome/content/browser-scripts.js
+++ b/mobile/chrome/content/browser-scripts.js
@@ -112,16 +112,23 @@ XPCOMUtils.defineLazyGetter(this, "Commo
   let [name, script] = aScript;
   XPCOMUtils.defineLazyGetter(window, name, function() {
     let sandbox = {};
     Services.scriptloader.loadSubScript(script, sandbox);
     return sandbox[name];
   });
 });
 
+#ifdef MOZ_SERVICES_SYNC
+XPCOMUtils.defineLazyGetter(this, "Weave", function() {
+  Components.utils.import("resource://services-sync/main.js");
+  return Weave;
+});
+#endif
+
 /**
  * Delay load some global scripts using a custom namespace
  */
 XPCOMUtils.defineLazyGetter(this, "GlobalOverlay", function() {
   let GlobalOverlay = {};
   Services.scriptloader.loadSubScript("chrome://global/content/globalOverlay.js", GlobalOverlay);
   return GlobalOverlay;
 });
--- a/mobile/chrome/content/sync.js
+++ b/mobile/chrome/content/sync.js
@@ -37,18 +37,16 @@
  * ***** END LICENSE BLOCK ***** */
 
 let WeaveGlue = {
   setupData: null,
   autoConnect: false,
   jpake: null,
 
   init: function init() {
-    Components.utils.import("resource://services-sync/main.js");
-
     this._bundle = Services.strings.createBundle("chrome://browser/locale/sync.properties");
     this._msg = document.getElementById("prefs-messages");
 
     this._addListeners();
 
     this.setupData = { account: "", password: "" , synckey: "", serverURL: "" };
 
     let enableSync = Services.prefs.getBoolPref("browser.sync.enabled");