summaryrefslogtreecommitdiffstats
path: root/services/sync/Weave.js
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-10-06 06:57:51 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-10-06 06:57:51 +0200
commit0c47c83e1b3b7d95681a43fbb0de0e17b2cd5b25 (patch)
treec321601f04cbfd02fb6e12878e745dc49a612c86 /services/sync/Weave.js
parent8860eddcee1417483cafd114f3a9ec127e0f1f74 (diff)
downloadUXP-0c47c83e1b3b7d95681a43fbb0de0e17b2cd5b25.tar
UXP-0c47c83e1b3b7d95681a43fbb0de0e17b2cd5b25.tar.gz
UXP-0c47c83e1b3b7d95681a43fbb0de0e17b2cd5b25.tar.lz
UXP-0c47c83e1b3b7d95681a43fbb0de0e17b2cd5b25.tar.xz
UXP-0c47c83e1b3b7d95681a43fbb0de0e17b2cd5b25.zip
Import Tycho weave client
Diffstat (limited to 'services/sync/Weave.js')
-rw-r--r--services/sync/Weave.js25
1 files changed, 16 insertions, 9 deletions
diff --git a/services/sync/Weave.js b/services/sync/Weave.js
index de131d08a..d99c217c0 100644
--- a/services/sync/Weave.js
+++ b/services/sync/Weave.js
@@ -72,6 +72,13 @@ WeaveService.prototype = {
Ci.nsISupportsWeakReference]),
ensureLoaded: function () {
+ // XXX: We don't support FxA, so prevent migrator calls
+ // to the Sync server from this module! Don't load it.
+ // If we are loaded and not using FxA, load the migration module.
+ //if (!this.fxAccountsEnabled) {
+ // Cu.import("resource://services-sync/FxaMigrator.jsm");
+ //}
+
Components.utils.import("resource://services-sync/main.js");
// Side-effect of accessing the service is that it is instantiated.
@@ -96,11 +103,14 @@ WeaveService.prototype = {
* Whether Firefox Accounts is enabled.
*
* @return bool
+ *
+ * This function is currently always returning false because we don't support
+ * the use of FxA/Sync-1.5 but do want to keep the code "just in case".
*/
get fxAccountsEnabled() {
-#ifdef MC_PALEMOON
+ // Early exit: FxA not supported.
return false;
-#else
+
try {
// Old sync guarantees '@' will never appear in the username while FxA
// uses the FxA email address - so '@' is the flag we use.
@@ -109,7 +119,6 @@ WeaveService.prototype = {
} catch (_) {
return true; // No username == only allow FxA to be configured.
}
-#endif
},
/**
@@ -123,7 +132,8 @@ WeaveService.prototype = {
*/
get enabled() {
let prefs = Services.prefs.getBranch(SYNC_PREFS_BRANCH);
- return prefs.prefHasUserValue("username");
+ return prefs.prefHasUserValue("username") &&
+ prefs.prefHasUserValue("clusterURL");
},
observe: function (subject, topic, data) {
@@ -183,13 +193,10 @@ AboutWeaveLog.prototype = {
channel.originalURI = aURI;
// Ensure that the about page has the same privileges as a regular directory
- // view. That way links to files can be opened. make sure we use the correct
- // origin attributes when creating the principal for accessing the
- // about:sync-log data.
+ // view. That way links to files can be opened.
let ssm = Cc["@mozilla.org/scriptsecuritymanager;1"]
.getService(Ci.nsIScriptSecurityManager);
- let principal = ssm.createCodebasePrincipal(uri, aLoadInfo.originAttributes);
-
+ let principal = ssm.getNoAppCodebasePrincipal(uri);
channel.owner = principal;
return channel;
}