diff --git a/browser/components/firefoxview/helpers.mjs b/browser/components/firefoxview/helpers.mjs index 15815293774c..ae0acc86f2d1 100644 --- a/browser/components/firefoxview/helpers.mjs +++ b/browser/components/firefoxview/helpers.mjs @@ -2,8 +2,6 @@ * 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/. */ -const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm"); - const lazy = {}; ChromeUtils.defineModuleGetter( lazy, diff --git a/browser/components/firefoxview/tab-pickup-list.mjs b/browser/components/firefoxview/tab-pickup-list.mjs index ebbe5d6cb93a..386c578d7449 100644 --- a/browser/components/firefoxview/tab-pickup-list.mjs +++ b/browser/components/firefoxview/tab-pickup-list.mjs @@ -4,7 +4,6 @@ "use strict"; -const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm"); const lazy = {}; ChromeUtils.defineModuleGetter( lazy, diff --git a/browser/components/firefoxview/tabs-pickup.mjs b/browser/components/firefoxview/tabs-pickup.mjs index d433cd780e04..13e03d36a746 100644 --- a/browser/components/firefoxview/tabs-pickup.mjs +++ b/browser/components/firefoxview/tabs-pickup.mjs @@ -23,7 +23,6 @@ const tabsSetupFlowManager = new (class { this.sync = {}; XPCOMUtils.defineLazyModuleGetters(this, { - Services: "resource://gre/modules/Services.jsm", SyncedTabs: "resource://services-sync/SyncedTabs.jsm", }); XPCOMUtils.defineLazyGetter(this, "fxAccounts", () => { @@ -103,17 +102,17 @@ const tabsSetupFlowManager = new (class { async initialize(elem) { this.elem = elem; this.elem.addEventListener("click", this); - this.Services.obs.addObserver(this, this.sync.UIState.ON_UPDATE); - this.Services.obs.addObserver(this, "fxaccounts:device_connected"); - this.Services.obs.addObserver(this, "fxaccounts:device_disconnected"); + Services.obs.addObserver(this, this.sync.UIState.ON_UPDATE); + Services.obs.addObserver(this, "fxaccounts:device_connected"); + Services.obs.addObserver(this, "fxaccounts:device_disconnected"); await this.fxAccounts.getSignedInUser(); this.maybeUpdateUI(); } uninit() { - this.Services.obs.removeObserver(this, this.sync.UIState.ON_UPDATE); - this.Services.obs.removeObserver(this, "fxaccounts:device_connected"); - this.Services.obs.removeObserver(this, "fxaccounts:device_disconnected"); + Services.obs.removeObserver(this, this.sync.UIState.ON_UPDATE); + Services.obs.removeObserver(this, "fxaccounts:device_connected"); + Services.obs.removeObserver(this, "fxaccounts:device_disconnected"); } get fxaSignedIn() { return ( @@ -201,7 +200,7 @@ const tabsSetupFlowManager = new (class { syncOpenTabs(containerElem) { // Flip the pref on. // The observer should trigger re-evaluating state and advance to next step - this.Services.prefs.setBoolPref(SYNC_TABS_PREF, true); + Services.prefs.setBoolPref(SYNC_TABS_PREF, true); } })(); @@ -210,9 +209,6 @@ class TabsPickupContainer extends HTMLElement { super(); this.manager = null; this._currentSetupStateIndex = -1; - XPCOMUtils.defineLazyModuleGetters(this, { - Services: "resource://gre/modules/Services.jsm", - }); } get setupContainerElem() { return this.querySelector(".sync-setup-container"); @@ -251,7 +247,7 @@ class TabsPickupContainer extends HTMLElement { } for (let elem of cloned.querySelectorAll("a[data-support-url]")) { elem.href = - this.Services.urlFormatter.formatURLPref("app.support.baseURL") + + Services.urlFormatter.formatURLPref("app.support.baseURL") + elem.dataset.supportUrl; } } diff --git a/devtools/client/performance-new/popup/menu-button.jsm.js b/devtools/client/performance-new/popup/menu-button.jsm.js index 35e9fd5ef280..c46948689f94 100644 --- a/devtools/client/performance-new/popup/menu-button.jsm.js +++ b/devtools/client/performance-new/popup/menu-button.jsm.js @@ -18,7 +18,6 @@ const { createLazyLoaders } = ChromeUtils.import( ); const lazy = createLazyLoaders({ - Services: () => ChromeUtils.import("resource://gre/modules/Services.jsm"), CustomizableUI: () => ChromeUtils.import("resource:///modules/CustomizableUI.jsm"), CustomizableWidgets: () => @@ -99,7 +98,6 @@ function openPopup(document) { function initialize(toggleProfilerKeyShortcuts) { const { CustomizableUI } = lazy.CustomizableUI(); const { CustomizableWidgets } = lazy.CustomizableWidgets(); - const { Services } = lazy.Services(); const widget = CustomizableUI.getWidget(WIDGET_ID); if (widget && widget.provider == CustomizableUI.PROVIDER_API) { diff --git a/devtools/client/performance-new/popup/panel.jsm.js b/devtools/client/performance-new/popup/panel.jsm.js index f3d9bae993f9..e7e1030cc5f5 100644 --- a/devtools/client/performance-new/popup/panel.jsm.js +++ b/devtools/client/performance-new/popup/panel.jsm.js @@ -24,7 +24,6 @@ const { createLazyLoaders } = ChromeUtils.import( ); const lazy = createLazyLoaders({ - Services: () => ChromeUtils.import("resource://gre/modules/Services.jsm"), PanelMultiView: () => ChromeUtils.import("resource:///modules/PanelMultiView.jsm"), Background: () => @@ -117,7 +116,6 @@ function createViewControllers(state, elements) { }, updatePresets() { - const { Services } = lazy.Services(); const { presets, getRecordingSettings } = lazy.Background(); const { presetName } = getRecordingSettings( "aboutprofiling", @@ -146,8 +144,6 @@ function createViewControllers(state, elements) { }, updateProfilerState() { - const { Services } = lazy.Services(); - if (Services.profiler.IsActive()) { elements.inactive.hidden = true; elements.active.hidden = false; @@ -170,7 +166,6 @@ function createViewControllers(state, elements) { return; } - const { Services } = lazy.Services(); const { presets } = lazy.Background(); const currentPreset = Services.prefs.getCharPref( "devtools.performance.recording.preset" @@ -327,8 +322,6 @@ function addPopupEventHandlers(state, elements, view) { }); // Update the view when the profiler starts/stops. - const { Services } = lazy.Services(); - // These are all events that can affect the current state of the profiler. const events = ["profiler-started", "profiler-stopped"]; for (const event of events) {