Backed out 6 changesets (bug 1816934, bug 1817182, bug 1817179, bug 1817183) for causing dt failures in browser_jsterm_autocomplete_null.js CLOSED TREE

Backed out changeset 17d4c013ed92 (bug 1817183)
Backed out changeset cfed8d9c23f3 (bug 1817183)
Backed out changeset 62fe2f589efe (bug 1817182)
Backed out changeset 557bd773fb85 (bug 1817179)
Backed out changeset 7f8a7865868b (bug 1816934)
Backed out changeset d6c1d4c0d2a0 (bug 1816934)
This commit is contained in:
Cristian Tuns 2023-02-17 10:51:33 -05:00
parent b68aa6d75c
commit b3bf09cc0d
179 changed files with 770 additions and 544 deletions

View file

@ -183,7 +183,7 @@ services/common/kinto-http-client.js
services/common/kinto-offline-client.js services/common/kinto-offline-client.js
# Webpack-bundled library # Webpack-bundled library
services/fxaccounts/FxAccountsPairingChannel.sys.mjs services/fxaccounts/FxAccountsPairingChannel.js
# Servo is imported. # Servo is imported.
servo/ servo/

View file

@ -21,8 +21,8 @@ XPCOMUtils.defineLazyModuleGetters(lazy, {
}); });
XPCOMUtils.defineLazyGetter(lazy, "fxAccounts", () => { XPCOMUtils.defineLazyGetter(lazy, "fxAccounts", () => {
return ChromeUtils.importESModule( return ChromeUtils.import(
"resource://gre/modules/FxAccounts.sys.mjs" "resource://gre/modules/FxAccounts.jsm"
).getFxAccountsSingleton(); ).getFxAccountsSingleton();
}); });

View file

@ -9,10 +9,17 @@ const { UIState } = ChromeUtils.importESModule(
"resource://services-sync/UIState.sys.mjs" "resource://services-sync/UIState.sys.mjs"
); );
ChromeUtils.defineModuleGetter(
this,
"FxAccounts",
"resource://gre/modules/FxAccounts.jsm"
);
ChromeUtils.defineModuleGetter(
this,
"EnsureFxAccountsWebChannel",
"resource://gre/modules/FxAccountsWebChannel.jsm"
);
ChromeUtils.defineESModuleGetters(this, { ChromeUtils.defineESModuleGetters(this, {
EnsureFxAccountsWebChannel:
"resource://gre/modules/FxAccountsWebChannel.sys.mjs",
FxAccounts: "resource://gre/modules/FxAccounts.sys.mjs",
SyncedTabs: "resource://services-sync/SyncedTabs.sys.mjs", SyncedTabs: "resource://services-sync/SyncedTabs.sys.mjs",
Weave: "resource://services-sync/main.sys.mjs", Weave: "resource://services-sync/main.sys.mjs",
}); });

View file

@ -104,8 +104,8 @@ XPCOMUtils.defineLazyModuleGetters(this, {
}); });
XPCOMUtils.defineLazyGetter(this, "fxAccounts", () => { XPCOMUtils.defineLazyGetter(this, "fxAccounts", () => {
return ChromeUtils.importESModule( return ChromeUtils.import(
"resource://gre/modules/FxAccounts.sys.mjs" "resource://gre/modules/FxAccounts.jsm"
).getFxAccountsSingleton(); ).getFxAccountsSingleton();
}); });

View file

@ -83,8 +83,8 @@ const startupPhases = {
"resource://gre/modules/BookmarkHTMLUtils.sys.mjs", "resource://gre/modules/BookmarkHTMLUtils.sys.mjs",
"resource://gre/modules/Bookmarks.sys.mjs", "resource://gre/modules/Bookmarks.sys.mjs",
"resource://gre/modules/ContextualIdentityService.sys.mjs", "resource://gre/modules/ContextualIdentityService.sys.mjs",
"resource://gre/modules/FxAccounts.sys.mjs", "resource://gre/modules/FxAccounts.jsm",
"resource://gre/modules/FxAccountsStorage.sys.mjs", "resource://gre/modules/FxAccountsStorage.jsm",
"resource://gre/modules/PlacesBackups.sys.mjs", "resource://gre/modules/PlacesBackups.sys.mjs",
"resource://gre/modules/PlacesExpiration.sys.mjs", "resource://gre/modules/PlacesExpiration.sys.mjs",
"resource://gre/modules/PlacesSyncUtils.sys.mjs", "resource://gre/modules/PlacesSyncUtils.sys.mjs",

View file

@ -10,8 +10,8 @@ ChromeUtils.defineESModuleGetters(this, {
WebChannel: "resource://gre/modules/WebChannel.sys.mjs", WebChannel: "resource://gre/modules/WebChannel.sys.mjs",
}); });
var { FxAccountsWebChannel } = ChromeUtils.importESModule( var { FxAccountsWebChannel } = ChromeUtils.import(
"resource://gre/modules/FxAccountsWebChannel.sys.mjs" "resource://gre/modules/FxAccountsWebChannel.jsm"
); );
// eslint-disable-next-line @microsoft/sdl/no-insecure-url // eslint-disable-next-line @microsoft/sdl/no-insecure-url

View file

