Bug 640969 - JavaScript error: chrome://browser/content/bindings.xml, line 474: Weave is not defined [r=mfinkle]
--- 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");