Bug 1331467: Enable chrome.storage.sync by default, r?kmag
MozReview-Commit-ID: 76wXwJGobIt
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -5453,23 +5453,18 @@ pref("toolkit.pageThumbs.screenSizeDivis
pref("toolkit.pageThumbs.minWidth", 0);
pref("toolkit.pageThumbs.minHeight", 0);
pref("webextensions.tests", false);
// 16MB default non-parseable upload limit for requestBody.raw.bytes
pref("webextensions.webRequest.requestBodyMaxRawBytes", 16777216);
-// This functionality is still experimental
-pref("webextensions.storage.sync.enabled", false);
-#ifdef RELEASE_OR_BETA
+pref("webextensions.storage.sync.enabled", true);
pref("webextensions.storage.sync.serverURL", "https://webextensions.settings.services.mozilla.com/v1");
-#else
-pref("webextensions.storage.sync.serverURL", "https://webextensions.dev.mozaws.net/v1");
-#endif
// Allow customization of the fallback directory for file uploads
pref("dom.input.fallbackUploadDir", "");
// Turn rewriting of youtube embeds on/off
pref("plugins.rewrite_youtube_embeds", true);
// Don't hide Flash from navigator.plugins when it is click-to-activate
--- a/toolkit/components/extensions/ExtensionStorageSync.jsm
+++ b/toolkit/components/extensions/ExtensionStorageSync.jsm
@@ -14,18 +14,17 @@ this.EXPORTED_SYMBOLS = ["ExtensionStora
const Ci = Components.interfaces;
const Cc = Components.classes;
const Cu = Components.utils;
const Cr = Components.results;
const global = this;
Cu.import("resource://gre/modules/AppConstants.jsm");
const KINTO_PROD_SERVER_URL = "https://webextensions.settings.services.mozilla.com/v1";
-const KINTO_DEV_SERVER_URL = "https://webextensions.dev.mozaws.net/v1";
-const KINTO_DEFAULT_SERVER_URL = AppConstants.RELEASE_OR_BETA ? KINTO_PROD_SERVER_URL : KINTO_DEV_SERVER_URL;
+const KINTO_DEFAULT_SERVER_URL = KINTO_PROD_SERVER_URL;
const STORAGE_SYNC_ENABLED_PREF = "webextensions.storage.sync.enabled";
const STORAGE_SYNC_SERVER_URL_PREF = "webextensions.storage.sync.serverURL";
const STORAGE_SYNC_SCOPE = "sync:addon_storage";
const STORAGE_SYNC_CRYPTO_COLLECTION_NAME = "storage-sync-crypto";
const STORAGE_SYNC_CRYPTO_KEYRING_RECORD_ID = "keys";
const FXA_OAUTH_OPTIONS = {
scope: STORAGE_SYNC_SCOPE,
@@ -64,17 +63,17 @@ XPCOMUtils.defineLazyModuleGetter(this,
"resource://services-common/observers.js");
XPCOMUtils.defineLazyModuleGetter(this, "Sqlite",
"resource://gre/modules/Sqlite.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Task",
"resource://gre/modules/Task.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "KeyRingEncryptionRemoteTransformer",
"resource://services-sync/engines/extension-storage.js");
XPCOMUtils.defineLazyPreferenceGetter(this, "prefPermitsStorageSync",
- STORAGE_SYNC_ENABLED_PREF, false);
+ STORAGE_SYNC_ENABLED_PREF, true);
XPCOMUtils.defineLazyPreferenceGetter(this, "prefStorageSyncServerURL",
STORAGE_SYNC_SERVER_URL_PREF,
KINTO_DEFAULT_SERVER_URL);
/* globals prefPermitsStorageSync, prefStorageSyncServerURL */
// Map of Extensions to Set<Contexts> to track contexts that are still
// "live" and use storage.sync.
--- a/toolkit/components/extensions/test/mochitest/test_ext_storage_content.html
+++ b/toolkit/components/extensions/test/mochitest/test_ext_storage_content.html
@@ -289,16 +289,20 @@ add_task(function* test_local_cache_inva
yield extension.unload();
win.close();
});
add_task(function* test_config_flag_needed() {
let win = window.open("file_sample.html");
yield waitForLoad(win);
+ yield SpecialPowers.pushPrefEnv({
+ set: [[STORAGE_SYNC_PREF, false]],
+ });
+
function background() {
let promises = [];
let apiTests = [
{method: "get", args: ["foo"]},
{method: "set", args: [{foo: "bar"}]},
{method: "remove", args: ["foo"]},
{method: "clear", args: []},
];
--- a/toolkit/components/extensions/test/xpcshell/test_ext_storage.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_storage.js
@@ -87,27 +87,29 @@ add_task(function* test_config_flag_need
browser.storage.sync[testDef.method](...testDef.args),
"Please set webextensions.storage.sync.enabled to true in about:config",
`storage.sync.${testDef.method} is behind a flag`));
});
Promise.all(promises).then(() => browser.test.notifyPass("flag needed"));
}
+ Preferences.set(STORAGE_SYNC_PREF, false);
ok(!Preferences.get(STORAGE_SYNC_PREF));
let extension = ExtensionTestUtils.loadExtension({
manifest: {
permissions: ["storage"],
},
background: `(${background})(${checkGetImpl})`,
});
yield extension.startup();
yield extension.awaitFinish("flag needed");
yield extension.unload();
+ Preferences.reset(STORAGE_SYNC_PREF);
});
add_task(function* test_reloading_extensions_works() {
// Just some random extension ID that we can re-use
const extensionId = "my-extension-id@1";
function loadExtension() {
function background() {