Bug 1789595 - [devtools] Migrate require to new devtools/server's ESM to ChromeUtils.importESModule. r=nchevobbe

Differential Revision: https://phabricator.services.mozilla.com/D156827
This commit is contained in:
Alexandre Poirot 2022-09-09 10:13:15 +00:00
Родитель 393e94ddf0
Коммит 3c1d82f3c1
11 изменённых файлов: 39 добавлений и 37 удалений

Просмотреть файл

@ -5,12 +5,12 @@
"use strict";
const { Pool } = require("devtools/shared/protocol/Pool");
const {
isWindowGlobalPartOfContext,
} = require("devtools/server/actors/watcher/browsing-context-helpers.jsm");
const {
WatcherRegistry,
} = require("devtools/server/actors/watcher/WatcherRegistry.jsm");
const { isWindowGlobalPartOfContext } = ChromeUtils.importESModule(
"resource://devtools/server/actors/watcher/browsing-context-helpers.sys.mjs"
);
const { WatcherRegistry } = ChromeUtils.importESModule(
"resource://devtools/server/actors/watcher/WatcherRegistry.sys.mjs"
);
const Targets = require("devtools/server/actors/targets/index");
loader.lazyRequireGetter(

Просмотреть файл

@ -12,9 +12,9 @@ const isEveryFrameTargetEnabled = Services.prefs.getBoolPref(
"devtools.every-frame-target.enabled",
false
);
const {
getAllBrowsingContextsForContext,
} = require("devtools/server/actors/watcher/browsing-context-helpers.jsm");
const { getAllBrowsingContextsForContext } = ChromeUtils.importESModule(
"resource://devtools/server/actors/watcher/browsing-context-helpers.sys.mjs"
);
const {
WILL_NAVIGATE_TIME_SHIFT,
} = require("devtools/server/actors/webconsole/listeners/document-events");

Просмотреть файл

@ -11,7 +11,7 @@ const { Ci } = require("chrome");
loader.lazyRequireGetter(
this,
"getAddonIdForWindowGlobal",
"devtools/server/actors/watcher/browsing-context-helpers.jsm",
"devtools/server/actors/watcher/browsing-context-helpers.sys.mjs",
true
);

Просмотреть файл

@ -9,7 +9,9 @@ const EventEmitter = require("devtools/shared/event-emitter");
const {
getAllBrowsingContextsForContext,
isWindowGlobalPartOfContext,
} = require("devtools/server/actors/watcher/browsing-context-helpers.jsm");
} = ChromeUtils.importESModule(
"resource://devtools/server/actors/watcher/browsing-context-helpers.sys.mjs"
);
// ms of delay to throttle updates
const BATCH_DELAY = 200;

Просмотреть файл

@ -22,7 +22,7 @@ loader.lazyGetter(this, "ExtensionStorageIDB", () => {
loader.lazyRequireGetter(
this,
"getAddonIdForWindowGlobal",
"devtools/server/actors/watcher/browsing-context-helpers.jsm",
"devtools/server/actors/watcher/browsing-context-helpers.sys.mjs",
true
);

Просмотреть файл

@ -12,9 +12,9 @@ const {
const {
SessionDataHelpers,
} = require("devtools/server/actors/watcher/SessionDataHelpers.jsm");
const {
isBrowsingContextPartOfContext,
} = require("devtools/server/actors/watcher/browsing-context-helpers.jsm");
const { isBrowsingContextPartOfContext } = ChromeUtils.importESModule(
"resource://devtools/server/actors/watcher/browsing-context-helpers.sys.mjs"
);
const { SUPPORTED_DATA } = SessionDataHelpers;
const { TARGET_CONFIGURATION } = SUPPORTED_DATA;

Просмотреть файл

@ -28,9 +28,9 @@ const {
const Targets = require("devtools/server/actors/targets/index");
const Resources = require("devtools/server/actors/resources/index");
const TargetActorMixin = require("devtools/server/actors/targets/target-actor-mixin");
const {
TargetActorRegistry,
} = require("resource://devtools/server/actors/targets/target-actor-registry.jsm");
const { TargetActorRegistry } = ChromeUtils.importESModule(
"resource://devtools/server/actors/targets/target-actor-registry.sys.mjs"
);
loader.lazyRequireGetter(
this,

Просмотреть файл

@ -40,7 +40,7 @@ loader.lazyRequireGetter(
loader.lazyRequireGetter(
this,
"getAddonIdForWindowGlobal",
"devtools/server/actors/watcher/browsing-context-helpers.jsm",
"devtools/server/actors/watcher/browsing-context-helpers.sys.mjs",
true
);

Просмотреть файл

@ -7,16 +7,16 @@ const protocol = require("devtools/shared/protocol");
const { watcherSpec } = require("devtools/shared/specs/watcher");
const Resources = require("devtools/server/actors/resources/index");
const {
TargetActorRegistry,
} = require("devtools/server/actors/targets/target-actor-registry.jsm");
const {
WatcherRegistry,
} = require("devtools/server/actors/watcher/WatcherRegistry.jsm");
const { TargetActorRegistry } = ChromeUtils.importESModule(
"resource://devtools/server/actors/targets/target-actor-registry.sys.mjs"
);
const { WatcherRegistry } = ChromeUtils.importESModule(
"resource://devtools/server/actors/watcher/WatcherRegistry.sys.mjs"
);
const Targets = require("devtools/server/actors/targets/index");
const {
getAllBrowsingContextsForContext,
} = require("devtools/server/actors/watcher/browsing-context-helpers.jsm");
const { getAllBrowsingContextsForContext } = ChromeUtils.importESModule(
"resource://devtools/server/actors/watcher/browsing-context-helpers.sys.mjs"
);
const TARGET_HELPERS = {};
loader.lazyRequireGetter(

Просмотреть файл

@ -4,12 +4,12 @@
"use strict";
const {
WatcherRegistry,
} = require("devtools/server/actors/watcher/WatcherRegistry.jsm");
const {
WindowGlobalLogger,
} = require("devtools/server/connectors/js-window-actor/WindowGlobalLogger.jsm");
const { WatcherRegistry } = ChromeUtils.importESModule(
"resource://devtools/server/actors/watcher/WatcherRegistry.sys.mjs"
);
const { WindowGlobalLogger } = ChromeUtils.importESModule(
"resource://devtools/server/connectors/js-window-actor/WindowGlobalLogger.sys.mjs"
);
const Targets = require("devtools/server/actors/targets/index");
const browsingContextAttachedObserverByWatcher = new Map();

Просмотреть файл

@ -4,9 +4,9 @@
"use strict";
const {
WatcherRegistry,
} = require("devtools/server/actors/watcher/WatcherRegistry.jsm");
const { WatcherRegistry } = ChromeUtils.importESModule(
"resource://devtools/server/actors/watcher/WatcherRegistry.sys.mjs"
);
loader.lazyRequireGetter(
this,