@ -27,7 +27,6 @@ ChromeUtils.defineESModuleGetters(lazy, {
"resource:///modules/DownloadsViewableInternally.sys.mjs", "resource:///modules/DownloadsViewableInternally.sys.mjs",
E10SUtils: "resource://gre/modules/E10SUtils.sys.mjs", E10SUtils: "resource://gre/modules/E10SUtils.sys.mjs",
FxAccounts: "resource://gre/modules/FxAccounts.sys.mjs",
Integration: "resource://gre/modules/Integration.sys.mjs", Integration: "resource://gre/modules/Integration.sys.mjs",
Interactions: "resource:///modules/Interactions.sys.mjs", Interactions: "resource:///modules/Interactions.sys.mjs",
Log: "resource://gre/modules/Log.sys.mjs", Log: "resource://gre/modules/Log.sys.mjs",
@ -42,7 +41,6 @@ ChromeUtils.defineESModuleGetters(lazy, {
PlacesUtils: "resource://gre/modules/PlacesUtils.sys.mjs", PlacesUtils: "resource://gre/modules/PlacesUtils.sys.mjs",
PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs", PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs",
QuickSuggest: "resource:///modules/QuickSuggest.sys.mjs", QuickSuggest: "resource:///modules/QuickSuggest.sys.mjs",
RemoteSettings: "resource://services-settings/remote-settings.sys.mjs",
ScreenshotsUtils: "resource:///modules/ScreenshotsUtils.sys.mjs", ScreenshotsUtils: "resource:///modules/ScreenshotsUtils.sys.mjs",
SearchSERPTelemetry: "resource:///modules/SearchSERPTelemetry.sys.mjs", SearchSERPTelemetry: "resource:///modules/SearchSERPTelemetry.sys.mjs",
SessionStartup: "resource:///modules/sessionstore/SessionStartup.sys.mjs", SessionStartup: "resource:///modules/sessionstore/SessionStartup.sys.mjs",
@ -76,6 +74,7 @@ XPCOMUtils.defineLazyModuleGetters(lazy, {
ExperimentAPI: "resource://nimbus/ExperimentAPI.jsm", ExperimentAPI: "resource://nimbus/ExperimentAPI.jsm",
ExtensionsUI: "resource:///modules/ExtensionsUI.jsm", ExtensionsUI: "resource:///modules/ExtensionsUI.jsm",
FeatureGate: "resource://featuregates/FeatureGate.jsm", FeatureGate: "resource://featuregates/FeatureGate.jsm",
FxAccounts: "resource://gre/modules/FxAccounts.jsm",
HomePage: "resource:///modules/HomePage.jsm", HomePage: "resource:///modules/HomePage.jsm",
NetUtil: "resource://gre/modules/NetUtil.jsm", NetUtil: "resource://gre/modules/NetUtil.jsm",
NimbusFeatures: "resource://nimbus/ExperimentAPI.jsm", NimbusFeatures: "resource://nimbus/ExperimentAPI.jsm",
@ -90,6 +89,7 @@ XPCOMUtils.defineLazyModuleGetters(lazy, {
PluralForm: "resource://gre/modules/PluralForm.jsm", PluralForm: "resource://gre/modules/PluralForm.jsm",
ProcessHangMonitor: "resource:///modules/ProcessHangMonitor.jsm", ProcessHangMonitor: "resource:///modules/ProcessHangMonitor.jsm",
PublicSuffixList: "resource://gre/modules/netwerk-dns/PublicSuffixList.jsm", PublicSuffixList: "resource://gre/modules/netwerk-dns/PublicSuffixList.jsm",
RemoteSettings: "resource://services-settings/remote-settings.js",
RemoteSecuritySettings: RemoteSecuritySettings:
"resource://gre/modules/psm/RemoteSecuritySettings.jsm", "resource://gre/modules/psm/RemoteSecuritySettings.jsm",

View file

@ -11,14 +11,10 @@ import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
const lazy = {}; const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
RemoteSettings: "resource://services-settings/remote-settings.sys.mjs",
RemoteSettingsClient:
"resource://services-settings/RemoteSettingsClient.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, { XPCOMUtils.defineLazyModuleGetters(lazy, {
LoginHelper: "resource://gre/modules/LoginHelper.jsm", LoginHelper: "resource://gre/modules/LoginHelper.jsm",
RemoteSettings: "resource://services-settings/remote-settings.js",
RemoteSettingsClient: "resource://services-settings/RemoteSettingsClient.jsm",
}); });
export const LoginBreaches = { export const LoginBreaches = {

View file

@ -4,8 +4,8 @@
let { LoginBreaches } = ChromeUtils.importESModule( let { LoginBreaches } = ChromeUtils.importESModule(
"resource:///modules/LoginBreaches.sys.mjs" "resource:///modules/LoginBreaches.sys.mjs"
); );
let { RemoteSettings } = ChromeUtils.importESModule( let { RemoteSettings } = ChromeUtils.import(
"resource://services-settings/remote-settings.sys.mjs" "resource://services-settings/remote-settings.js"
); );
let { _AboutLogins } = ChromeUtils.importESModule( let { _AboutLogins } = ChromeUtils.importESModule(
"resource:///actors/AboutLoginsParent.sys.mjs" "resource:///actors/AboutLoginsParent.sys.mjs"

View file

@ -4,8 +4,8 @@
"use strict"; "use strict";
const { RemoteSettings } = ChromeUtils.importESModule( const { RemoteSettings } = ChromeUtils.import(
"resource://services-settings/remote-settings.sys.mjs" "resource://services-settings/remote-settings.js"
); );
// Initializing BrowserGlue requires a profile on Windows. // Initializing BrowserGlue requires a profile on Windows.

View file

@ -6,8 +6,8 @@
requestLongerTimeout(2); requestLongerTimeout(2);
const { FxAccounts } = ChromeUtils.importESModule( const { FxAccounts } = ChromeUtils.import(
"resource://gre/modules/FxAccounts.sys.mjs" "resource://gre/modules/FxAccounts.jsm"
); );
let { SyncedTabs } = ChromeUtils.importESModule( let { SyncedTabs } = ChromeUtils.importESModule(
"resource://services-sync/SyncedTabs.sys.mjs" "resource://services-sync/SyncedTabs.sys.mjs"

View file

@ -8,8 +8,9 @@
* sourced from either Remote Settings or pref values, with Remote Settings * sourced from either Remote Settings or pref values, with Remote Settings
* being preferred. * being preferred.
*/ */
const { RemoteSettings } = ChromeUtils.import(
import { RemoteSettings } from "resource://services-settings/remote-settings.sys.mjs"; "resource://services-settings/remote-settings.js"
);
const lazy = {}; const lazy = {};

View file

@ -4,8 +4,13 @@
const lazy = {}; const lazy = {};
ChromeUtils.defineModuleGetter(
lazy,
"RemoteSettings",
"resource://services-settings/remote-settings.js"
);
ChromeUtils.defineESModuleGetters(lazy, { ChromeUtils.defineESModuleGetters(lazy, {
RemoteSettings: "resource://services-settings/remote-settings.sys.mjs",
TestUtils: "resource://testing-common/TestUtils.sys.mjs", TestUtils: "resource://testing-common/TestUtils.sys.mjs",
}); });

View file

@ -7,11 +7,11 @@ ChromeUtils.defineESModuleGetters(this, {
Preferences: "resource://gre/modules/Preferences.sys.mjs", Preferences: "resource://gre/modules/Preferences.sys.mjs",
Region: "resource://gre/modules/Region.sys.mjs", Region: "resource://gre/modules/Region.sys.mjs",
RegionTestUtils: "resource://testing-common/RegionTestUtils.sys.mjs", RegionTestUtils: "resource://testing-common/RegionTestUtils.sys.mjs",
RemoteSettings: "resource://services-settings/remote-settings.sys.mjs",
}); });
XPCOMUtils.defineLazyModuleGetters(this, { XPCOMUtils.defineLazyModuleGetters(this, {
ASRouter: "resource://activity-stream/lib/ASRouter.jsm", ASRouter: "resource://activity-stream/lib/ASRouter.jsm",
RemoteSettings: "resource://services-settings/remote-settings.js",
}); });
XPCOMUtils.defineLazyServiceGetter( XPCOMUtils.defineLazyServiceGetter(

View file

@ -7,12 +7,12 @@ const { AddonTestUtils } = ChromeUtils.import(
); );
ChromeUtils.defineESModuleGetters(this, { ChromeUtils.defineESModuleGetters(this, {
RemoteSettings: "resource://services-settings/remote-settings.sys.mjs",
TelemetryTestUtils: "resource://testing-common/TelemetryTestUtils.sys.mjs", TelemetryTestUtils: "resource://testing-common/TelemetryTestUtils.sys.mjs",
}); });
XPCOMUtils.defineLazyModuleGetters(this, { XPCOMUtils.defineLazyModuleGetters(this, {
HomePage: "resource:///modules/HomePage.jsm", HomePage: "resource:///modules/HomePage.jsm",
RemoteSettings: "resource://services-settings/remote-settings.js",
sinon: "resource://testing-common/Sinon.jsm", sinon: "resource://testing-common/Sinon.jsm",
}); });

View file

@ -8,12 +8,12 @@ const { AddonTestUtils } = ChromeUtils.import(
ChromeUtils.defineESModuleGetters(this, { ChromeUtils.defineESModuleGetters(this, {
PromiseUtils: "resource://gre/modules/PromiseUtils.sys.mjs", PromiseUtils: "resource://gre/modules/PromiseUtils.sys.mjs",
RemoteSettings: "resource://services-settings/remote-settings.sys.mjs",
}); });
XPCOMUtils.defineLazyModuleGetters(this, { XPCOMUtils.defineLazyModuleGetters(this, {
AddonManager: "resource://gre/modules/AddonManager.jsm", AddonManager: "resource://gre/modules/AddonManager.jsm",
HomePage: "resource:///modules/HomePage.jsm", HomePage: "resource:///modules/HomePage.jsm",
RemoteSettings: "resource://services-settings/remote-settings.js",
sinon: "resource://testing-common/Sinon.jsm", sinon: "resource://testing-common/Sinon.jsm",
}); });

View file

@ -15,8 +15,8 @@ const { SearchUtils } = ChromeUtils.importESModule(
"resource://gre/modules/SearchUtils.sys.mjs" "resource://gre/modules/SearchUtils.sys.mjs"
); );
const { RemoteSettings } = ChromeUtils.importESModule( const { RemoteSettings } = ChromeUtils.import(
"resource://services-settings/remote-settings.sys.mjs" "resource://services-settings/remote-settings.js"
); );
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm"); const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");

View file

@ -24,8 +24,8 @@ XPCOMUtils.defineLazyGetter(lazy, "syncUtils", () => {
}); });
XPCOMUtils.defineLazyGetter(lazy, "fxAccounts", () => { XPCOMUtils.defineLazyGetter(lazy, "fxAccounts", () => {
return ChromeUtils.importESModule( return ChromeUtils.import(
"resource://gre/modules/FxAccounts.sys.mjs" "resource://gre/modules/FxAccounts.jsm"
).getFxAccountsSingleton(); ).getFxAccountsSingleton();
}); });

View file

@ -15,8 +15,8 @@ const { AddonManager } = ChromeUtils.import(
"resource://gre/modules/AddonManager.jsm" "resource://gre/modules/AddonManager.jsm"
); );
const { RemoteSettings } = ChromeUtils.importESModule( const { RemoteSettings } = ChromeUtils.import(
"resource://services-settings/remote-settings.sys.mjs" "resource://services-settings/remote-settings.js"
); );
const { TelemetryController } = ChromeUtils.importESModule( const { TelemetryController } = ChromeUtils.importESModule(

View file

@ -15,13 +15,13 @@ const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, { ChromeUtils.defineESModuleGetters(lazy, {
BrowserUtils: "resource://gre/modules/BrowserUtils.sys.mjs", BrowserUtils: "resource://gre/modules/BrowserUtils.sys.mjs",
BuiltInThemes: "resource:///modules/BuiltInThemes.sys.mjs", BuiltInThemes: "resource:///modules/BuiltInThemes.sys.mjs",
FxAccounts: "resource://gre/modules/FxAccounts.sys.mjs",
PromiseUtils: "resource://gre/modules/PromiseUtils.sys.mjs", PromiseUtils: "resource://gre/modules/PromiseUtils.sys.mjs",
Region: "resource://gre/modules/Region.sys.mjs", Region: "resource://gre/modules/Region.sys.mjs",
}); });
XPCOMUtils.defineLazyModuleGetters(lazy, { XPCOMUtils.defineLazyModuleGetters(lazy, {
AddonManager: "resource://gre/modules/AddonManager.jsm", AddonManager: "resource://gre/modules/AddonManager.jsm",
FxAccounts: "resource://gre/modules/FxAccounts.jsm",
MigrationUtils: "resource:///modules/MigrationUtils.jsm", MigrationUtils: "resource:///modules/MigrationUtils.jsm",
SpecialMessageActions: SpecialMessageActions:
"resource://messaging-system/lib/SpecialMessageActions.jsm", "resource://messaging-system/lib/SpecialMessageActions.jsm",

View file

@ -11,12 +11,6 @@ const { AppConstants } = ChromeUtils.importESModule(
"resource://gre/modules/AppConstants.sys.mjs" "resource://gre/modules/AppConstants.sys.mjs"
); );
const lazy = {}; const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
Downloader: "resource://services-settings/Attachments.sys.mjs",
MacAttribution: "resource:///modules/MacAttribution.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, { XPCOMUtils.defineLazyModuleGetters(lazy, {
SnippetsTestMessageProvider: SnippetsTestMessageProvider:
"resource://activity-stream/lib/SnippetsTestMessageProvider.jsm", "resource://activity-stream/lib/SnippetsTestMessageProvider.jsm",
@ -34,6 +28,7 @@ XPCOMUtils.defineLazyModuleGetters(lazy, {
ASRouterTriggerListeners: ASRouterTriggerListeners:
"resource://activity-stream/lib/ASRouterTriggerListeners.jsm", "resource://activity-stream/lib/ASRouterTriggerListeners.jsm",
KintoHttpClient: "resource://services-common/kinto-http-client.js", KintoHttpClient: "resource://services-common/kinto-http-client.js",
Downloader: "resource://services-settings/Attachments.jsm",
RemoteImages: "resource://activity-stream/lib/RemoteImages.jsm", RemoteImages: "resource://activity-stream/lib/RemoteImages.jsm",
RemoteL10n: "resource://activity-stream/lib/RemoteL10n.jsm", RemoteL10n: "resource://activity-stream/lib/RemoteL10n.jsm",
ExperimentAPI: "resource://nimbus/ExperimentAPI.jsm", ExperimentAPI: "resource://nimbus/ExperimentAPI.jsm",
@ -44,6 +39,9 @@ XPCOMUtils.defineLazyModuleGetters(lazy, {
TargetingContext: "resource://messaging-system/targeting/Targeting.jsm", TargetingContext: "resource://messaging-system/targeting/Targeting.jsm",
Utils: "resource://services-settings/Utils.jsm", Utils: "resource://services-settings/Utils.jsm",
}); });
ChromeUtils.defineESModuleGetters(lazy, {
MacAttribution: "resource:///modules/MacAttribution.sys.mjs",
});
XPCOMUtils.defineLazyServiceGetters(lazy, { XPCOMUtils.defineLazyServiceGetters(lazy, {
BrowserHandler: ["@mozilla.org/browser/clh;1", "nsIBrowserHandler"], BrowserHandler: ["@mozilla.org/browser/clh;1", "nsIBrowserHandler"],
}); });
@ -57,8 +55,8 @@ const { CFRMessageProvider } = ChromeUtils.import(
const { OnboardingMessageProvider } = ChromeUtils.import( const { OnboardingMessageProvider } = ChromeUtils.import(
"resource://activity-stream/lib/OnboardingMessageProvider.jsm" "resource://activity-stream/lib/OnboardingMessageProvider.jsm"
); );
const { RemoteSettings } = ChromeUtils.importESModule( const { RemoteSettings } = ChromeUtils.import(
"resource://services-settings/remote-settings.sys.mjs" "resource://services-settings/remote-settings.js"
); );
const { CFRPageActions } = ChromeUtils.import( const { CFRPageActions } = ChromeUtils.import(
"resource://activity-stream/lib/CFRPageActions.jsm" "resource://activity-stream/lib/CFRPageActions.jsm"

View file

@ -48,8 +48,8 @@ ChromeUtils.defineModuleGetter(
); );
XPCOMUtils.defineLazyGetter(lazy, "fxAccounts", () => { XPCOMUtils.defineLazyGetter(lazy, "fxAccounts", () => {
return ChromeUtils.importESModule( return ChromeUtils.import(
"resource://gre/modules/FxAccounts.sys.mjs" "resource://gre/modules/FxAccounts.jsm"
).getFxAccountsSingleton(); ).getFxAccountsSingleton();
}); });

View file

@ -7,8 +7,12 @@ const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, { ChromeUtils.defineESModuleGetters(lazy, {
NewTabUtils: "resource://gre/modules/NewTabUtils.sys.mjs", NewTabUtils: "resource://gre/modules/NewTabUtils.sys.mjs",
Region: "resource://gre/modules/Region.sys.mjs", Region: "resource://gre/modules/Region.sys.mjs",
RemoteSettings: "resource://services-settings/remote-settings.sys.mjs",
}); });
ChromeUtils.defineModuleGetter(
lazy,
"RemoteSettings",
"resource://services-settings/remote-settings.js"
);
ChromeUtils.defineModuleGetter( ChromeUtils.defineModuleGetter(
lazy, lazy,
"pktApi", "pktApi",

View file

@ -9,8 +9,8 @@ const { actionTypes: at } = ChromeUtils.importESModule(
const { getDomain } = ChromeUtils.import( const { getDomain } = ChromeUtils.import(
"resource://activity-stream/lib/TippyTopProvider.jsm" "resource://activity-stream/lib/TippyTopProvider.jsm"
); );
const { RemoteSettings } = ChromeUtils.importESModule( const { RemoteSettings } = ChromeUtils.import(
"resource://services-settings/remote-settings.sys.mjs" "resource://services-settings/remote-settings.js"
); );
const lazy = {}; const lazy = {};

View file

@ -5,10 +5,11 @@
const lazy = {}; const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, { ChromeUtils.defineModuleGetter(
NewTabUtils: "resource://gre/modules/NewTabUtils.sys.mjs", lazy,
RemoteSettings: "resource://services-settings/remote-settings.sys.mjs", "RemoteSettings",
}); "resource://services-settings/remote-settings.js"
);
ChromeUtils.defineModuleGetter( ChromeUtils.defineModuleGetter(
lazy, lazy,
@ -16,6 +17,10 @@ ChromeUtils.defineModuleGetter(
"resource://services-settings/Utils.jsm" "resource://services-settings/Utils.jsm"
); );
ChromeUtils.defineESModuleGetters(lazy, {
NewTabUtils: "resource://gre/modules/NewTabUtils.sys.mjs",
});
const { BasePromiseWorker } = ChromeUtils.import( const { BasePromiseWorker } = ChromeUtils.import(
"resource://gre/modules/PromiseWorker.jsm" "resource://gre/modules/PromiseWorker.jsm"
); );

View file

@ -9,15 +9,17 @@ const { JSONFile } = ChromeUtils.importESModule(
const { PromiseUtils } = ChromeUtils.importESModule( const { PromiseUtils } = ChromeUtils.importESModule(
"resource://gre/modules/PromiseUtils.sys.mjs" "resource://gre/modules/PromiseUtils.sys.mjs"
); );
const { RemoteSettings } = ChromeUtils.importESModule( const { RemoteSettings } = ChromeUtils.import(
"resource://services-settings/remote-settings.sys.mjs" "resource://services-settings/remote-settings.js"
); );
const lazy = {}; const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, { ChromeUtils.defineModuleGetter(
Downloader: "resource://services-settings/Attachments.sys.mjs", lazy,
}); "Downloader",
"resource://services-settings/Attachments.jsm"
);
ChromeUtils.defineModuleGetter( ChromeUtils.defineModuleGetter(
lazy, lazy,

View file

@ -3,8 +3,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; "use strict";
const { RemoteSettings } = ChromeUtils.importESModule( const { RemoteSettings } = ChromeUtils.import(
"resource://services-settings/remote-settings.sys.mjs" "resource://services-settings/remote-settings.js"
); );
// Returns whether the passed in params match the criteria. // Returns whether the passed in params match the criteria.

View file

@ -53,7 +53,6 @@ ChromeUtils.defineModuleGetter(
ChromeUtils.defineESModuleGetters(lazy, { ChromeUtils.defineESModuleGetters(lazy, {
NewTabUtils: "resource://gre/modules/NewTabUtils.sys.mjs", NewTabUtils: "resource://gre/modules/NewTabUtils.sys.mjs",
Region: "resource://gre/modules/Region.sys.mjs", Region: "resource://gre/modules/Region.sys.mjs",
RemoteSettings: "resource://services-settings/remote-settings.sys.mjs",
}); });
ChromeUtils.defineModuleGetter( ChromeUtils.defineModuleGetter(
lazy, lazy,
@ -65,6 +64,11 @@ ChromeUtils.defineModuleGetter(
"PageThumbs", "PageThumbs",
"resource://gre/modules/PageThumbs.jsm" "resource://gre/modules/PageThumbs.jsm"
); );
ChromeUtils.defineModuleGetter(
lazy,
"RemoteSettings",
"resource://services-settings/remote-settings.js"
);
XPCOMUtils.defineLazyGetter(lazy, "log", () => { XPCOMUtils.defineLazyGetter(lazy, "log", () => {
const { Logger } = ChromeUtils.import( const { Logger } = ChromeUtils.import(

View file

@ -13,8 +13,8 @@ const { HttpServer } = ChromeUtils.import("resource://testing-common/httpd.js");
const { RemoteL10n } = ChromeUtils.import( const { RemoteL10n } = ChromeUtils.import(
"resource://activity-stream/lib/RemoteL10n.jsm" "resource://activity-stream/lib/RemoteL10n.jsm"
); );
const { RemoteSettings } = ChromeUtils.importESModule( const { RemoteSettings } = ChromeUtils.import(
"resource://services-settings/remote-settings.sys.mjs" "resource://services-settings/remote-settings.js"
); );
// This pref is used to override the Remote Settings server URL in tests. // This pref is used to override the Remote Settings server URL in tests.

View file

@ -1,5 +1,5 @@
const { RemoteSettings } = ChromeUtils.importESModule( const { RemoteSettings } = ChromeUtils.import(
"resource://services-settings/remote-settings.sys.mjs" "resource://services-settings/remote-settings.js"
); );
const { ASRouter } = ChromeUtils.import( const { ASRouter } = ChromeUtils.import(
"resource://activity-stream/lib/ASRouter.jsm" "resource://activity-stream/lib/ASRouter.jsm"

View file

@ -1,8 +1,8 @@
const { ASRouter } = ChromeUtils.import( const { ASRouter } = ChromeUtils.import(
"resource://activity-stream/lib/ASRouter.jsm" "resource://activity-stream/lib/ASRouter.jsm"
); );
const { RemoteSettings } = ChromeUtils.importESModule( const { RemoteSettings } = ChromeUtils.import(
"resource://services-settings/remote-settings.sys.mjs" "resource://services-settings/remote-settings.js"
); );
const { CFRMessageProvider } = ChromeUtils.import( const { CFRMessageProvider } = ChromeUtils.import(
"resource://activity-stream/lib/CFRMessageProvider.jsm" "resource://activity-stream/lib/CFRMessageProvider.jsm"

View file

@ -1,8 +1,8 @@
const { ASRouter } = ChromeUtils.import( const { ASRouter } = ChromeUtils.import(
"resource://activity-stream/lib/ASRouter.jsm" "resource://activity-stream/lib/ASRouter.jsm"
); );
const { RemoteSettings } = ChromeUtils.importESModule( const { RemoteSettings } = ChromeUtils.import(
"resource://services-settings/remote-settings.sys.mjs" "resource://services-settings/remote-settings.js"
); );
const { CFRMessageProvider } = ChromeUtils.import( const { CFRMessageProvider } = ChromeUtils.import(
"resource://activity-stream/lib/CFRMessageProvider.jsm" "resource://activity-stream/lib/CFRMessageProvider.jsm"

View file

@ -4,8 +4,8 @@ const { PanelTestProvider } = ChromeUtils.import(
const { MomentsPageHub } = ChromeUtils.import( const { MomentsPageHub } = ChromeUtils.import(
"resource://activity-stream/lib/MomentsPageHub.jsm" "resource://activity-stream/lib/MomentsPageHub.jsm"
); );
const { RemoteSettings } = ChromeUtils.importESModule( const { RemoteSettings } = ChromeUtils.import(
"resource://services-settings/remote-settings.sys.mjs" "resource://services-settings/remote-settings.js"
); );
const { ASRouter } = ChromeUtils.import( const { ASRouter } = ChromeUtils.import(
"resource://activity-stream/lib/ASRouter.jsm" "resource://activity-stream/lib/ASRouter.jsm"

View file

@ -9,8 +9,8 @@ const { ASRouter } = ChromeUtils.import(
const { BrowserUtils } = ChromeUtils.importESModule( const { BrowserUtils } = ChromeUtils.importESModule(
"resource://gre/modules/BrowserUtils.sys.mjs" "resource://gre/modules/BrowserUtils.sys.mjs"
); );
const { Downloader } = ChromeUtils.importESModule( const { Downloader } = ChromeUtils.import(
"resource://services-settings/Attachments.sys.mjs" "resource://services-settings/Attachments.jsm"
); );
const { ExperimentFakes } = ChromeUtils.import( const { ExperimentFakes } = ChromeUtils.import(
"resource://testing-common/NimbusTestUtils.jsm" "resource://testing-common/NimbusTestUtils.jsm"
@ -26,8 +26,8 @@ const {
const { RemoteImagesTestUtils, RemoteSettingsServer } = ChromeUtils.import( const { RemoteImagesTestUtils, RemoteSettingsServer } = ChromeUtils.import(
"resource://testing-common/RemoteImagesTestUtils.jsm" "resource://testing-common/RemoteImagesTestUtils.jsm"
); );
const { RemoteSettings } = ChromeUtils.importESModule( const { RemoteSettings } = ChromeUtils.import(
"resource://services-settings/remote-settings.sys.mjs" "resource://services-settings/remote-settings.js"
); );
const { RemoteSettingsExperimentLoader } = ChromeUtils.import( const { RemoteSettingsExperimentLoader } = ChromeUtils.import(
"resource://nimbus/lib/RemoteSettingsExperimentLoader.jsm" "resource://nimbus/lib/RemoteSettingsExperimentLoader.jsm"

View file

@ -7,6 +7,7 @@ XPCOMUtils.defineLazyModuleGetters(this, {
CFRMessageProvider: "resource://activity-stream/lib/CFRMessageProvider.jsm", CFRMessageProvider: "resource://activity-stream/lib/CFRMessageProvider.jsm",
ExperimentAPI: "resource://nimbus/ExperimentAPI.jsm", ExperimentAPI: "resource://nimbus/ExperimentAPI.jsm",
ExperimentFakes: "resource://testing-common/NimbusTestUtils.jsm", ExperimentFakes: "resource://testing-common/NimbusTestUtils.jsm",
FxAccounts: "resource://gre/modules/FxAccounts.jsm",
HomePage: "resource:///modules/HomePage.jsm", HomePage: "resource:///modules/HomePage.jsm",
NimbusFeatures: "resource://nimbus/ExperimentAPI.jsm", NimbusFeatures: "resource://nimbus/ExperimentAPI.jsm",
QueryCache: "resource://activity-stream/lib/ASRouterTargeting.jsm", QueryCache: "resource://activity-stream/lib/ASRouterTargeting.jsm",
@ -17,7 +18,6 @@ ChromeUtils.defineESModuleGetters(this, {
AppConstants: "resource://gre/modules/AppConstants.sys.mjs", AppConstants: "resource://gre/modules/AppConstants.sys.mjs",
AttributionCode: "resource:///modules/AttributionCode.sys.mjs", AttributionCode: "resource:///modules/AttributionCode.sys.mjs",
BuiltInThemes: "resource:///modules/BuiltInThemes.sys.mjs", BuiltInThemes: "resource:///modules/BuiltInThemes.sys.mjs",
FxAccounts: "resource://gre/modules/FxAccounts.sys.mjs",
NewTabUtils: "resource://gre/modules/NewTabUtils.sys.mjs", NewTabUtils: "resource://gre/modules/NewTabUtils.sys.mjs",
PlacesTestUtils: "resource://testing-common/PlacesTestUtils.sys.mjs", PlacesTestUtils: "resource://testing-common/PlacesTestUtils.sys.mjs",
ProfileAge: "resource://gre/modules/ProfileAge.sys.mjs", ProfileAge: "resource://gre/modules/ProfileAge.sys.mjs",

View file

@ -14,8 +14,8 @@ ChromeUtils.defineModuleGetter(
"resource://activity-stream/lib/ASRouterTargeting.jsm" "resource://activity-stream/lib/ASRouterTargeting.jsm"
); );
// eslint-disable-next-line no-unused-vars // eslint-disable-next-line no-unused-vars
const { FxAccounts } = ChromeUtils.importESModule( const { FxAccounts } = ChromeUtils.import(
"resource://gre/modules/FxAccounts.sys.mjs" "resource://gre/modules/FxAccounts.jsm"
); );
// We import sinon here to make it available across all mochitest test files // We import sinon here to make it available across all mochitest test files
// eslint-disable-next-line no-unused-vars // eslint-disable-next-line no-unused-vars

View file

@ -17,9 +17,11 @@ ChromeUtils.defineModuleGetter(
"AddonRepository", "AddonRepository",
"resource://gre/modules/addons/AddonRepository.jsm" "resource://gre/modules/addons/AddonRepository.jsm"
); );
ChromeUtils.defineESModuleGetters(this, { ChromeUtils.defineModuleGetter(
RemoteSettings: "resource://services-settings/remote-settings.sys.mjs", this,
}); "RemoteSettings",
"resource://services-settings/remote-settings.js"
);
ChromeUtils.defineModuleGetter( ChromeUtils.defineModuleGetter(
this, this,
"SelectionChangedMenulist", "SelectionChangedMenulist",

View file

@ -5,8 +5,8 @@
const { XPCOMUtils } = ChromeUtils.importESModule( const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs" "resource://gre/modules/XPCOMUtils.sys.mjs"
); );
const { FxAccounts } = ChromeUtils.importESModule( const { FxAccounts } = ChromeUtils.import(
"resource://gre/modules/FxAccounts.sys.mjs" "resource://gre/modules/FxAccounts.jsm"
); );
const { Weave } = ChromeUtils.importESModule( const { Weave } = ChromeUtils.importESModule(
"resource://services-sync/main.sys.mjs" "resource://services-sync/main.sys.mjs"
@ -14,9 +14,11 @@ const { Weave } = ChromeUtils.importESModule(
ChromeUtils.defineESModuleGetters(this, { ChromeUtils.defineESModuleGetters(this, {
EventEmitter: "resource://gre/modules/EventEmitter.sys.mjs", EventEmitter: "resource://gre/modules/EventEmitter.sys.mjs",
FxAccountsPairingFlow: "resource://gre/modules/FxAccountsPairing.sys.mjs",
}); });
XPCOMUtils.defineLazyModuleGetters(this, {
FxAccountsPairingFlow: "resource://gre/modules/FxAccountsPairing.jsm",
});
const { require } = ChromeUtils.importESModule( const { require } = ChromeUtils.importESModule(
"resource://devtools/shared/loader/Loader.sys.mjs" "resource://devtools/shared/loader/Loader.sys.mjs"
); );

View file

@ -42,8 +42,8 @@ var { Weave } = ChromeUtils.importESModule(
"resource://services-sync/main.sys.mjs" "resource://services-sync/main.sys.mjs"
); );
var { FxAccounts, getFxAccountsSingleton } = ChromeUtils.importESModule( var { FxAccounts, getFxAccountsSingleton } = ChromeUtils.import(
"resource://gre/modules/FxAccounts.sys.mjs" "resource://gre/modules/FxAccounts.jsm"
); );
var fxAccounts = getFxAccountsSingleton(); var fxAccounts = getFxAccountsSingleton();

View file

@ -6,8 +6,8 @@
const { UIState } = ChromeUtils.importESModule( const { UIState } = ChromeUtils.importESModule(
"resource://services-sync/UIState.sys.mjs" "resource://services-sync/UIState.sys.mjs"
); );
const { FxAccountsPairingFlow } = ChromeUtils.importESModule( const { FxAccountsPairingFlow } = ChromeUtils.import(
"resource://gre/modules/FxAccountsPairing.sys.mjs" "resource://gre/modules/FxAccountsPairing.jsm"
); );
// Use sinon for mocking. // Use sinon for mocking.

View file

@ -8,10 +8,13 @@ const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, { ChromeUtils.defineESModuleGetters(lazy, {
BrowserSearchTelemetry: "resource:///modules/BrowserSearchTelemetry.sys.mjs", BrowserSearchTelemetry: "resource:///modules/BrowserSearchTelemetry.sys.mjs",
RemoteSettings: "resource://services-settings/remote-settings.sys.mjs",
SearchUtils: "resource://gre/modules/SearchUtils.sys.mjs", SearchUtils: "resource://gre/modules/SearchUtils.sys.mjs",
}); });
XPCOMUtils.defineLazyModuleGetters(lazy, {
RemoteSettings: "resource://services-settings/remote-settings.js",
});
// The various histograms and scalars that we report to. // The various histograms and scalars that we report to.
const SEARCH_CONTENT_SCALAR_BASE = "browser.search.content."; const SEARCH_CONTENT_SCALAR_BASE = "browser.search.content.";
const SEARCH_WITH_ADS_SCALAR_BASE = "browser.search.withads."; const SEARCH_WITH_ADS_SCALAR_BASE = "browser.search.withads.";

View file

@ -16,7 +16,6 @@ const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, { ChromeUtils.defineESModuleGetters(lazy, {
AboutReaderParent: "resource:///actors/AboutReaderParent.sys.mjs", AboutReaderParent: "resource:///actors/AboutReaderParent.sys.mjs",
BuiltInThemes: "resource:///modules/BuiltInThemes.sys.mjs", BuiltInThemes: "resource:///modules/BuiltInThemes.sys.mjs",
FxAccounts: "resource://gre/modules/FxAccounts.sys.mjs",
ProfileAge: "resource://gre/modules/ProfileAge.sys.mjs", ProfileAge: "resource://gre/modules/ProfileAge.sys.mjs",
ResetProfile: "resource://gre/modules/ResetProfile.sys.mjs", ResetProfile: "resource://gre/modules/ResetProfile.sys.mjs",
TelemetryController: "resource://gre/modules/TelemetryController.sys.mjs", TelemetryController: "resource://gre/modules/TelemetryController.sys.mjs",
@ -27,12 +26,13 @@ XPCOMUtils.defineLazyModuleGetters(lazy, {
AddonManager: "resource://gre/modules/AddonManager.jsm", AddonManager: "resource://gre/modules/AddonManager.jsm",
BrowserUsageTelemetry: "resource:///modules/BrowserUsageTelemetry.jsm", BrowserUsageTelemetry: "resource:///modules/BrowserUsageTelemetry.jsm",
CustomizableUI: "resource:///modules/CustomizableUI.jsm", CustomizableUI: "resource:///modules/CustomizableUI.jsm",
FxAccounts: "resource://gre/modules/FxAccounts.jsm",
PanelMultiView: "resource:///modules/PanelMultiView.jsm", PanelMultiView: "resource:///modules/PanelMultiView.jsm",
}); });
XPCOMUtils.defineLazyGetter(lazy, "fxAccounts", () => { XPCOMUtils.defineLazyGetter(lazy, "fxAccounts", () => {
return ChromeUtils.importESModule( return ChromeUtils.import(
"resource://gre/modules/FxAccounts.sys.mjs" "resource://gre/modules/FxAccounts.jsm"
).getFxAccountsSingleton(); ).getFxAccountsSingleton();
}); });

View file

@ -8,8 +8,8 @@ const { UIState } = ChromeUtils.importESModule(
); );
XPCOMUtils.defineLazyGetter(this, "fxAccounts", () => { XPCOMUtils.defineLazyGetter(this, "fxAccounts", () => {
return ChromeUtils.importESModule( return ChromeUtils.import(
"resource://gre/modules/FxAccounts.sys.mjs" "resource://gre/modules/FxAccounts.jsm"
).getFxAccountsSingleton(); ).getFxAccountsSingleton();
}); });

View file

@ -2,6 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
import { BaseFeature } from "resource:///modules/urlbar/private/BaseFeature.sys.mjs"; import { BaseFeature } from "resource:///modules/urlbar/private/BaseFeature.sys.mjs";
const lazy = {}; const lazy = {};
@ -9,11 +10,14 @@ const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, { ChromeUtils.defineESModuleGetters(lazy, {
EventEmitter: "resource://gre/modules/EventEmitter.sys.mjs", EventEmitter: "resource://gre/modules/EventEmitter.sys.mjs",
QuickSuggest: "resource:///modules/QuickSuggest.sys.mjs", QuickSuggest: "resource:///modules/QuickSuggest.sys.mjs",
RemoteSettings: "resource://services-settings/remote-settings.sys.mjs",
TaskQueue: "resource:///modules/UrlbarUtils.sys.mjs", TaskQueue: "resource:///modules/UrlbarUtils.sys.mjs",
UrlbarPrefs: "resource:///modules/UrlbarPrefs.sys.mjs", UrlbarPrefs: "resource:///modules/UrlbarPrefs.sys.mjs",
}); });
XPCOMUtils.defineLazyModuleGetters(lazy, {
RemoteSettings: "resource://services-settings/remote-settings.js",
});
const RS_COLLECTION = "quicksuggest"; const RS_COLLECTION = "quicksuggest";
// Categories that should show "Firefox Suggest" instead of "Sponsored" // Categories that should show "Firefox Suggest" instead of "Sponsored"

View file

@ -8,12 +8,10 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs" "resource://gre/modules/XPCOMUtils.sys.mjs"
); );
ChromeUtils.defineESModuleGetters(this, {
RemoteSettings: "resource://services-settings/remote-settings.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(this, { XPCOMUtils.defineLazyModuleGetters(this, {
HomePage: "resource:///modules/HomePage.jsm", HomePage: "resource:///modules/HomePage.jsm",
RemoteSettings: "resource://services-settings/remote-settings.js",
// RemoteSettingsClient: "resource://services-settings/RemoteSettingsClient.jsm",
sinon: "resource://testing-common/Sinon.jsm", sinon: "resource://testing-common/Sinon.jsm",
}); });

View file

@ -9,12 +9,12 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
); );
ChromeUtils.defineESModuleGetters(this, { ChromeUtils.defineESModuleGetters(this, {
RemoteSettings: "resource://services-settings/remote-settings.sys.mjs",
TelemetryTestUtils: "resource://testing-common/TelemetryTestUtils.sys.mjs", TelemetryTestUtils: "resource://testing-common/TelemetryTestUtils.sys.mjs",
}); });
XPCOMUtils.defineLazyModuleGetters(this, { XPCOMUtils.defineLazyModuleGetters(this, {
HomePage: "resource:///modules/HomePage.jsm", HomePage: "resource:///modules/HomePage.jsm",
RemoteSettings: "resource://services-settings/remote-settings.js",
sinon: "resource://testing-common/Sinon.jsm", sinon: "resource://testing-common/Sinon.jsm",
}); });

View file

@ -4,8 +4,8 @@
"use strict"; "use strict";
const { RemoteSettings } = ChromeUtils.importESModule( const { RemoteSettings } = ChromeUtils.import(
"resource://services-settings/remote-settings.sys.mjs" "resource://services-settings/remote-settings.js"
); );
const TARGET_BROWSER_ID = [ const TARGET_BROWSER_ID = [

View file

@ -9,8 +9,8 @@ const L10N = new LocalizationHelper(
"devtools/client/locales/device.properties" "devtools/client/locales/device.properties"
); );
const { RemoteSettings } = ChromeUtils.importESModule( const { RemoteSettings } = ChromeUtils.import(
"resource://services-settings/remote-settings.sys.mjs" "resource://services-settings/remote-settings.js"
); );
loader.lazyRequireGetter( loader.lazyRequireGetter(

View file

@ -3,8 +3,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; "use strict";
const { RemoteSettings } = ChromeUtils.importESModule( const { RemoteSettings } = ChromeUtils.import(
"resource://services-settings/remote-settings.sys.mjs" "resource://services-settings/remote-settings.js"
); );
const FileUtils = ChromeUtils.importESModule( const FileUtils = ChromeUtils.importESModule(
"resource://gre/modules/FileUtils.sys.mjs" "resource://gre/modules/FileUtils.sys.mjs"

View file

@ -6,9 +6,11 @@ function UrlClassifierExceptionListService() {}
const lazy = {}; const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, { ChromeUtils.defineModuleGetter(
RemoteSettings: "resource://services-settings/remote-settings.sys.mjs", lazy,
}); "RemoteSettings",
"resource://services-settings/remote-settings.js"
);
const COLLECTION_NAME = "url-classifier-skip-urls"; const COLLECTION_NAME = "url-classifier-skip-urls";

View file

@ -5,8 +5,8 @@
const EXPORTED_SYMBOLS = ["RemoteSecuritySettings"]; const EXPORTED_SYMBOLS = ["RemoteSecuritySettings"];
const { RemoteSettings } = ChromeUtils.importESModule( const { RemoteSettings } = ChromeUtils.import(
"resource://services-settings/remote-settings.sys.mjs" "resource://services-settings/remote-settings.js"
); );
const { XPCOMUtils } = ChromeUtils.importESModule( const { XPCOMUtils } = ChromeUtils.importESModule(

View file

@ -3,8 +3,8 @@
do_get_profile(); do_get_profile();
const { Utils } = ChromeUtils.import("resource://services-settings/Utils.jsm"); const { Utils } = ChromeUtils.import("resource://services-settings/Utils.jsm");
const { RemoteSettings } = ChromeUtils.importESModule( const { RemoteSettings } = ChromeUtils.import(
"resource://services-settings/remote-settings.sys.mjs" "resource://services-settings/remote-settings.js"
); );
const { RemoteSecuritySettings } = ChromeUtils.import( const { RemoteSecuritySettings } = ChromeUtils.import(
"resource://gre/modules/psm/RemoteSecuritySettings.jsm" "resource://gre/modules/psm/RemoteSecuritySettings.jsm"

View file

@ -0,0 +1,17 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
module.exports = {
env: {
browser: true,
},
rules: {
"no-unused-vars": [
"error",
{ args: "none", varsIgnorePattern: "^EXPORTED_SYMBOLS|^Sync" },
],
},
};

View file

@ -32,8 +32,6 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
const lazy = {}; const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, { ChromeUtils.defineESModuleGetters(lazy, {
FxAccountsClient: "resource://gre/modules/FxAccountsClient.sys.mjs",
FxAccountsConfig: "resource://gre/modules/FxAccountsConfig.sys.mjs",
Log: "resource://gre/modules/Log.sys.mjs", Log: "resource://gre/modules/Log.sys.mjs",
Svc: "resource://services-sync/util.sys.mjs", Svc: "resource://services-sync/util.sys.mjs",
Weave: "resource://services-sync/main.sys.mjs", Weave: "resource://services-sync/main.sys.mjs",
@ -41,9 +39,14 @@ ChromeUtils.defineESModuleGetters(lazy, {
setTimeout: "resource://gre/modules/Timer.sys.mjs", setTimeout: "resource://gre/modules/Timer.sys.mjs",
}); });
XPCOMUtils.defineLazyModuleGetters(lazy, {
FxAccountsClient: "resource://gre/modules/FxAccountsClient.jsm",
FxAccountsConfig: "resource://gre/modules/FxAccountsConfig.jsm",
});
XPCOMUtils.defineLazyGetter(lazy, "fxAccounts", () => { XPCOMUtils.defineLazyGetter(lazy, "fxAccounts", () => {
return ChromeUtils.importESModule( return ChromeUtils.import(
"resource://gre/modules/FxAccounts.sys.mjs" "resource://gre/modules/FxAccounts.jsm"
).getFxAccountsSingleton(); ).getFxAccountsSingleton();
}); });

View file

@ -3,7 +3,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
with Files("**"): with Files("**"):
BUG_COMPONENT = ("Firefox", "Sync") BUG_COMPONENT = ("Firefox", "Services Automation")
EXTRA_COMPONENTS += [ EXTRA_COMPONENTS += [
"AutomationComponents.manifest", "AutomationComponents.manifest",

View file

@ -21,8 +21,8 @@ const { RESTRequest } = ChromeUtils.import(
const { CommonUtils } = ChromeUtils.import( const { CommonUtils } = ChromeUtils.import(
"resource://services-common/utils.js" "resource://services-common/utils.js"
); );
const { Credentials } = ChromeUtils.importESModule( const { Credentials } = ChromeUtils.import(
"resource://gre/modules/Credentials.sys.mjs" "resource://gre/modules/Credentials.jsm"
); );
const lazy = {}; const lazy = {};

View file

@ -9,8 +9,13 @@
* See https://github.com/mozilla/fxa-auth-server/wiki/onepw-protocol * See https://github.com/mozilla/fxa-auth-server/wiki/onepw-protocol
*/ */
import { Log } from "resource://gre/modules/Log.sys.mjs"; "use strict";
var EXPORTED_SYMBOLS = ["Credentials"];
const { Log } = ChromeUtils.importESModule(
"resource://gre/modules/Log.sys.mjs"
);
const { CryptoUtils } = ChromeUtils.import( const { CryptoUtils } = ChromeUtils.import(
"resource://services-crypto/utils.js" "resource://services-crypto/utils.js"
); );
@ -40,7 +45,7 @@ var log = Log.repository.getLogger("Identity.FxAccounts");
log.level = LOG_LEVEL; log.level = LOG_LEVEL;
log.addAppender(new Log.ConsoleAppender(new Log.BasicFormatter())); log.addAppender(new Log.ConsoleAppender(new Log.BasicFormatter()));
export var Credentials = Object.freeze({ var Credentials = Object.freeze({
/** /**
* Make constants accessible to tests * Make constants accessible to tests
*/ */

View file

@ -1,17 +1,23 @@
/* This Source Code Form is subject to the terms of the Mozilla Public /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
import { PromiseUtils } from "resource://gre/modules/PromiseUtils.sys.mjs"; const { PromiseUtils } = ChromeUtils.importESModule(
"resource://gre/modules/PromiseUtils.sys.mjs"
);
const { CryptoUtils } = ChromeUtils.import( const { CryptoUtils } = ChromeUtils.import(
"resource://services-crypto/utils.js" "resource://services-crypto/utils.js"
); );
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; const { XPCOMUtils } = ChromeUtils.importESModule(
import { clearTimeout, setTimeout } from "resource://gre/modules/Timer.sys.mjs"; "resource://gre/modules/XPCOMUtils.sys.mjs"
);
import { FxAccountsStorageManager } from "resource://gre/modules/FxAccountsStorage.sys.mjs"; const { clearTimeout, setTimeout } = ChromeUtils.importESModule(
"resource://gre/modules/Timer.sys.mjs"
);
const { FxAccountsStorageManager } = ChromeUtils.import(
"resource://gre/modules/FxAccountsStorage.jsm"
);
const { const {
ERRNO_INVALID_AUTH_TOKEN, ERRNO_INVALID_AUTH_TOKEN,
ERROR_AUTH_ERROR, ERROR_AUTH_ERROR,
@ -41,16 +47,47 @@ const {
const lazy = {}; const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, { ChromeUtils.defineModuleGetter(
FxAccountsClient: "resource://gre/modules/FxAccountsClient.sys.mjs", lazy,
FxAccountsCommands: "resource://gre/modules/FxAccountsCommands.sys.mjs", "FxAccountsClient",
FxAccountsConfig: "resource://gre/modules/FxAccountsConfig.sys.mjs", "resource://gre/modules/FxAccountsClient.jsm"
FxAccountsDevice: "resource://gre/modules/FxAccountsDevice.sys.mjs", );
FxAccountsKeys: "resource://gre/modules/FxAccountsKeys.sys.mjs",
FxAccountsProfile: "resource://gre/modules/FxAccountsProfile.sys.mjs", ChromeUtils.defineModuleGetter(
FxAccountsTelemetry: "resource://gre/modules/FxAccountsTelemetry.sys.mjs", lazy,
Preferences: "resource://gre/modules/Preferences.sys.mjs", "FxAccountsConfig",
}); "resource://gre/modules/FxAccountsConfig.jsm"
);
ChromeUtils.defineModuleGetter(
lazy,
"FxAccountsCommands",
"resource://gre/modules/FxAccountsCommands.js"
);
ChromeUtils.defineModuleGetter(
lazy,
"FxAccountsDevice",
"resource://gre/modules/FxAccountsDevice.jsm"
);
ChromeUtils.defineModuleGetter(
lazy,
"FxAccountsKeys",
"resource://gre/modules/FxAccountsKeys.jsm"
);
ChromeUtils.defineModuleGetter(
lazy,
"FxAccountsProfile",
"resource://gre/modules/FxAccountsProfile.jsm"
);
ChromeUtils.defineModuleGetter(
lazy,
"FxAccountsTelemetry",
"resource://gre/modules/FxAccountsTelemetry.jsm"
);
XPCOMUtils.defineLazyGetter(lazy, "mpLocked", () => { XPCOMUtils.defineLazyGetter(lazy, "mpLocked", () => {
return ChromeUtils.importESModule("resource://services-sync/util.sys.mjs") return ChromeUtils.importESModule("resource://services-sync/util.sys.mjs")
@ -62,6 +99,10 @@ XPCOMUtils.defineLazyGetter(lazy, "ensureMPUnlocked", () => {
.Utils.ensureMPUnlocked; .Utils.ensureMPUnlocked;
}); });
ChromeUtils.defineESModuleGetters(lazy, {
Preferences: "resource://gre/modules/Preferences.sys.mjs",
});
XPCOMUtils.defineLazyPreferenceGetter( XPCOMUtils.defineLazyPreferenceGetter(
lazy, lazy,
"FXA_ENABLED", "FXA_ENABLED",
@ -88,7 +129,7 @@ XPCOMUtils.defineLazyPreferenceGetter(
// } // }
// If the state has changed between the function being called and the promise // If the state has changed between the function being called and the promise
// being resolved, the .resolve() call will actually be rejected. // being resolved, the .resolve() call will actually be rejected.
export function AccountState(storageManager) { function AccountState(storageManager) {
this.storageManager = storageManager; this.storageManager = storageManager;
this.inFlightTokenRequests = new Map(); this.inFlightTokenRequests = new Map();
this.promiseInitialized = this.storageManager this.promiseInitialized = this.storageManager
@ -334,7 +375,7 @@ function copyObjectProperties(from, to, thisObj, keys) {
* (although |./mach doc| is broken on windows (bug 1232403) and on Linux for * (although |./mach doc| is broken on windows (bug 1232403) and on Linux for
* markh (some obscure npm issue he gave up on) - so later...) * markh (some obscure npm issue he gave up on) - so later...)
*/ */
export class FxAccounts { class FxAccounts {
constructor(mocks = null) { constructor(mocks = null) {
this._internal = new FxAccountsInternal(); this._internal = new FxAccountsInternal();
if (mocks) { if (mocks) {
@ -1604,8 +1645,7 @@ FxAccountsInternal.prototype = {
}; };
let fxAccountsSingleton = null; let fxAccountsSingleton = null;
function getFxAccountsSingleton() {
export function getFxAccountsSingleton() {
if (fxAccountsSingleton) { if (fxAccountsSingleton) {
return fxAccountsSingleton; return fxAccountsSingleton;
} }
@ -1620,3 +1660,4 @@ export function getFxAccountsSingleton() {
} }
// `AccountState` is exported for tests. // `AccountState` is exported for tests.
var EXPORTED_SYMBOLS = ["getFxAccountsSingleton", "FxAccounts", "AccountState"];

View file

@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
var EXPORTED_SYMBOLS = ["FxAccountsClient"];
const { CommonUtils } = ChromeUtils.import( const { CommonUtils } = ChromeUtils.import(
"resource://services-common/utils.js" "resource://services-common/utils.js"
); );
@ -23,7 +25,9 @@ const {
ERRNO_INVALID_AUTH_TOKEN, ERRNO_INVALID_AUTH_TOKEN,
log, log,
} = ChromeUtils.import("resource://gre/modules/FxAccountsCommon.js"); } = ChromeUtils.import("resource://gre/modules/FxAccountsCommon.js");
import { Credentials } from "resource://gre/modules/Credentials.sys.mjs"; const { Credentials } = ChromeUtils.import(
"resource://gre/modules/Credentials.jsm"
);
const HOST_PREF = "identity.fxaccounts.auth.uri"; const HOST_PREF = "identity.fxaccounts.auth.uri";
@ -32,9 +36,7 @@ const SIGNUP = "/account/create";
// Devices older than this many days will not appear in the devices list // Devices older than this many days will not appear in the devices list
const DEVICES_FILTER_DAYS = 21; const DEVICES_FILTER_DAYS = 21;
export var FxAccountsClient = function( var FxAccountsClient = function(host = Services.prefs.getCharPref(HOST_PREF)) {
host = Services.prefs.getCharPref(HOST_PREF)
) {
this.host = host; this.host = host;
// The FxA auth server expects requests to certain endpoints to be authorized // The FxA auth server expects requests to certain endpoints to be authorized

View file

@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
const EXPORTED_SYMBOLS = ["SendTab", "FxAccountsCommands"];
const { const {
COMMAND_SENDTAB, COMMAND_SENDTAB,
COMMAND_SENDTAB_TAIL, COMMAND_SENDTAB_TAIL,
@ -14,8 +16,9 @@ ChromeUtils.defineModuleGetter(
"PushCrypto", "PushCrypto",
"resource://gre/modules/PushCrypto.jsm" "resource://gre/modules/PushCrypto.jsm"
); );
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const { Observers } = ChromeUtils.import( const { Observers } = ChromeUtils.import(
"resource://services-common/observers.js" "resource://services-common/observers.js"
); );
@ -36,7 +39,7 @@ XPCOMUtils.defineLazyPreferenceGetter(
} }
); );
export class FxAccountsCommands { class FxAccountsCommands {
constructor(fxAccountsInternal) { constructor(fxAccountsInternal) {
this._fxai = fxAccountsInternal; this._fxai = fxAccountsInternal;
this.sendTab = new SendTab(this, fxAccountsInternal); this.sendTab = new SendTab(this, fxAccountsInternal);
@ -245,7 +248,7 @@ export class FxAccountsCommands {
* the push keys to deliver the tabs using same mechanism we use for web-push. * the push keys to deliver the tabs using same mechanism we use for web-push.
* However, clients use the send-tab keys for end-to-end encryption. * However, clients use the send-tab keys for end-to-end encryption.
*/ */
export class SendTab { class SendTab {
constructor(commands, fxAccountsInternal) { constructor(commands, fxAccountsInternal) {
this._commands = commands; this._commands = commands;
this._fxai = fxAccountsInternal; this._fxai = fxAccountsInternal;

View file

@ -1,6 +1,8 @@
/* This Source Code Form is subject to the terms of the Mozilla Public /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
var EXPORTED_SYMBOLS = ["FxAccountsConfig"];
const { RESTRequest } = ChromeUtils.import( const { RESTRequest } = ChromeUtils.import(
"resource://services-common/rest.js" "resource://services-common/rest.js"
@ -8,20 +10,23 @@ const { RESTRequest } = ChromeUtils.import(
const { log } = ChromeUtils.import( const { log } = ChromeUtils.import(
"resource://gre/modules/FxAccountsCommon.js" "resource://gre/modules/FxAccountsCommon.js"
); );
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const lazy = {}; const lazy = {};
XPCOMUtils.defineLazyGetter(lazy, "fxAccounts", () => { XPCOMUtils.defineLazyGetter(lazy, "fxAccounts", () => {
return ChromeUtils.importESModule( return ChromeUtils.import(
"resource://gre/modules/FxAccounts.sys.mjs" "resource://gre/modules/FxAccounts.jsm"
).getFxAccountsSingleton(); ).getFxAccountsSingleton();
}); });
ChromeUtils.defineESModuleGetters(lazy, { ChromeUtils.defineModuleGetter(
EnsureFxAccountsWebChannel: lazy,
"resource://gre/modules/FxAccountsWebChannel.sys.mjs", "EnsureFxAccountsWebChannel",
}); "resource://gre/modules/FxAccountsWebChannel.jsm"
);
XPCOMUtils.defineLazyPreferenceGetter( XPCOMUtils.defineLazyPreferenceGetter(
lazy, lazy,
@ -52,7 +57,7 @@ const CONFIG_PREFS = [
]; ];
const SYNC_PARAM = "sync"; const SYNC_PARAM = "sync";
export var FxAccountsConfig = { var FxAccountsConfig = {
async promiseEmailURI(email, entrypoint, extraParams = {}) { async promiseEmailURI(email, entrypoint, extraParams = {}) {
return this._buildURL("", { return this._buildURL("", {
extraParams: { entrypoint, email, service: SYNC_PARAM, ...extraParams }, extraParams: { entrypoint, email, service: SYNC_PARAM, ...extraParams },

View file

@ -1,8 +1,11 @@
/* This Source Code Form is subject to the terms of the Mozilla Public /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const { const {
log, log,
@ -54,7 +57,7 @@ function sanitizeDeviceName(name) {
} }
// Everything to do with FxA devices. // Everything to do with FxA devices.
export class FxAccountsDevice { class FxAccountsDevice {
constructor(fxai) { constructor(fxai) {
this._fxai = fxai; this._fxai = fxai;
this._deviceListCache = null; this._deviceListCache = null;
@ -650,3 +653,5 @@ FxAccountsDevice.prototype.QueryInterface = ChromeUtils.generateQI([
function urlsafeBase64Encode(buffer) { function urlsafeBase64Encode(buffer) {
return ChromeUtils.base64URLEncode(new Uint8Array(buffer), { pad: false }); return ChromeUtils.base64URLEncode(new Uint8Array(buffer), { pad: false });
} }
var EXPORTED_SYMBOLS = ["FxAccountsDevice"];

View file

@ -1,9 +1,11 @@
/* This Source Code Form is subject to the terms of the Mozilla Public /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
import { PromiseUtils } from "resource://gre/modules/PromiseUtils.sys.mjs"; const { PromiseUtils } = ChromeUtils.importESModule(
"resource://gre/modules/PromiseUtils.sys.mjs"
);
const { CommonUtils } = ChromeUtils.import( const { CommonUtils } = ChromeUtils.import(
"resource://services-common/utils.js" "resource://services-common/utils.js"
); );
@ -54,7 +56,7 @@ const DEPRECATED_KEY_SCOPES = [DEPRECATED_SCOPE_ECOSYSTEM_TELEMETRY];
* possible. We intend to remove support for Firefox ever directly handling `kB` * possible. We intend to remove support for Firefox ever directly handling `kB`
* at some point in the future. * at some point in the future.
*/ */
export class FxAccountsKeys { class FxAccountsKeys {
constructor(fxAccountsInternal) { constructor(fxAccountsInternal) {
this._fxai = fxAccountsInternal; this._fxai = fxAccountsInternal;
} }
@ -747,3 +749,5 @@ export class FxAccountsKeys {
return CryptoUtils.digestBytes(bytes, hasher); return CryptoUtils.digestBytes(bytes, hasher);
} }
} }
var EXPORTED_SYMBOLS = ["FxAccountsKeys"];

View file

@ -2,6 +2,8 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
"use strict";
const { const {
log, log,
PREF_REMOTE_PAIRING_URI, PREF_REMOTE_PAIRING_URI,
@ -11,19 +13,16 @@ const {
COMMAND_PAIR_HEARTBEAT, COMMAND_PAIR_HEARTBEAT,
COMMAND_PAIR_COMPLETE, COMMAND_PAIR_COMPLETE,
} = ChromeUtils.import("resource://gre/modules/FxAccountsCommon.js"); } = ChromeUtils.import("resource://gre/modules/FxAccountsCommon.js");
import { const { getFxAccountsSingleton, FxAccounts } = ChromeUtils.import(
getFxAccountsSingleton, "resource://gre/modules/FxAccounts.jsm"
FxAccounts, );
} from "resource://gre/modules/FxAccounts.sys.mjs";
const fxAccounts = getFxAccountsSingleton(); const fxAccounts = getFxAccountsSingleton();
import { setTimeout, clearTimeout } from "resource://gre/modules/Timer.sys.mjs"; const { setTimeout, clearTimeout } = ChromeUtils.importESModule(
"resource://gre/modules/Timer.sys.mjs"
);
ChromeUtils.import("resource://services-common/utils.js"); ChromeUtils.import("resource://services-common/utils.js");
const lazy = {}; const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, { ChromeUtils.defineESModuleGetters(lazy, {
FxAccountsPairingChannel:
"resource://gre/modules/FxAccountsPairingChannel.sys.mjs",
Weave: "resource://services-sync/main.sys.mjs", Weave: "resource://services-sync/main.sys.mjs",
}); });
ChromeUtils.defineModuleGetter( ChromeUtils.defineModuleGetter(
@ -31,6 +30,11 @@ ChromeUtils.defineModuleGetter(
"jwcrypto", "jwcrypto",
"resource://services-crypto/jwcrypto.jsm" "resource://services-crypto/jwcrypto.jsm"
); );
ChromeUtils.defineModuleGetter(
lazy,
"FxAccountsPairingChannel",
"resource://gre/modules/FxAccountsPairingChannel.js"
);
const PAIRING_REDIRECT_URI = "urn:ietf:wg:oauth:2.0:oob:pair-auth-webchannel"; const PAIRING_REDIRECT_URI = "urn:ietf:wg:oauth:2.0:oob:pair-auth-webchannel";
// A pairing flow is not tied to a specific browser window, can also finish in // A pairing flow is not tied to a specific browser window, can also finish in
@ -169,8 +173,7 @@ class Errored extends State {
} }
const flows = new Map(); const flows = new Map();
class FxAccountsPairingFlow {
export class FxAccountsPairingFlow {
static get(channelId) { static get(channelId) {
return flows.get(channelId); return flows.get(channelId);
} }
@ -515,3 +518,5 @@ export class FxAccountsPairingFlow {
); );
} }
} }
const EXPORTED_SYMBOLS = ["FxAccountsPairingFlow"];

View file

@ -22,14 +22,15 @@
// from Firefox browser code, hence the presence of these privileged browser APIs. // from Firefox browser code, hence the presence of these privileged browser APIs.
// If you're trying to use this from ordinary web content you're in for a bad time. // If you're trying to use this from ordinary web content you're in for a bad time.
import { setTimeout } from "resource://gre/modules/Timer.sys.mjs"; const {setTimeout} = ChromeUtils.importESModule("resource://gre/modules/Timer.sys.mjs");
// We cannot use WebSocket from chrome code without a window, // We cannot use WebSocket from chrome code without a window,
// see https://bugzilla.mozilla.org/show_bug.cgi?id=784686 // see https://bugzilla.mozilla.org/show_bug.cgi?id=784686
const browser = Services.appShell.createWindowlessBrowser(true); const browser = Services.appShell.createWindowlessBrowser(true);
const {WebSocket} = browser.document.ownerGlobal; const {WebSocket} = browser.document.ownerGlobal;
export var FxAccountsPairingChannel = const EXPORTED_SYMBOLS = ["FxAccountsPairingChannel"];
var FxAccountsPairingChannel =
/******/ (function(modules) { // webpackBootstrap /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache /******/ // The module cache
/******/ var installedModules = {}; /******/ var installedModules = {};
@ -703,7 +704,7 @@ async function verifyHmac(keyBytes, signature, message) {
hash: { name: 'SHA-256' }, hash: { name: 'SHA-256' },
name: 'HMAC', name: 'HMAC',
}, false, ['verify']); }, false, ['verify']);
if (! (await crypto.subtle.verify({ name: 'HMAC' }, key, signature, message))) { if (! await crypto.subtle.verify({ name: 'HMAC' }, key, signature, message)) {
// Yes, we really do throw 'decrypt_error' when failing to verify a HMAC, // Yes, we really do throw 'decrypt_error' when failing to verify a HMAC,
// and a 'bad_record_mac' error when failing to decrypt. // and a 'bad_record_mac' error when failing to decrypt.
throw new TLSError(ALERT_DESCRIPTION.DECRYPT_ERROR); throw new TLSError(ALERT_DESCRIPTION.DECRYPT_ERROR);

View file

@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
/** /**
* Firefox Accounts Profile helper. * Firefox Accounts Profile helper.
* *
@ -10,21 +12,25 @@
* the user's profile in open browser tabs, and cacheing/invalidating profile data. * the user's profile in open browser tabs, and cacheing/invalidating profile data.
*/ */
var EXPORTED_SYMBOLS = ["FxAccountsProfile"];
const { ON_PROFILE_CHANGE_NOTIFICATION, log } = ChromeUtils.import( const { ON_PROFILE_CHANGE_NOTIFICATION, log } = ChromeUtils.import(
"resource://gre/modules/FxAccountsCommon.js" "resource://gre/modules/FxAccountsCommon.js"
); );
import { getFxAccountsSingleton } from "resource://gre/modules/FxAccounts.sys.mjs"; const { getFxAccountsSingleton } = ChromeUtils.import(
"resource://gre/modules/FxAccounts.jsm"
);
const fxAccounts = getFxAccountsSingleton(); const fxAccounts = getFxAccountsSingleton();
const lazy = {}; const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, { ChromeUtils.defineModuleGetter(
FxAccountsProfileClient: lazy,
"resource://gre/modules/FxAccountsProfileClient.sys.mjs", "FxAccountsProfileClient",
}); "resource://gre/modules/FxAccountsProfileClient.jsm"
);
export var FxAccountsProfile = function(options = {}) { var FxAccountsProfile = function(options = {}) {
this._currentFetchPromise = null; this._currentFetchPromise = null;
this._cachedAt = 0; // when we saved the cached version. this._cachedAt = 0; // when we saved the cached version.
this._isNotifying = false; // are we sending a notification? this._isNotifying = false; // are we sending a notification?

View file

@ -7,6 +7,11 @@
*/ */
"use strict;"; "use strict;";
var EXPORTED_SYMBOLS = [
"FxAccountsProfileClient",
"FxAccountsProfileClientError",
];
const { const {
ERRNO_NETWORK, ERRNO_NETWORK,
ERRNO_PARSE, ERRNO_PARSE,
@ -20,8 +25,9 @@ const {
SCOPE_PROFILE, SCOPE_PROFILE,
SCOPE_PROFILE_WRITE, SCOPE_PROFILE_WRITE,
} = ChromeUtils.import("resource://gre/modules/FxAccountsCommon.js"); } = ChromeUtils.import("resource://gre/modules/FxAccountsCommon.js");
import { getFxAccountsSingleton } from "resource://gre/modules/FxAccounts.sys.mjs"; const { getFxAccountsSingleton } = ChromeUtils.import(
"resource://gre/modules/FxAccounts.jsm"
);
const fxAccounts = getFxAccountsSingleton(); const fxAccounts = getFxAccountsSingleton();
const { RESTRequest } = ChromeUtils.import( const { RESTRequest } = ChromeUtils.import(
"resource://services-common/rest.js" "resource://services-common/rest.js"
@ -38,7 +44,7 @@ const { RESTRequest } = ChromeUtils.import(
* The bearer token to access the profile server * The bearer token to access the profile server
* @constructor * @constructor
*/ */
export var FxAccountsProfileClient = function(options) { var FxAccountsProfileClient = function(options) {
if (!options || !options.serverURL) { if (!options || !options.serverURL) {
throw new Error("Missing 'serverURL' configuration option"); throw new Error("Missing 'serverURL' configuration option");
} }
@ -238,7 +244,7 @@ FxAccountsProfileClient.prototype = {
* Error message * Error message
* @constructor * @constructor
*/ */
export var FxAccountsProfileClientError = function(details) { var FxAccountsProfileClientError = function(details) {
details = details || {}; details = details || {};
this.name = "FxAccountsProfileClientError"; this.name = "FxAccountsProfileClientError";

View file

@ -26,7 +26,7 @@ const {
* Object, custom options that used for testing * Object, custom options that used for testing
* @constructor * @constructor
*/ */
export function FxAccountsPushService(options = {}) { function FxAccountsPushService(options = {}) {
this.log = log; this.log = log;
if (options.log) { if (options.log) {
@ -83,8 +83,8 @@ FxAccountsPushService.prototype = {
if (options.fxai) { if (options.fxai) {
this.fxai = options.fxai; this.fxai = options.fxai;
} else { } else {
const { getFxAccountsSingleton } = ChromeUtils.importESModule( const { getFxAccountsSingleton } = ChromeUtils.import(
"resource://gre/modules/FxAccounts.sys.mjs" "resource://gre/modules/FxAccounts.jsm"
); );
const fxAccounts = getFxAccountsSingleton(); const fxAccounts = getFxAccountsSingleton();
this.fxai = fxAccounts._internal; this.fxai = fxAccounts._internal;
@ -312,3 +312,5 @@ FxAccountsPushService.prototype = {
}); });
}, },
}; };
var EXPORTED_SYMBOLS = ["FxAccountsPushService"];

View file

@ -1,6 +1,14 @@
/* This Source Code Form is subject to the terms of the Mozilla Public /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
var EXPORTED_SYMBOLS = [
"FxAccountsStorageManagerCanStoreField",
"FxAccountsStorageManager",
// Exported for tests.
"LoginManagerStorage",
];
const { const {
DATA_FORMAT_VERSION, DATA_FORMAT_VERSION,
@ -14,7 +22,7 @@ const {
// A helper function so code can check what fields are able to be stored by // A helper function so code can check what fields are able to be stored by
// the storage manager without having a reference to a manager instance. // the storage manager without having a reference to a manager instance.
export function FxAccountsStorageManagerCanStoreField(fieldName) { function FxAccountsStorageManagerCanStoreField(fieldName) {
return ( return (
FXA_PWDMGR_PLAINTEXT_FIELDS.has(fieldName) || FXA_PWDMGR_PLAINTEXT_FIELDS.has(fieldName) ||
FXA_PWDMGR_SECURE_FIELDS.has(fieldName) FXA_PWDMGR_SECURE_FIELDS.has(fieldName)
@ -22,7 +30,7 @@ export function FxAccountsStorageManagerCanStoreField(fieldName) {
} }
// The storage manager object. // The storage manager object.
export var FxAccountsStorageManager = function(options = {}) { var FxAccountsStorageManager = function(options = {}) {
this.options = { this.options = {
filename: options.filename || DEFAULT_STORAGE_FILENAME, filename: options.filename || DEFAULT_STORAGE_FILENAME,
baseDir: options.baseDir || Services.dirsvc.get("ProfD", Ci.nsIFile).path, baseDir: options.baseDir || Services.dirsvc.get("ProfD", Ci.nsIFile).path,
@ -467,7 +475,6 @@ JSONStorage.prototype = {
}; };
function StorageLockedError() {} function StorageLockedError() {}
/** /**
* LoginManagerStorage constructor that creates instances that set/get * LoginManagerStorage constructor that creates instances that set/get
* data stored securely in the nsILoginManager. * data stored securely in the nsILoginManager.
@ -475,7 +482,7 @@ function StorageLockedError() {}
* @return instance * @return instance
*/ */
export function LoginManagerStorage() {} function LoginManagerStorage() {}
LoginManagerStorage.prototype = { LoginManagerStorage.prototype = {
STORAGE_LOCKED: StorageLockedError, STORAGE_LOCKED: StorageLockedError,

View file

@ -2,12 +2,16 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file, * License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */ * You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
// FxA Telemetry support. For hysterical raisins, the actual implementation // FxA Telemetry support. For hysterical raisins, the actual implementation
// is inside "sync". We should move the core implementation somewhere that's // is inside "sync". We should move the core implementation somewhere that's
// sanely shared (eg, services-common?), but let's wait and see where we end up // sanely shared (eg, services-common?), but let's wait and see where we end up
// first... // first...
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const lazy = {}; const lazy = {};
@ -30,7 +34,7 @@ XPCOMUtils.defineLazyPreferenceGetter(
"" ""
); );
export class FxAccountsTelemetry { class FxAccountsTelemetry {
constructor(fxai) { constructor(fxai) {
this._fxai = fxai; this._fxai = fxai;
Services.telemetry.setEventRecordingEnabled("fxa", true); Services.telemetry.setEventRecordingEnabled("fxa", true);
@ -172,3 +176,5 @@ export class FxAccountsTelemetry {
} }
} }
} }
var EXPORTED_SYMBOLS = ["FxAccountsTelemetry"];

View file

@ -1,6 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
/** /**
* Firefox Accounts Web Channel. * Firefox Accounts Web Channel.
@ -9,8 +10,16 @@
* about account state changes. * about account state changes.
*/ */
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; var EXPORTED_SYMBOLS = [
"EnsureFxAccountsWebChannel",
// These are exported for tests.
"FxAccountsWebChannel",
"FxAccountsWebChannelHelpers",
];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const { const {
COMMAND_PROFILE_CHANGE, COMMAND_PROFILE_CHANGE,
COMMAND_LOGIN, COMMAND_LOGIN,
@ -38,23 +47,30 @@ const {
const lazy = {}; const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, { ChromeUtils.defineESModuleGetters(lazy, {
FxAccountsPairingFlow: "resource://gre/modules/FxAccountsPairing.sys.mjs",
FxAccountsStorageManagerCanStoreField:
"resource://gre/modules/FxAccountsStorage.sys.mjs",
PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs", PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs",
Weave: "resource://services-sync/main.sys.mjs", Weave: "resource://services-sync/main.sys.mjs",
WebChannel: "resource://gre/modules/WebChannel.sys.mjs", WebChannel: "resource://gre/modules/WebChannel.sys.mjs",
}); });
XPCOMUtils.defineLazyGetter(lazy, "fxAccounts", () => { XPCOMUtils.defineLazyGetter(lazy, "fxAccounts", () => {
return ChromeUtils.importESModule( return ChromeUtils.import(
"resource://gre/modules/FxAccounts.sys.mjs" "resource://gre/modules/FxAccounts.jsm"
).getFxAccountsSingleton(); ).getFxAccountsSingleton();
}); });
ChromeUtils.defineModuleGetter(
lazy,
"FxAccountsStorageManagerCanStoreField",
"resource://gre/modules/FxAccountsStorage.jsm"
);
ChromeUtils.defineModuleGetter( ChromeUtils.defineModuleGetter(
lazy, lazy,
"CryptoUtils", "CryptoUtils",
"resource://services-crypto/utils.js" "resource://services-crypto/utils.js"
); );
ChromeUtils.defineModuleGetter(
lazy,
"FxAccountsPairingFlow",
"resource://gre/modules/FxAccountsPairing.jsm"
);
XPCOMUtils.defineLazyPreferenceGetter( XPCOMUtils.defineLazyPreferenceGetter(
lazy, lazy,
"pairingEnabled", "pairingEnabled",
@ -125,7 +141,7 @@ function getErrorDetails(error) {
* Helpers functions. Should only be passed in for testing. * Helpers functions. Should only be passed in for testing.
* @constructor * @constructor
*/ */
export function FxAccountsWebChannel(options) { function FxAccountsWebChannel(options) {
if (!options) { if (!options) {
throw new Error("Missing configuration options"); throw new Error("Missing configuration options");
} }
@ -390,7 +406,7 @@ FxAccountsWebChannel.prototype = {
}, },
}; };
export function FxAccountsWebChannelHelpers(options) { function FxAccountsWebChannelHelpers(options) {
options = options || {}; options = options || {};
this._fxAccounts = options.fxAccounts || lazy.fxAccounts; this._fxAccounts = options.fxAccounts || lazy.fxAccounts;
@ -727,13 +743,12 @@ FxAccountsWebChannelHelpers.prototype = {
}; };
var singleton; var singleton;
// The entry-point for this module, which ensures only one of our channels is // The entry-point for this module, which ensures only one of our channels is
// ever created - we require this because the WebChannel is global in scope // ever created - we require this because the WebChannel is global in scope
// (eg, it uses the observer service to tell interested parties of interesting // (eg, it uses the observer service to tell interested parties of interesting
// things) and allowing multiple channels would cause such notifications to be // things) and allowing multiple channels would cause such notifications to be
// sent multiple times. // sent multiple times.
export var EnsureFxAccountsWebChannel = () => { var EnsureFxAccountsWebChannel = () => {
let contentUri = Services.urlFormatter.formatURLPref( let contentUri = Services.urlFormatter.formatURLPref(
"identity.fxaccounts.remote.root" "identity.fxaccounts.remote.root"
); );

View file

@ -8,7 +8,7 @@ Classes = [
{ {
'cid': '{1b7db999-2ecd-4abf-bb95-a726896798ca}', 'cid': '{1b7db999-2ecd-4abf-bb95-a726896798ca}',
'contract_ids': ['@mozilla.org/fxaccounts/push;1'], 'contract_ids': ['@mozilla.org/fxaccounts/push;1'],
'esModule': 'resource://gre/modules/FxAccountsPush.sys.mjs', 'jsm': 'resource://gre/modules/FxAccountsPush.jsm',
'constructor': 'FxAccountsPushService', 'constructor': 'FxAccountsPushService',
'processes': ProcessSelector.MAIN_PROCESS_ONLY, 'processes': ProcessSelector.MAIN_PROCESS_ONLY,
'categories': {'push': 'chrome://fxa-device-update'}, 'categories': {'push': 'chrome://fxa-device-update'},

View file

@ -14,22 +14,22 @@ BROWSER_CHROME_MANIFESTS += ["tests/browser/browser.ini"]
XPCSHELL_TESTS_MANIFESTS += ["tests/xpcshell/xpcshell.ini"] XPCSHELL_TESTS_MANIFESTS += ["tests/xpcshell/xpcshell.ini"]
EXTRA_JS_MODULES += [ EXTRA_JS_MODULES += [
"Credentials.sys.mjs", "Credentials.jsm",
"FxAccounts.sys.mjs", "FxAccounts.jsm",
"FxAccountsClient.sys.mjs", "FxAccountsClient.jsm",
"FxAccountsCommands.sys.mjs", "FxAccountsCommands.js",
"FxAccountsCommon.js", "FxAccountsCommon.js",
"FxAccountsConfig.sys.mjs", "FxAccountsConfig.jsm",
"FxAccountsDevice.sys.mjs", "FxAccountsDevice.jsm",
"FxAccountsKeys.sys.mjs", "FxAccountsKeys.jsm",
"FxAccountsPairing.sys.mjs", "FxAccountsPairing.jsm",
"FxAccountsPairingChannel.sys.mjs", "FxAccountsPairingChannel.js",
"FxAccountsProfile.sys.mjs", "FxAccountsProfile.jsm",
"FxAccountsProfileClient.sys.mjs", "FxAccountsProfileClient.jsm",
"FxAccountsPush.sys.mjs", "FxAccountsPush.jsm",
"FxAccountsStorage.sys.mjs", "FxAccountsStorage.jsm",
"FxAccountsTelemetry.sys.mjs", "FxAccountsTelemetry.jsm",
"FxAccountsWebChannel.sys.mjs", "FxAccountsWebChannel.jsm",
] ]
XPCOM_MANIFESTS += [ XPCOM_MANIFESTS += [

View file

@ -1,8 +1,8 @@
/* Any copyright is dedicated to the Public Domain. /* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */ http://creativecommons.org/publicdomain/zero/1.0/ */
const { FxAccounts } = ChromeUtils.importESModule( const { FxAccounts } = ChromeUtils.import(
"resource://gre/modules/FxAccounts.sys.mjs" "resource://gre/modules/FxAccounts.jsm"
); );
const gBrowserGlue = Cc["@mozilla.org/browser/browserglue;1"].getService( const gBrowserGlue = Cc["@mozilla.org/browser/browserglue;1"].getService(

View file

@ -6,11 +6,11 @@
const { CryptoUtils } = ChromeUtils.import( const { CryptoUtils } = ChromeUtils.import(
"resource://services-crypto/utils.js" "resource://services-crypto/utils.js"
); );
const { FxAccounts } = ChromeUtils.importESModule( const { FxAccounts } = ChromeUtils.import(
"resource://gre/modules/FxAccounts.sys.mjs" "resource://gre/modules/FxAccounts.jsm"
); );
const { FxAccountsClient } = ChromeUtils.importESModule( const { FxAccountsClient } = ChromeUtils.import(
"resource://gre/modules/FxAccountsClient.sys.mjs" "resource://gre/modules/FxAccountsClient.jsm"
); );
const { const {
ERRNO_INVALID_AUTH_TOKEN, ERRNO_INVALID_AUTH_TOKEN,
@ -27,8 +27,8 @@ const { PromiseUtils } = ChromeUtils.importESModule(
); );
// We grab some additional stuff via backstage passes. // We grab some additional stuff via backstage passes.
var { AccountState } = ChromeUtils.importESModule( var { AccountState } = ChromeUtils.import(
"resource://gre/modules/FxAccounts.sys.mjs" "resource://gre/modules/FxAccounts.jsm"
); );
const MOCK_TOKEN_RESPONSE = { const MOCK_TOKEN_RESPONSE = {

View file

@ -3,8 +3,8 @@
"use strict"; "use strict";
const { FxAccounts } = ChromeUtils.importESModule( const { FxAccounts } = ChromeUtils.import(
"resource://gre/modules/FxAccounts.sys.mjs" "resource://gre/modules/FxAccounts.jsm"
); );
add_task( add_task(

View file

@ -3,14 +3,14 @@
"use strict"; "use strict";
const { FxAccounts } = ChromeUtils.importESModule( const { FxAccounts } = ChromeUtils.import(
"resource://gre/modules/FxAccounts.sys.mjs" "resource://gre/modules/FxAccounts.jsm"
); );
const { FxAccountsClient } = ChromeUtils.importESModule( const { FxAccountsClient } = ChromeUtils.import(
"resource://gre/modules/FxAccountsClient.sys.mjs" "resource://gre/modules/FxAccountsClient.jsm"
); );
const { FxAccountsDevice } = ChromeUtils.importESModule( const { FxAccountsDevice } = ChromeUtils.import(
"resource://gre/modules/FxAccountsDevice.sys.mjs" "resource://gre/modules/FxAccountsDevice.jsm"
); );
const { const {
ERRNO_DEVICE_SESSION_CONFLICT, ERRNO_DEVICE_SESSION_CONFLICT,
@ -20,8 +20,8 @@ const {
ON_DEVICE_DISCONNECTED_NOTIFICATION, ON_DEVICE_DISCONNECTED_NOTIFICATION,
ON_DEVICELIST_UPDATED, ON_DEVICELIST_UPDATED,
} = ChromeUtils.import("resource://gre/modules/FxAccountsCommon.js"); } = ChromeUtils.import("resource://gre/modules/FxAccountsCommon.js");
var { AccountState } = ChromeUtils.importESModule( var { AccountState } = ChromeUtils.import(
"resource://gre/modules/FxAccounts.sys.mjs" "resource://gre/modules/FxAccounts.jsm"
); );
initTestLogging("Trace"); initTestLogging("Trace");

View file

@ -3,8 +3,8 @@
"use strict"; "use strict";
const { FxAccountsClient } = ChromeUtils.importESModule( const { FxAccountsClient } = ChromeUtils.import(
"resource://gre/modules/FxAccountsClient.sys.mjs" "resource://gre/modules/FxAccountsClient.jsm"
); );
const FAKE_SESSION_TOKEN = const FAKE_SESSION_TOKEN =

View file

@ -3,12 +3,12 @@
"use strict"; "use strict";
const { FxAccountsCommands, SendTab } = ChromeUtils.importESModule( const { FxAccountsCommands, SendTab } = ChromeUtils.import(
"resource://gre/modules/FxAccountsCommands.sys.mjs" "resource://gre/modules/FxAccountsCommands.js"
); );
const { FxAccountsClient } = ChromeUtils.importESModule( const { FxAccountsClient } = ChromeUtils.import(
"resource://gre/modules/FxAccountsClient.sys.mjs" "resource://gre/modules/FxAccountsClient.jsm"
); );
const { COMMAND_SENDTAB, COMMAND_SENDTAB_TAIL } = ChromeUtils.import( const { COMMAND_SENDTAB, COMMAND_SENDTAB_TAIL } = ChromeUtils.import(

View file

@ -1,8 +1,8 @@
/* Any copyright is dedicated to the Public Domain. /* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */ * http://creativecommons.org/publicdomain/zero/1.0/ */
const { Credentials } = ChromeUtils.importESModule( const { Credentials } = ChromeUtils.import(
"resource://gre/modules/Credentials.sys.mjs" "resource://gre/modules/Credentials.jsm"
); );
const { CryptoUtils } = ChromeUtils.import( const { CryptoUtils } = ChromeUtils.import(
"resource://services-crypto/utils.js" "resource://services-crypto/utils.js"

View file

@ -3,8 +3,8 @@
"use strict"; "use strict";
const { getFxAccountsSingleton } = ChromeUtils.importESModule( const { getFxAccountsSingleton } = ChromeUtils.import(
"resource://gre/modules/FxAccounts.sys.mjs" "resource://gre/modules/FxAccounts.jsm"
); );
const fxAccounts = getFxAccountsSingleton(); const fxAccounts = getFxAccountsSingleton();

View file

@ -3,8 +3,8 @@
"use strict"; "use strict";
const { FxAccountsKeys } = ChromeUtils.importESModule( const { FxAccountsKeys } = ChromeUtils.import(
"resource://gre/modules/FxAccountsKeys.sys.mjs" "resource://gre/modules/FxAccountsKeys.jsm"
); );
// Ref https://github.com/mozilla/fxa-crypto-relier/ for the details // Ref https://github.com/mozilla/fxa-crypto-relier/ for the details

View file

@ -8,8 +8,8 @@
// See verbose logging from FxAccounts.jsm // See verbose logging from FxAccounts.jsm
Services.prefs.setCharPref("identity.fxaccounts.loglevel", "Trace"); Services.prefs.setCharPref("identity.fxaccounts.loglevel", "Trace");
const { FxAccounts } = ChromeUtils.importESModule( const { FxAccounts } = ChromeUtils.import(
"resource://gre/modules/FxAccounts.sys.mjs" "resource://gre/modules/FxAccounts.jsm"
); );
const { FXA_PWDMGR_HOST, FXA_PWDMGR_REALM } = ChromeUtils.import( const { FXA_PWDMGR_HOST, FXA_PWDMGR_REALM } = ChromeUtils.import(
"resource://gre/modules/FxAccountsCommon.js" "resource://gre/modules/FxAccountsCommon.js"
@ -17,8 +17,8 @@ const { FXA_PWDMGR_HOST, FXA_PWDMGR_REALM } = ChromeUtils.import(
// Use a backstage pass to get at our LoginManagerStorage object, so we can // Use a backstage pass to get at our LoginManagerStorage object, so we can
// mock the prototype. // mock the prototype.
var { LoginManagerStorage } = ChromeUtils.importESModule( var { LoginManagerStorage } = ChromeUtils.import(
"resource://gre/modules/FxAccountsStorage.sys.mjs" "resource://gre/modules/FxAccountsStorage.jsm"
); );
var isLoggedIn = true; var isLoggedIn = true;
LoginManagerStorage.prototype.__defineGetter__("_isLoggedIn", () => isLoggedIn); LoginManagerStorage.prototype.__defineGetter__("_isLoggedIn", () => isLoggedIn);

View file

@ -3,16 +3,16 @@
"use strict"; "use strict";
const { FxAccounts } = ChromeUtils.importESModule( const { FxAccounts } = ChromeUtils.import(
"resource://gre/modules/FxAccounts.sys.mjs" "resource://gre/modules/FxAccounts.jsm"
); );
const { FxAccountsClient } = ChromeUtils.importESModule( const { FxAccountsClient } = ChromeUtils.import(
"resource://gre/modules/FxAccountsClient.sys.mjs" "resource://gre/modules/FxAccountsClient.jsm"
); );
// We grab some additional stuff via backstage passes. // We grab some additional stuff via backstage passes.
var { AccountState } = ChromeUtils.importESModule( var { AccountState } = ChromeUtils.import(
"resource://gre/modules/FxAccounts.sys.mjs" "resource://gre/modules/FxAccounts.jsm"
); );
function promiseNotification(topic) { function promiseNotification(topic) {

View file

@ -3,14 +3,14 @@
"use strict"; "use strict";
const { FxAccounts } = ChromeUtils.importESModule( const { FxAccounts } = ChromeUtils.import(
"resource://gre/modules/FxAccounts.sys.mjs" "resource://gre/modules/FxAccounts.jsm"
); );
const { FxAccountsClient } = ChromeUtils.importESModule( const { FxAccountsClient } = ChromeUtils.import(
"resource://gre/modules/FxAccountsClient.sys.mjs" "resource://gre/modules/FxAccountsClient.jsm"
); );
var { AccountState } = ChromeUtils.importESModule( var { AccountState } = ChromeUtils.import(
"resource://gre/modules/FxAccounts.sys.mjs" "resource://gre/modules/FxAccounts.jsm"
); );
function promiseNotification(topic) { function promiseNotification(topic) {

View file

@ -3,8 +3,8 @@
"use strict"; "use strict";
const { FxAccountsPairingFlow } = ChromeUtils.importESModule( const { FxAccountsPairingFlow } = ChromeUtils.import(
"resource://gre/modules/FxAccountsPairing.sys.mjs" "resource://gre/modules/FxAccountsPairing.jsm"
); );
const { EventEmitter } = ChromeUtils.importESModule( const { EventEmitter } = ChromeUtils.importESModule(
"resource://gre/modules/EventEmitter.sys.mjs" "resource://gre/modules/EventEmitter.sys.mjs"

View file

@ -6,11 +6,11 @@
const { ON_PROFILE_CHANGE_NOTIFICATION, log } = ChromeUtils.import( const { ON_PROFILE_CHANGE_NOTIFICATION, log } = ChromeUtils.import(
"resource://gre/modules/FxAccountsCommon.js" "resource://gre/modules/FxAccountsCommon.js"
); );
const { FxAccountsProfileClient } = ChromeUtils.importESModule( const { FxAccountsProfileClient } = ChromeUtils.import(
"resource://gre/modules/FxAccountsProfileClient.sys.mjs" "resource://gre/modules/FxAccountsProfileClient.jsm"
); );
const { FxAccountsProfile } = ChromeUtils.importESModule( const { FxAccountsProfile } = ChromeUtils.import(
"resource://gre/modules/FxAccountsProfile.sys.mjs" "resource://gre/modules/FxAccountsProfile.jsm"
); );
const { PromiseUtils } = ChromeUtils.importESModule( const { PromiseUtils } = ChromeUtils.importESModule(
"resource://gre/modules/PromiseUtils.sys.mjs" "resource://gre/modules/PromiseUtils.sys.mjs"

View file

@ -16,9 +16,7 @@ const {
const { const {
FxAccountsProfileClient, FxAccountsProfileClient,
FxAccountsProfileClientError, FxAccountsProfileClientError,
} = ChromeUtils.importESModule( } = ChromeUtils.import("resource://gre/modules/FxAccountsProfileClient.jsm");
"resource://gre/modules/FxAccountsProfileClient.sys.mjs"
);
const STATUS_SUCCESS = 200; const STATUS_SUCCESS = 200;

View file

@ -5,6 +5,7 @@
// Tests for the FxA push service. // Tests for the FxA push service.
/* eslint-disable no-shadow */
/* eslint-disable mozilla/use-chromeutils-generateqi */ /* eslint-disable mozilla/use-chromeutils-generateqi */
const { const {
@ -21,13 +22,16 @@ const {
log, log,
} = ChromeUtils.import("resource://gre/modules/FxAccountsCommon.js"); } = ChromeUtils.import("resource://gre/modules/FxAccountsCommon.js");
const { FxAccountsPushService } = ChromeUtils.importESModule( let importScope = {};
"resource://gre/modules/FxAccountsPush.sys.mjs" Services.scriptloader.loadSubScript(
"resource://gre/modules/FxAccountsPush.jsm",
importScope
); );
const FxAccountsPushService = importScope.FxAccountsPushService;
XPCOMUtils.defineLazyServiceGetter( XPCOMUtils.defineLazyServiceGetter(
this, this,
"PushService", "pushService",
"@mozilla.org/push/Service;1", "@mozilla.org/push/Service;1",
"nsIPushService" "nsIPushService"
); );
@ -39,8 +43,8 @@ const MOCK_ENDPOINT = "http://mochi.test:8888";
// tests do not allow external connections, mock the PushService // tests do not allow external connections, mock the PushService
let mockPushService = { let mockPushService = {
pushTopic: PushService.pushTopic, pushTopic: pushService.pushTopic,
subscriptionChangeTopic: PushService.subscriptionChangeTopic, subscriptionChangeTopic: pushService.subscriptionChangeTopic,
subscribe(scope, principal, cb) { subscribe(scope, principal, cb) {
cb(Cr.NS_OK, { cb(Cr.NS_OK, {
endpoint: MOCK_ENDPOINT, endpoint: MOCK_ENDPOINT,
@ -212,8 +216,8 @@ add_task(async function observePushTopicDeviceDisconnected_current_device() {
}; };
let signoutCalled = false; let signoutCalled = false;
let { FxAccounts } = ChromeUtils.importESModule( let { FxAccounts } = ChromeUtils.import(
"resource://gre/modules/FxAccounts.sys.mjs" "resource://gre/modules/FxAccounts.jsm"
); );
const fxAccountsMock = new FxAccounts({ const fxAccountsMock = new FxAccounts({
newAccountState() { newAccountState() {
@ -268,8 +272,8 @@ add_task(async function observePushTopicDeviceDisconnected_another_device() {
}; };
let signoutCalled = false; let signoutCalled = false;
let { FxAccounts } = ChromeUtils.importESModule( let { FxAccounts } = ChromeUtils.import(
"resource://gre/modules/FxAccounts.sys.mjs" "resource://gre/modules/FxAccounts.jsm"
); );
const fxAccountsMock = new FxAccounts({ const fxAccountsMock = new FxAccounts({
newAccountState() { newAccountState() {

View file

@ -5,8 +5,8 @@
// Tests for the FxA storage manager. // Tests for the FxA storage manager.
const { FxAccountsStorageManager } = ChromeUtils.importESModule( const { FxAccountsStorageManager } = ChromeUtils.import(
"resource://gre/modules/FxAccountsStorage.sys.mjs" "resource://gre/modules/FxAccountsStorage.jsm"
); );
const { DATA_FORMAT_VERSION, log } = ChromeUtils.import( const { DATA_FORMAT_VERSION, log } = ChromeUtils.import(
"resource://gre/modules/FxAccountsCommon.js" "resource://gre/modules/FxAccountsCommon.js"

View file

@ -3,8 +3,8 @@
"use strict"; "use strict";
const { getFxAccountsSingleton } = ChromeUtils.importESModule( const { getFxAccountsSingleton } = ChromeUtils.import(
"resource://gre/modules/FxAccounts.sys.mjs" "resource://gre/modules/FxAccounts.jsm"
); );
const fxAccounts = getFxAccountsSingleton(); const fxAccounts = getFxAccountsSingleton();

View file

@ -14,9 +14,7 @@ const { CryptoUtils } = ChromeUtils.import(
const { const {
FxAccountsWebChannel, FxAccountsWebChannel,
FxAccountsWebChannelHelpers, FxAccountsWebChannelHelpers,
} = ChromeUtils.importESModule( } = ChromeUtils.import("resource://gre/modules/FxAccountsWebChannel.jsm");
"resource://gre/modules/FxAccountsWebChannel.sys.mjs"
);
const URL_STRING = "https://example.com"; const URL_STRING = "https://example.com";

View file

@ -2,16 +2,14 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; var EXPORTED_SYMBOLS = ["Downloader"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const lazy = {}; const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
RemoteSettingsWorker:
"resource://services-settings/RemoteSettingsWorker.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, { XPCOMUtils.defineLazyModuleGetters(lazy, {
RemoteSettingsWorker: "resource://services-settings/RemoteSettingsWorker.jsm",
Utils: "resource://services-settings/Utils.jsm", Utils: "resource://services-settings/Utils.jsm",
}); });
@ -94,7 +92,7 @@ class LazyRecordAndBuffer {
} }
} }
export class Downloader { class Downloader {
static get DownloadError() { static get DownloadError() {
return DownloadError; return DownloadError;
} }

View file

@ -2,7 +2,9 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const lazy = {}; const lazy = {};
@ -18,12 +20,14 @@ XPCOMUtils.defineLazyModuleGetters(lazy, {
}); });
XPCOMUtils.defineLazyGetter(lazy, "console", () => lazy.Utils.log); XPCOMUtils.defineLazyGetter(lazy, "console", () => lazy.Utils.log);
var EXPORTED_SYMBOLS = ["Database"];
/** /**
* Database is a tiny wrapper with the objective * Database is a tiny wrapper with the objective
* of providing major kinto-offline-client collection API. * of providing major kinto-offline-client collection API.
* (with the objective of getting rid of kinto-offline-client) * (with the objective of getting rid of kinto-offline-client)
*/ */
export class Database { class Database {
static destroy() { static destroy() {
return destroyIDB(); return destroyIDB();
} }

View file

@ -2,25 +2,30 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; "use strict";
import { AppConstants } from "resource://gre/modules/AppConstants.sys.mjs";
import { Downloader } from "resource://services-settings/Attachments.sys.mjs"; var EXPORTED_SYMBOLS = ["RemoteSettingsClient"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const { AppConstants } = ChromeUtils.importESModule(
"resource://gre/modules/AppConstants.sys.mjs"
);
const { Downloader } = ChromeUtils.import(
"resource://services-settings/Attachments.jsm"
);
const lazy = {}; const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
Database: "resource://services-settings/Database.sys.mjs",
RemoteSettingsWorker:
"resource://services-settings/RemoteSettingsWorker.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, { XPCOMUtils.defineLazyModuleGetters(lazy, {
ClientEnvironmentBase: ClientEnvironmentBase:
"resource://gre/modules/components-utils/ClientEnvironment.jsm", "resource://gre/modules/components-utils/ClientEnvironment.jsm",
Database: "resource://services-settings/Database.jsm",
IDBHelpers: "resource://services-settings/IDBHelpers.jsm", IDBHelpers: "resource://services-settings/IDBHelpers.jsm",
KintoHttpClient: "resource://services-common/kinto-http-client.js", KintoHttpClient: "resource://services-common/kinto-http-client.js",
ObjectUtils: "resource://gre/modules/ObjectUtils.jsm", ObjectUtils: "resource://gre/modules/ObjectUtils.jsm",
RemoteSettingsWorker: "resource://services-settings/RemoteSettingsWorker.jsm",
SharedUtils: "resource://services-settings/SharedUtils.jsm", SharedUtils: "resource://services-settings/SharedUtils.jsm",
UptakeTelemetry: "resource://services-common/uptake-telemetry.js", UptakeTelemetry: "resource://services-common/uptake-telemetry.js",
Utils: "resource://services-settings/Utils.jsm", Utils: "resource://services-settings/Utils.jsm",
@ -262,7 +267,7 @@ class AttachmentDownloader extends Downloader {
} }
} }
export class RemoteSettingsClient extends EventEmitter { class RemoteSettingsClient extends EventEmitter {
static get APIError() { static get APIError() {
return APIError; return APIError;
} }

View file

@ -1,14 +1,19 @@
/* This Source Code Form is subject to the terms of the Mozilla Public /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
var EXPORTED_SYMBOLS = ["RemoteSettingsTimer"];
const lazy = {}; const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, { ChromeUtils.defineModuleGetter(
RemoteSettings: "resource://services-settings/remote-settings.sys.mjs", lazy,
}); "RemoteSettings",
"resource://services-settings/remote-settings.js"
);
export var RemoteSettingsTimer = function() {}; var RemoteSettingsTimer = function() {};
RemoteSettingsTimer.prototype = { RemoteSettingsTimer.prototype = {
QueryInterface: ChromeUtils.generateQI(["nsITimerCallback"]), QueryInterface: ChromeUtils.generateQI(["nsITimerCallback"]),
classID: Components.ID("{5e756573-234a-49ea-bbe4-59ec7a70657d}"), classID: Components.ID("{5e756573-234a-49ea-bbe4-59ec7a70657d}"),

View file

@ -129,7 +129,7 @@ const Agent = {
/** /**
* Wrap worker invocations in order to return the `callbackId` along * Wrap worker invocations in order to return the `callbackId` along
* the result. This will allow to transform the worker invocations * the result. This will allow to transform the worker invocations
* into promises in `RemoteSettingsWorker.sys.mjs`. * into promises in `RemoteSettingsWorker.jsm`.
*/ */
self.onmessage = event => { self.onmessage = event => {
const { callbackId, method, args = [] } = event.data; const { callbackId, method, args = [] } = event.data;
@ -157,7 +157,7 @@ let gPendingTransactions = new Set();
*/ */
async function importDumpIDB(bucket, collection, records, timestamp) { async function importDumpIDB(bucket, collection, records, timestamp) {
// Open the DB. It will exist since if we are running this, it means // Open the DB. It will exist since if we are running this, it means
// we already tried to read the timestamp in `remote-settings.sys.mjs` // we already tried to read the timestamp in `remote-settings.js`
const db = await IDBHelpers.openIDB(false /* do not allow upgrades */); const db = await IDBHelpers.openIDB(false /* do not allow upgrades */);
// try...finally to ensure we always close the db. // try...finally to ensure we always close the db.

View file

@ -2,12 +2,19 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file, * License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */ * You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
/** /**
* Interface to a dedicated thread handling for Remote Settings heavy operations. * Interface to a dedicated thread handling for Remote Settings heavy operations.
*/ */
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const { setTimeout, clearTimeout } = ChromeUtils.importESModule(
"resource://gre/modules/Timer.sys.mjs"
);
import { setTimeout, clearTimeout } from "resource://gre/modules/Timer.sys.mjs"; var EXPORTED_SYMBOLS = ["RemoteSettingsWorker"];
const lazy = {}; const lazy = {};
@ -233,6 +240,6 @@ try {
gShutdown = true; gShutdown = true;
} }
export var RemoteSettingsWorker = new Worker( var RemoteSettingsWorker = new Worker(
"resource://services-settings/RemoteSettingsWorker.js" "resource://services-settings/RemoteSettingsWorker.js"
); );

View file

@ -2,7 +2,9 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const lazy = {}; const lazy = {};
@ -10,6 +12,8 @@ XPCOMUtils.defineLazyModuleGetters(lazy, {
KeyValueService: "resource://gre/modules/kvstore.jsm", KeyValueService: "resource://gre/modules/kvstore.jsm",
}); });
var EXPORTED_SYMBOLS = ["SyncHistory"];
/** /**
* A helper to keep track of synchronization statuses. * A helper to keep track of synchronization statuses.
* *
@ -17,7 +21,7 @@ XPCOMUtils.defineLazyModuleGetters(lazy, {
* because the eventual goal is to be able to detect `IndexedDB` issues and act * because the eventual goal is to be able to detect `IndexedDB` issues and act
* accordingly. * accordingly.
*/ */
export class SyncHistory { class SyncHistory {
// Internal reference to underlying rkv store. // Internal reference to underlying rkv store.
#store; #store;

View file

@ -8,7 +8,7 @@ Classes = [
{ {
'cid': '{5e756573-234a-49ea-bbe4-59ec7a70657d}', 'cid': '{5e756573-234a-49ea-bbe4-59ec7a70657d}',
'contract_ids': ['@mozilla.org/services/settings;1'], 'contract_ids': ['@mozilla.org/services/settings;1'],
'esModule': 'resource://services-settings/RemoteSettingsComponents.sys.mjs', 'jsm': 'resource://services-settings/RemoteSettingsComponents.jsm',
'constructor': 'RemoteSettingsTimer', 'constructor': 'RemoteSettingsTimer',
}, },
] ]

Some files were not shown because too many files have changed in this diff Show more