forked from mirrors/gecko-dev
Bug 1790468 - [remote] Convert /remote/shared JSM modules to ESM r=webdriver-reviewers,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D158293
This commit is contained in:
parent
ddbec758d4
commit
d1f7dbe55e
146 changed files with 689 additions and 976 deletions
|
|
@ -169,7 +169,7 @@ remote/cdp/test/browser/chrome-remote-interface.js
|
|||
remote/marionette/atom.js
|
||||
|
||||
# This file explicitly has a syntax error and cannot be parsed by eslint.
|
||||
remote/shared/messagehandler/test/browser/resources/modules/root/invalid.jsm
|
||||
remote/shared/messagehandler/test/browser/resources/modules/root/invalid.sys.mjs
|
||||
|
||||
# services/ exclusions
|
||||
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ const intermittently_loaded_scripts = {
|
|||
|
||||
// Test related
|
||||
"chrome://remote/content/marionette/actors/MarionetteEventsChild.jsm",
|
||||
"chrome://remote/content/shared/Log.jsm",
|
||||
"chrome://remote/content/shared/Log.sys.mjs",
|
||||
"resource://testing-common/BrowserTestUtilsChild.jsm",
|
||||
"resource://testing-common/ContentEventListenerChild.jsm",
|
||||
"resource://specialpowers/AppTestDelegateChild.jsm",
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ const intermittently_loaded_scripts = {
|
|||
|
||||
// Test related
|
||||
"chrome://remote/content/marionette/actors/MarionetteEventsChild.jsm",
|
||||
"chrome://remote/content/shared/Log.jsm",
|
||||
"chrome://remote/content/shared/Log.sys.mjs",
|
||||
"resource://testing-common/BrowserTestUtilsChild.jsm",
|
||||
"resource://testing-common/ContentEventListenerChild.jsm",
|
||||
"resource://specialpowers/SpecialPowersChild.jsm",
|
||||
|
|
|
|||
|
|
@ -12,11 +12,14 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
|
|||
|
||||
const lazy = {};
|
||||
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
Log: "chrome://remote/content/shared/Log.sys.mjs",
|
||||
RecommendedPreferences:
|
||||
"chrome://remote/content/shared/RecommendedPreferences.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
JSONHandler: "chrome://remote/content/cdp/JSONHandler.jsm",
|
||||
Log: "chrome://remote/content/shared/Log.jsm",
|
||||
RecommendedPreferences:
|
||||
"chrome://remote/content/shared/RecommendedPreferences.jsm",
|
||||
TargetList: "chrome://remote/content/cdp/targets/TargetList.jsm",
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -10,14 +10,17 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
|
|||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
||||
);
|
||||
|
||||
const { WebSocketConnection } = ChromeUtils.import(
|
||||
"chrome://remote/content/shared/WebSocketConnection.jsm"
|
||||
const { WebSocketConnection } = ChromeUtils.importESModule(
|
||||
"chrome://remote/content/shared/WebSocketConnection.sys.mjs"
|
||||
);
|
||||
|
||||
const lazy = {};
|
||||
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
Log: "chrome://remote/content/shared/Log.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
Log: "chrome://remote/content/shared/Log.jsm",
|
||||
UnknownMethodError: "chrome://remote/content/cdp/Error.jsm",
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -17,8 +17,8 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
|
|||
|
||||
const lazy = {};
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
Log: "chrome://remote/content/shared/Log.jsm",
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
Log: "chrome://remote/content/shared/Log.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyGetter(lazy, "logger", () =>
|
||||
|
|
|
|||
|
|
@ -12,10 +12,13 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
|
|||
|
||||
const lazy = {};
|
||||
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
Log: "chrome://remote/content/shared/Log.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
HTTP_404: "chrome://remote/content/server/HTTPD.jsm",
|
||||
HTTP_505: "chrome://remote/content/server/HTTPD.jsm",
|
||||
Log: "chrome://remote/content/shared/Log.jsm",
|
||||
Protocol: "chrome://remote/content/cdp/Protocol.jsm",
|
||||
RemoteAgentError: "chrome://remote/content/cdp/Error.jsm",
|
||||
});
|
||||
|
|
|
|||
|
|
@ -6,18 +6,14 @@
|
|||
|
||||
var EXPORTED_SYMBOLS = ["Emulation"];
|
||||
|
||||
var { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
||||
);
|
||||
|
||||
const { ContentProcessDomain } = ChromeUtils.import(
|
||||
"chrome://remote/content/cdp/domains/ContentProcessDomain.jsm"
|
||||
);
|
||||
|
||||
const lazy = {};
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
AnimationFramePromise: "chrome://remote/content/shared/Sync.jsm",
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
AnimationFramePromise: "chrome://remote/content/shared/Sync.sys.mjs",
|
||||
});
|
||||
|
||||
class Emulation extends ContentProcessDomain {
|
||||
|
|
|
|||
|
|
@ -19,8 +19,11 @@ const { ContentProcessDomain } = ChromeUtils.import(
|
|||
|
||||
const lazy = {};
|
||||
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
executeSoon: "chrome://remote/content/shared/Sync.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
executeSoon: "chrome://remote/content/shared/Sync.jsm",
|
||||
ExecutionContext:
|
||||
"chrome://remote/content/cdp/domains/content/runtime/ExecutionContext.jsm",
|
||||
});
|
||||
|
|
|
|||
|
|
@ -16,6 +16,12 @@ const { Domain } = ChromeUtils.import(
|
|||
|
||||
const lazy = {};
|
||||
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
PollPromise: "chrome://remote/content/shared/Sync.sys.mjs",
|
||||
TabManager: "chrome://remote/content/shared/TabManager.sys.mjs",
|
||||
windowManager: "chrome://remote/content/shared/WindowManager.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
clearInterval: "resource://gre/modules/Timer.jsm",
|
||||
OS: "resource://gre/modules/osfile.jsm",
|
||||
|
|
@ -24,11 +30,8 @@ XPCOMUtils.defineLazyModuleGetters(lazy, {
|
|||
|
||||
DialogHandler:
|
||||
"chrome://remote/content/cdp/domains/parent/page/DialogHandler.jsm",
|
||||
PollPromise: "chrome://remote/content/shared/Sync.jsm",
|
||||
streamRegistry: "chrome://remote/content/cdp/domains/parent/IO.jsm",
|
||||
TabManager: "chrome://remote/content/shared/TabManager.jsm",
|
||||
UnsupportedError: "chrome://remote/content/cdp/Error.jsm",
|
||||
windowManager: "chrome://remote/content/shared/WindowManager.jsm",
|
||||
});
|
||||
|
||||
const MAX_CANVAS_DIMENSION = 32767;
|
||||
|
|
|
|||
|
|
@ -16,15 +16,18 @@ const { Domain } = ChromeUtils.import(
|
|||
|
||||
const lazy = {};
|
||||
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
TabManager: "chrome://remote/content/shared/TabManager.sys.mjs",
|
||||
windowManager: "chrome://remote/content/shared/WindowManager.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
ContextualIdentityService:
|
||||
"resource://gre/modules/ContextualIdentityService.jsm",
|
||||
|
||||
MainProcessTarget:
|
||||
"chrome://remote/content/cdp/targets/MainProcessTarget.jsm",
|
||||
TabManager: "chrome://remote/content/shared/TabManager.jsm",
|
||||
TabSession: "chrome://remote/content/cdp/sessions/TabSession.jsm",
|
||||
windowManager: "chrome://remote/content/shared/WindowManager.jsm",
|
||||
});
|
||||
|
||||
let browserContextIds = 1;
|
||||
|
|
|
|||
|
|
@ -31,10 +31,12 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
|
|||
|
||||
const lazy = {};
|
||||
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
executeSoon: "chrome://remote/content/shared/Sync.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
EventEmitter: "resource://gre/modules/EventEmitter.jsm",
|
||||
|
||||
executeSoon: "chrome://remote/content/shared/Sync.jsm",
|
||||
});
|
||||
|
||||
class ContextObserver {
|
||||
|
|
|
|||
|
|
@ -12,10 +12,12 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
|
|||
|
||||
const lazy = {};
|
||||
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
EventPromise: "chrome://remote/content/shared/Sync.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
EventEmitter: "resource://gre/modules/EventEmitter.jsm",
|
||||
|
||||
EventPromise: "chrome://remote/content/shared/Sync.jsm",
|
||||
});
|
||||
|
||||
// TODO(ato):
|
||||
|
|
|
|||
|
|
@ -16,9 +16,12 @@ const { Target } = ChromeUtils.import(
|
|||
|
||||
const lazy = {};
|
||||
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
TabManager: "chrome://remote/content/shared/TabManager.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
RemoteAgent: "chrome://remote/content/components/RemoteAgent.jsm",
|
||||
TabManager: "chrome://remote/content/shared/TabManager.jsm",
|
||||
TabSession: "chrome://remote/content/cdp/sessions/TabSession.jsm",
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -12,11 +12,15 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
|
|||
|
||||
const lazy = {};
|
||||
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
TabManager: "chrome://remote/content/shared/TabManager.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
EventEmitter: "resource://gre/modules/EventEmitter.jsm",
|
||||
|
||||
MainProcessTarget:
|
||||
"chrome://remote/content/cdp/targets/MainProcessTarget.jsm",
|
||||
TabManager: "chrome://remote/content/shared/TabManager.jsm",
|
||||
TabObserver: "chrome://remote/content/cdp/observers/TargetObserver.jsm",
|
||||
TabTarget: "chrome://remote/content/cdp/targets/TabTarget.jsm",
|
||||
});
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@ const { RemoteAgent } = ChromeUtils.import(
|
|||
const { RemoteAgentError } = ChromeUtils.import(
|
||||
"chrome://remote/content/cdp/Error.jsm"
|
||||
);
|
||||
const { TabManager } = ChromeUtils.import(
|
||||
"chrome://remote/content/shared/TabManager.jsm"
|
||||
const { TabManager } = ChromeUtils.importESModule(
|
||||
"chrome://remote/content/shared/TabManager.sys.mjs"
|
||||
);
|
||||
|
||||
const TIMEOUT_MULTIPLIER = SpecialPowers.isDebugBuild ? 4 : 1;
|
||||
|
|
|
|||
|
|
@ -13,8 +13,8 @@ Services.scriptloader.loadSubScript(
|
|||
const { Input: I } = ChromeUtils.import(
|
||||
"chrome://remote/content/cdp/domains/parent/Input.jsm"
|
||||
);
|
||||
const { AppInfo } = ChromeUtils.import(
|
||||
"chrome://remote/content/shared/AppInfo.jsm"
|
||||
const { AppInfo } = ChromeUtils.importESModule(
|
||||
"chrome://remote/content/shared/AppInfo.sys.mjs"
|
||||
);
|
||||
|
||||
const { alt, ctrl, meta, shift } = I.Modifier;
|
||||
|
|
|
|||
|
|
@ -17,8 +17,8 @@ const {
|
|||
setTimeout,
|
||||
} = ChromeUtils.import("resource://gre/modules/Timer.jsm");
|
||||
|
||||
const { PollPromise } = ChromeUtils.import(
|
||||
"chrome://remote/content/shared/Sync.jsm"
|
||||
const { PollPromise } = ChromeUtils.importESModule(
|
||||
"chrome://remote/content/shared/Sync.sys.mjs"
|
||||
);
|
||||
|
||||
const BASE_ORIGIN = "https://example.com";
|
||||
|
|
|
|||
|
|
@ -12,14 +12,18 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
|
|||
|
||||
const lazy = {};
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
Deferred: "chrome://remote/content/shared/Sync.jsm",
|
||||
EnvironmentPrefs: "chrome://remote/content/marionette/prefs.js",
|
||||
Log: "chrome://remote/content/shared/Log.jsm",
|
||||
MarionettePrefs: "chrome://remote/content/marionette/prefs.js",
|
||||
Preferences: "resource://gre/modules/Preferences.jsm",
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
Deferred: "chrome://remote/content/shared/Sync.sys.mjs",
|
||||
Log: "chrome://remote/content/shared/Log.sys.mjs",
|
||||
RecommendedPreferences:
|
||||
"chrome://remote/content/shared/RecommendedPreferences.jsm",
|
||||
"chrome://remote/content/shared/RecommendedPreferences.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
Preferences: "resource://gre/modules/Preferences.jsm",
|
||||
|
||||
EnvironmentPrefs: "chrome://remote/content/marionette/prefs.js",
|
||||
MarionettePrefs: "chrome://remote/content/marionette/prefs.js",
|
||||
TCPListener: "chrome://remote/content/marionette/server.js",
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -12,11 +12,14 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
|
|||
|
||||
const lazy = {};
|
||||
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
Deferred: "chrome://remote/content/shared/Sync.sys.mjs",
|
||||
Log: "chrome://remote/content/shared/Log.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
CDP: "chrome://remote/content/cdp/CDP.jsm",
|
||||
Deferred: "chrome://remote/content/shared/Sync.jsm",
|
||||
HttpServer: "chrome://remote/content/server/HTTPD.jsm",
|
||||
Log: "chrome://remote/content/shared/Log.jsm",
|
||||
WebDriverBiDi: "chrome://remote/content/webdriver-bidi/WebDriverBiDi.jsm",
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -13,48 +13,48 @@ remote.jar:
|
|||
content/server/WebSocketTransport.jsm (server/WebSocketTransport.jsm)
|
||||
|
||||
# shared modules (all protocols)
|
||||
content/shared/AppInfo.jsm (shared/AppInfo.jsm)
|
||||
content/shared/Format.jsm (shared/Format.jsm)
|
||||
content/shared/Log.jsm (shared/Log.jsm)
|
||||
content/shared/MobileTabBrowser.jsm (shared/MobileTabBrowser.jsm)
|
||||
content/shared/Navigate.jsm (shared/Navigate.jsm)
|
||||
content/shared/PDF.jsm (shared/PDF.jsm)
|
||||
content/shared/RecommendedPreferences.jsm (shared/RecommendedPreferences.jsm)
|
||||
content/shared/RemoteError.jsm (shared/RemoteError.jsm)
|
||||
content/shared/Stack.jsm (shared/Stack.jsm)
|
||||
content/shared/Sync.jsm (shared/Sync.jsm)
|
||||
content/shared/TabManager.jsm (shared/TabManager.jsm)
|
||||
content/shared/WebSocketConnection.jsm (shared/WebSocketConnection.jsm)
|
||||
content/shared/WindowManager.jsm (shared/WindowManager.jsm)
|
||||
content/shared/listeners/BrowsingContextListener.jsm (shared/listeners/BrowsingContextListener.jsm)
|
||||
content/shared/listeners/ConsoleAPIListener.jsm (shared/listeners/ConsoleAPIListener.jsm)
|
||||
content/shared/listeners/ConsoleListener.jsm (shared/listeners/ConsoleListener.jsm)
|
||||
content/shared/listeners/LoadListener.jsm (shared/listeners/LoadListener.jsm)
|
||||
content/shared/AppInfo.sys.mjs (shared/AppInfo.sys.mjs)
|
||||
content/shared/Format.sys.mjs (shared/Format.sys.mjs)
|
||||
content/shared/Log.sys.mjs (shared/Log.sys.mjs)
|
||||
content/shared/MobileTabBrowser.sys.mjs (shared/MobileTabBrowser.sys.mjs)
|
||||
content/shared/Navigate.sys.mjs (shared/Navigate.sys.mjs)
|
||||
content/shared/PDF.sys.mjs (shared/PDF.sys.mjs)
|
||||
content/shared/RecommendedPreferences.sys.mjs (shared/RecommendedPreferences.sys.mjs)
|
||||
content/shared/RemoteError.sys.mjs (shared/RemoteError.sys.mjs)
|
||||
content/shared/Stack.sys.mjs (shared/Stack.sys.mjs)
|
||||
content/shared/Sync.sys.mjs (shared/Sync.sys.mjs)
|
||||
content/shared/TabManager.sys.mjs (shared/TabManager.sys.mjs)
|
||||
content/shared/WebSocketConnection.sys.mjs (shared/WebSocketConnection.sys.mjs)
|
||||
content/shared/WindowManager.sys.mjs (shared/WindowManager.sys.mjs)
|
||||
content/shared/listeners/BrowsingContextListener.sys.mjs (shared/listeners/BrowsingContextListener.sys.mjs)
|
||||
content/shared/listeners/ConsoleAPIListener.sys.mjs (shared/listeners/ConsoleAPIListener.sys.mjs)
|
||||
content/shared/listeners/ConsoleListener.sys.mjs (shared/listeners/ConsoleListener.sys.mjs)
|
||||
content/shared/listeners/LoadListener.sys.mjs (shared/listeners/LoadListener.sys.mjs)
|
||||
|
||||
# shared modules (messagehandler architecture)
|
||||
content/shared/messagehandler/Errors.jsm (shared/messagehandler/Errors.jsm)
|
||||
content/shared/messagehandler/EventsDispatcher.jsm (shared/messagehandler/EventsDispatcher.jsm)
|
||||
content/shared/messagehandler/MessageHandler.jsm (shared/messagehandler/MessageHandler.jsm)
|
||||
content/shared/messagehandler/MessageHandlerRegistry.jsm (shared/messagehandler/MessageHandlerRegistry.jsm)
|
||||
content/shared/messagehandler/Module.jsm (shared/messagehandler/Module.jsm)
|
||||
content/shared/messagehandler/ModuleCache.jsm (shared/messagehandler/ModuleCache.jsm)
|
||||
content/shared/messagehandler/RootMessageHandler.jsm (shared/messagehandler/RootMessageHandler.jsm)
|
||||
content/shared/messagehandler/RootMessageHandlerRegistry.jsm (shared/messagehandler/RootMessageHandlerRegistry.jsm)
|
||||
content/shared/messagehandler/WindowGlobalMessageHandler.jsm (shared/messagehandler/WindowGlobalMessageHandler.jsm)
|
||||
content/shared/messagehandler/sessiondata/SessionData.jsm (shared/messagehandler/sessiondata/SessionData.jsm)
|
||||
content/shared/messagehandler/sessiondata/SessionDataReader.jsm (shared/messagehandler/sessiondata/SessionDataReader.jsm)
|
||||
content/shared/messagehandler/transports/js-window-actors/MessageHandlerFrameActor.jsm (shared/messagehandler/transports/js-window-actors/MessageHandlerFrameActor.jsm)
|
||||
content/shared/messagehandler/transports/js-window-actors/MessageHandlerFrameChild.jsm (shared/messagehandler/transports/js-window-actors/MessageHandlerFrameChild.jsm)
|
||||
content/shared/messagehandler/transports/js-window-actors/MessageHandlerFrameParent.jsm (shared/messagehandler/transports/js-window-actors/MessageHandlerFrameParent.jsm)
|
||||
content/shared/messagehandler/transports/FrameContextUtils.jsm (shared/messagehandler/transports/FrameContextUtils.jsm)
|
||||
content/shared/messagehandler/transports/FrameTransport.jsm (shared/messagehandler/transports/FrameTransport.jsm)
|
||||
content/shared/messagehandler/Errors.sys.mjs (shared/messagehandler/Errors.sys.mjs)
|
||||
content/shared/messagehandler/EventsDispatcher.sys.mjs (shared/messagehandler/EventsDispatcher.sys.mjs)
|
||||
content/shared/messagehandler/MessageHandler.sys.mjs (shared/messagehandler/MessageHandler.sys.mjs)
|
||||
content/shared/messagehandler/MessageHandlerRegistry.sys.mjs (shared/messagehandler/MessageHandlerRegistry.sys.mjs)
|
||||
content/shared/messagehandler/Module.sys.mjs (shared/messagehandler/Module.sys.mjs)
|
||||
content/shared/messagehandler/ModuleCache.sys.mjs (shared/messagehandler/ModuleCache.sys.mjs)
|
||||
content/shared/messagehandler/RootMessageHandler.sys.mjs (shared/messagehandler/RootMessageHandler.sys.mjs)
|
||||
content/shared/messagehandler/RootMessageHandlerRegistry.sys.mjs (shared/messagehandler/RootMessageHandlerRegistry.sys.mjs)
|
||||
content/shared/messagehandler/WindowGlobalMessageHandler.sys.mjs (shared/messagehandler/WindowGlobalMessageHandler.sys.mjs)
|
||||
content/shared/messagehandler/sessiondata/SessionData.sys.mjs (shared/messagehandler/sessiondata/SessionData.sys.mjs)
|
||||
content/shared/messagehandler/sessiondata/SessionDataReader.sys.mjs (shared/messagehandler/sessiondata/SessionDataReader.sys.mjs)
|
||||
content/shared/messagehandler/transports/js-window-actors/MessageHandlerFrameActor.sys.mjs (shared/messagehandler/transports/js-window-actors/MessageHandlerFrameActor.sys.mjs)
|
||||
content/shared/messagehandler/transports/js-window-actors/MessageHandlerFrameChild.sys.mjs (shared/messagehandler/transports/js-window-actors/MessageHandlerFrameChild.sys.mjs)
|
||||
content/shared/messagehandler/transports/js-window-actors/MessageHandlerFrameParent.sys.mjs (shared/messagehandler/transports/js-window-actors/MessageHandlerFrameParent.sys.mjs)
|
||||
content/shared/messagehandler/transports/FrameContextUtils.sys.mjs (shared/messagehandler/transports/FrameContextUtils.sys.mjs)
|
||||
content/shared/messagehandler/transports/FrameTransport.sys.mjs (shared/messagehandler/transports/FrameTransport.sys.mjs)
|
||||
|
||||
# shared modules (WebDriver HTTP / BiDi only)
|
||||
content/shared/webdriver/Assert.jsm (shared/webdriver/Assert.jsm)
|
||||
content/shared/webdriver/Capabilities.jsm (shared/webdriver/Capabilities.jsm)
|
||||
content/shared/webdriver/Errors.jsm (shared/webdriver/Errors.jsm)
|
||||
content/shared/webdriver/KeyData.jsm (shared/webdriver/KeyData.jsm)
|
||||
content/shared/webdriver/Session.jsm (shared/webdriver/Session.jsm)
|
||||
content/shared/webdriver/Assert.sys.mjs (shared/webdriver/Assert.sys.mjs)
|
||||
content/shared/webdriver/Capabilities.sys.mjs (shared/webdriver/Capabilities.sys.mjs)
|
||||
content/shared/webdriver/Errors.sys.mjs (shared/webdriver/Errors.sys.mjs)
|
||||
content/shared/webdriver/KeyData.sys.mjs (shared/webdriver/KeyData.sys.mjs)
|
||||
content/shared/webdriver/Session.sys.mjs (shared/webdriver/Session.sys.mjs)
|
||||
|
||||
# imports from external folders
|
||||
content/external/EventUtils.js (../testing/mochitest/tests/SimpleTest/EventUtils.js)
|
||||
|
|
|
|||
|
|
@ -12,9 +12,9 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
|
|||
|
||||
const lazy = {};
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
error: "chrome://remote/content/shared/webdriver/Errors.jsm",
|
||||
Log: "chrome://remote/content/shared/Log.jsm",
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
error: "chrome://remote/content/shared/webdriver/Errors.sys.mjs",
|
||||
Log: "chrome://remote/content/shared/Log.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyGetter(lazy, "logger", () =>
|
||||
|
|
|
|||
|
|
@ -15,15 +15,18 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
|
|||
|
||||
const lazy = {};
|
||||
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
AppInfo: "chrome://remote/content/shared/AppInfo.sys.mjs",
|
||||
assert: "chrome://remote/content/shared/webdriver/Assert.sys.mjs",
|
||||
error: "chrome://remote/content/shared/webdriver/Errors.sys.mjs",
|
||||
keyData: "chrome://remote/content/shared/webdriver/KeyData.sys.mjs",
|
||||
Log: "chrome://remote/content/shared/Log.sys.mjs",
|
||||
pprint: "chrome://remote/content/shared/Format.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
AppInfo: "chrome://remote/content/shared/AppInfo.jsm",
|
||||
assert: "chrome://remote/content/shared/webdriver/Assert.jsm",
|
||||
element: "chrome://remote/content/marionette/element.js",
|
||||
error: "chrome://remote/content/shared/webdriver/Errors.jsm",
|
||||
event: "chrome://remote/content/marionette/event.js",
|
||||
keyData: "chrome://remote/content/shared/webdriver/KeyData.jsm",
|
||||
Log: "chrome://remote/content/shared/Log.jsm",
|
||||
pprint: "chrome://remote/content/shared/Format.jsm",
|
||||
Sleep: "chrome://remote/content/marionette/sync.js",
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -14,16 +14,19 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
|
|||
|
||||
const lazy = {};
|
||||
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
error: "chrome://remote/content/shared/webdriver/Errors.sys.mjs",
|
||||
Log: "chrome://remote/content/shared/Log.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
action: "chrome://remote/content/marionette/action.js",
|
||||
atom: "chrome://remote/content/marionette/atom.js",
|
||||
element: "chrome://remote/content/marionette/element.js",
|
||||
error: "chrome://remote/content/shared/webdriver/Errors.jsm",
|
||||
evaluate: "chrome://remote/content/marionette/evaluate.js",
|
||||
event: "chrome://remote/content/marionette/event.js",
|
||||
interaction: "chrome://remote/content/marionette/interaction.js",
|
||||
legacyaction: "chrome://remote/content/marionette/legacyaction.js",
|
||||
Log: "chrome://remote/content/shared/Log.jsm",
|
||||
sandbox: "chrome://remote/content/marionette/evaluate.js",
|
||||
Sandboxes: "chrome://remote/content/marionette/evaluate.js",
|
||||
});
|
||||
|
|
|
|||
|
|
@ -18,12 +18,15 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
|
|||
|
||||
const lazy = {};
|
||||
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
error: "chrome://remote/content/shared/webdriver/Errors.sys.mjs",
|
||||
Log: "chrome://remote/content/shared/Log.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
capture: "chrome://remote/content/marionette/capture.js",
|
||||
element: "chrome://remote/content/marionette/element.js",
|
||||
error: "chrome://remote/content/shared/webdriver/Errors.jsm",
|
||||
evaluate: "chrome://remote/content/marionette/evaluate.js",
|
||||
Log: "chrome://remote/content/shared/Log.jsm",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyGetter(lazy, "logger", () =>
|
||||
|
|
|
|||
|
|
@ -14,9 +14,12 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
|
|||
|
||||
const lazy = {};
|
||||
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
Log: "chrome://remote/content/shared/Log.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
event: "chrome://remote/content/marionette/event.js",
|
||||
Log: "chrome://remote/content/shared/Log.jsm",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyGetter(lazy, "logger", () =>
|
||||
|
|
|
|||
|
|
@ -17,9 +17,12 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
|
|||
|
||||
const lazy = {};
|
||||
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
Log: "chrome://remote/content/shared/Log.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
EventEmitter: "resource://gre/modules/EventEmitter.jsm",
|
||||
Log: "chrome://remote/content/shared/Log.jsm",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyGetter(lazy, "logger", () =>
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
|
|||
|
||||
const lazy = {};
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
Log: "chrome://remote/content/shared/Log.jsm",
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
Log: "chrome://remote/content/shared/Log.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyGetter(lazy, "logger", () =>
|
||||
|
|
|
|||
|
|
@ -14,11 +14,12 @@ const lazy = {};
|
|||
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
FileUtils: "resource://gre/modules/FileUtils.sys.mjs",
|
||||
|
||||
error: "chrome://remote/content/shared/webdriver/Errors.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
AddonManager: "resource://gre/modules/AddonManager.jsm",
|
||||
error: "chrome://remote/content/shared/webdriver/Errors.jsm",
|
||||
});
|
||||
|
||||
// from https://developer.mozilla.org/en-US/Add-ons/Add-on_Manager/AddonManager#AddonInstall_errors
|
||||
|
|
|
|||
|
|
@ -12,14 +12,17 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
|
|||
|
||||
const lazy = {};
|
||||
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
AppInfo: "chrome://remote/content/shared/AppInfo.sys.mjs",
|
||||
error: "chrome://remote/content/shared/webdriver/Errors.sys.mjs",
|
||||
EventPromise: "chrome://remote/content/shared/Sync.sys.mjs",
|
||||
TabManager: "chrome://remote/content/shared/TabManager.sys.mjs",
|
||||
windowManager: "chrome://remote/content/shared/WindowManager.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
AppInfo: "chrome://remote/content/shared/AppInfo.jsm",
|
||||
error: "chrome://remote/content/shared/webdriver/Errors.jsm",
|
||||
EventPromise: "chrome://remote/content/shared/Sync.jsm",
|
||||
MessageManagerDestroyedPromise: "chrome://remote/content/marionette/sync.js",
|
||||
TabManager: "chrome://remote/content/shared/TabManager.jsm",
|
||||
WebElementEventTarget: "chrome://remote/content/marionette/dom.js",
|
||||
windowManager: "chrome://remote/content/shared/WindowManager.jsm",
|
||||
});
|
||||
|
||||
/** @namespace */
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
|
|||
|
||||
const lazy = {};
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
Log: "chrome://remote/content/shared/Log.jsm",
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
Log: "chrome://remote/content/shared/Log.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyGetter(lazy, "logger", () =>
|
||||
|
|
|
|||
|
|
@ -6,16 +6,12 @@
|
|||
|
||||
const EXPORTED_SYMBOLS = ["cookie"];
|
||||
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
||||
);
|
||||
|
||||
const lazy = {};
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
assert: "chrome://remote/content/shared/webdriver/Assert.jsm",
|
||||
error: "chrome://remote/content/shared/webdriver/Errors.jsm",
|
||||
pprint: "chrome://remote/content/shared/Format.jsm",
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
assert: "chrome://remote/content/shared/webdriver/Assert.sys.mjs",
|
||||
error: "chrome://remote/content/shared/webdriver/Errors.sys.mjs",
|
||||
pprint: "chrome://remote/content/shared/Format.sys.mjs",
|
||||
});
|
||||
|
||||
const IPV4_PORT_EXPR = /:\d+$/;
|
||||
|
|
|
|||
|
|
@ -15,8 +15,8 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
|
|||
|
||||
const lazy = {};
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
Log: "chrome://remote/content/shared/Log.jsm",
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
Log: "chrome://remote/content/shared/Log.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyGetter(lazy, "logger", () =>
|
||||
|
|
|
|||
|
|
@ -16,10 +16,26 @@ const { element } = ChromeUtils.import(
|
|||
|
||||
const lazy = {};
|
||||
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
AppInfo: "chrome://remote/content/shared/AppInfo.sys.mjs",
|
||||
assert: "chrome://remote/content/shared/webdriver/Assert.sys.mjs",
|
||||
error: "chrome://remote/content/shared/webdriver/Errors.sys.mjs",
|
||||
EventPromise: "chrome://remote/content/shared/Sync.sys.mjs",
|
||||
Log: "chrome://remote/content/shared/Log.sys.mjs",
|
||||
pprint: "chrome://remote/content/shared/Format.sys.mjs",
|
||||
print: "chrome://remote/content/shared/PDF.sys.mjs",
|
||||
TabManager: "chrome://remote/content/shared/TabManager.sys.mjs",
|
||||
Timeouts: "chrome://remote/content/shared/webdriver/Capabilities.sys.mjs",
|
||||
UnhandledPromptBehavior:
|
||||
"chrome://remote/content/shared/webdriver/Capabilities.sys.mjs",
|
||||
waitForInitialNavigationCompleted:
|
||||
"chrome://remote/content/shared/Navigate.sys.mjs",
|
||||
WebDriverSession: "chrome://remote/content/shared/webdriver/Session.sys.mjs",
|
||||
windowManager: "chrome://remote/content/shared/WindowManager.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
Addon: "chrome://remote/content/marionette/addon.js",
|
||||
AppInfo: "chrome://remote/content/shared/AppInfo.jsm",
|
||||
assert: "chrome://remote/content/shared/webdriver/Assert.jsm",
|
||||
atom: "chrome://remote/content/marionette/atom.js",
|
||||
browser: "chrome://remote/content/marionette/browser.js",
|
||||
capture: "chrome://remote/content/marionette/capture.js",
|
||||
|
|
@ -32,37 +48,24 @@ XPCOMUtils.defineLazyModuleGetters(lazy, {
|
|||
"chrome://remote/content/marionette/actors/MarionetteEventsParent.jsm",
|
||||
enableEventsActor:
|
||||
"chrome://remote/content/marionette/actors/MarionetteEventsParent.jsm",
|
||||
error: "chrome://remote/content/shared/webdriver/Errors.jsm",
|
||||
EventPromise: "chrome://remote/content/shared/Sync.jsm",
|
||||
getMarionetteCommandsActorProxy:
|
||||
"chrome://remote/content/marionette/actors/MarionetteCommandsParent.jsm",
|
||||
IdlePromise: "chrome://remote/content/marionette/sync.js",
|
||||
l10n: "chrome://remote/content/marionette/l10n.js",
|
||||
Log: "chrome://remote/content/shared/Log.jsm",
|
||||
Marionette: "chrome://remote/content/components/Marionette.jsm",
|
||||
MarionettePrefs: "chrome://remote/content/marionette/prefs.js",
|
||||
modal: "chrome://remote/content/marionette/modal.js",
|
||||
navigate: "chrome://remote/content/marionette/navigate.js",
|
||||
permissions: "chrome://remote/content/marionette/permissions.js",
|
||||
pprint: "chrome://remote/content/shared/Format.jsm",
|
||||
print: "chrome://remote/content/shared/PDF.jsm",
|
||||
reftest: "chrome://remote/content/marionette/reftest.js",
|
||||
registerCommandsActor:
|
||||
"chrome://remote/content/marionette/actors/MarionetteCommandsParent.jsm",
|
||||
RemoteAgent: "chrome://remote/content/components/RemoteAgent.jsm",
|
||||
TabManager: "chrome://remote/content/shared/TabManager.jsm",
|
||||
TimedPromise: "chrome://remote/content/marionette/sync.js",
|
||||
Timeouts: "chrome://remote/content/shared/webdriver/Capabilities.jsm",
|
||||
UnhandledPromptBehavior:
|
||||
"chrome://remote/content/shared/webdriver/Capabilities.jsm",
|
||||
unregisterCommandsActor:
|
||||
"chrome://remote/content/marionette/actors/MarionetteCommandsParent.jsm",
|
||||
waitForInitialNavigationCompleted:
|
||||
"chrome://remote/content/shared/Navigate.jsm",
|
||||
waitForObserverTopic: "chrome://remote/content/marionette/sync.js",
|
||||
WebDriverSession: "chrome://remote/content/shared/webdriver/Session.jsm",
|
||||
WebReference: "chrome://remote/content/marionette/element.js",
|
||||
windowManager: "chrome://remote/content/shared/WindowManager.jsm",
|
||||
WindowState: "chrome://remote/content/marionette/browser.js",
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -19,14 +19,17 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
|
|||
|
||||
const lazy = {};
|
||||
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
assert: "chrome://remote/content/shared/webdriver/Assert.sys.mjs",
|
||||
error: "chrome://remote/content/shared/webdriver/Errors.sys.mjs",
|
||||
pprint: "chrome://remote/content/shared/Format.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
ContentDOMReference: "resource://gre/modules/ContentDOMReference.jsm",
|
||||
|
||||
assert: "chrome://remote/content/shared/webdriver/Assert.jsm",
|
||||
atom: "chrome://remote/content/marionette/atom.js",
|
||||
error: "chrome://remote/content/shared/webdriver/Errors.jsm",
|
||||
PollPromise: "chrome://remote/content/marionette/sync.js",
|
||||
pprint: "chrome://remote/content/shared/Format.jsm",
|
||||
});
|
||||
|
||||
const ORDERED_NODE_ITERATOR_TYPE = 5;
|
||||
|
|
|
|||
|
|
@ -15,10 +15,13 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
|
|||
|
||||
const lazy = {};
|
||||
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
error: "chrome://remote/content/shared/webdriver/Errors.sys.mjs",
|
||||
Log: "chrome://remote/content/shared/Log.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
element: "chrome://remote/content/marionette/element.js",
|
||||
error: "chrome://remote/content/shared/webdriver/Errors.jsm",
|
||||
Log: "chrome://remote/content/shared/Log.jsm",
|
||||
WebReference: "chrome://remote/content/marionette/element.js",
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -13,8 +13,8 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
|
|||
|
||||
const lazy = {};
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
keyData: "chrome://remote/content/shared/webdriver/KeyData.jsm",
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
keyData: "chrome://remote/content/shared/webdriver/KeyData.sys.mjs",
|
||||
});
|
||||
|
||||
/** Provides functionality for creating and sending DOM events. */
|
||||
|
|
|
|||
|
|
@ -14,14 +14,17 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
|
|||
|
||||
const lazy = {};
|
||||
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
error: "chrome://remote/content/shared/webdriver/Errors.sys.mjs",
|
||||
Log: "chrome://remote/content/shared/Log.sys.mjs",
|
||||
pprint: "chrome://remote/content/shared/Format.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
accessibility: "chrome://remote/content/marionette/accessibility.js",
|
||||
atom: "chrome://remote/content/marionette/atom.js",
|
||||
element: "chrome://remote/content/marionette/element.js",
|
||||
error: "chrome://remote/content/shared/webdriver/Errors.jsm",
|
||||
event: "chrome://remote/content/marionette/event.js",
|
||||
Log: "chrome://remote/content/shared/Log.jsm",
|
||||
pprint: "chrome://remote/content/shared/Format.jsm",
|
||||
TimedPromise: "chrome://remote/content/marionette/sync.js",
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -23,8 +23,8 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
|
|||
|
||||
const lazy = {};
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
error: "chrome://remote/content/shared/webdriver/Errors.jsm",
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
error: "chrome://remote/content/shared/webdriver/Errors.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyGetter(lazy, "domParser", () => {
|
||||
|
|
|
|||
|
|
@ -14,15 +14,18 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
|
|||
|
||||
const lazy = {};
|
||||
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
error: "chrome://remote/content/shared/webdriver/Errors.sys.mjs",
|
||||
Log: "chrome://remote/content/shared/Log.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
Preferences: "resource://gre/modules/Preferences.jsm",
|
||||
|
||||
accessibility: "chrome://remote/content/marionette/accessibility.js",
|
||||
element: "chrome://remote/content/marionette/element.js",
|
||||
error: "chrome://remote/content/shared/webdriver/Errors.jsm",
|
||||
evaluate: "chrome://remote/content/marionette/evaluate.js",
|
||||
event: "chrome://remote/content/marionette/event.js",
|
||||
Log: "chrome://remote/content/shared/Log.jsm",
|
||||
WebReference: "chrome://remote/content/marionette/element.js",
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -6,16 +6,12 @@
|
|||
|
||||
const EXPORTED_SYMBOLS = ["Command", "Message", "Response"];
|
||||
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
||||
);
|
||||
|
||||
const lazy = {};
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
assert: "chrome://remote/content/shared/webdriver/Assert.jsm",
|
||||
error: "chrome://remote/content/shared/webdriver/Errors.jsm",
|
||||
truncate: "chrome://remote/content/shared/Format.jsm",
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
assert: "chrome://remote/content/shared/webdriver/Assert.sys.mjs",
|
||||
error: "chrome://remote/content/shared/webdriver/Errors.sys.mjs",
|
||||
truncate: "chrome://remote/content/shared/Format.sys.mjs",
|
||||
});
|
||||
|
||||
/** Representation of the packets transproted over the wire. */
|
||||
|
|
|
|||
|
|
@ -12,10 +12,9 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
|
|||
|
||||
const lazy = {};
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
AppInfo: "chrome://remote/content/shared/AppInfo.jsm",
|
||||
|
||||
Log: "chrome://remote/content/shared/Log.jsm",
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
AppInfo: "chrome://remote/content/shared/AppInfo.sys.mjs",
|
||||
Log: "chrome://remote/content/shared/Log.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyGetter(lazy, "logger", () =>
|
||||
|
|
|
|||
|
|
@ -12,16 +12,20 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
|
|||
|
||||
const lazy = {};
|
||||
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
error: "chrome://remote/content/shared/webdriver/Errors.sys.mjs",
|
||||
Log: "chrome://remote/content/shared/Log.sys.mjs",
|
||||
PageLoadStrategy:
|
||||
"chrome://remote/content/shared/webdriver/Capabilities.sys.mjs",
|
||||
ProgressListener: "chrome://remote/content/shared/Navigate.sys.mjs",
|
||||
truncate: "chrome://remote/content/shared/Format.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
error: "chrome://remote/content/shared/webdriver/Errors.jsm",
|
||||
EventDispatcher:
|
||||
"chrome://remote/content/marionette/actors/MarionetteEventsParent.jsm",
|
||||
Log: "chrome://remote/content/shared/Log.jsm",
|
||||
modal: "chrome://remote/content/marionette/modal.js",
|
||||
PageLoadStrategy: "chrome://remote/content/shared/webdriver/Capabilities.jsm",
|
||||
ProgressListener: "chrome://remote/content/shared/Navigate.jsm",
|
||||
TimedPromise: "chrome://remote/content/marionette/sync.js",
|
||||
truncate: "chrome://remote/content/shared/Format.jsm",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyGetter(lazy, "logger", () =>
|
||||
|
|
|
|||
|
|
@ -12,8 +12,11 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
|
|||
|
||||
const lazy = {};
|
||||
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
error: "chrome://remote/content/shared/webdriver/Errors.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
error: "chrome://remote/content/shared/webdriver/Errors.jsm",
|
||||
MarionettePrefs: "chrome://remote/content/marionette/prefs.js",
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -12,16 +12,19 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
|
|||
|
||||
const lazy = {};
|
||||
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
AppInfo: "chrome://remote/content/shared/AppInfo.sys.mjs",
|
||||
assert: "chrome://remote/content/shared/webdriver/Assert.sys.mjs",
|
||||
Log: "chrome://remote/content/shared/Log.sys.mjs",
|
||||
print: "chrome://remote/content/shared/PDF.sys.mjs",
|
||||
windowManager: "chrome://remote/content/shared/WindowManager.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
E10SUtils: "resource://gre/modules/E10SUtils.jsm",
|
||||
|
||||
AppInfo: "chrome://remote/content/shared/AppInfo.jsm",
|
||||
assert: "chrome://remote/content/shared/webdriver/Assert.jsm",
|
||||
capture: "chrome://remote/content/marionette/capture.js",
|
||||
Log: "chrome://remote/content/shared/Log.jsm",
|
||||
navigate: "chrome://remote/content/marionette/navigate.js",
|
||||
print: "chrome://remote/content/shared/PDF.jsm",
|
||||
windowManager: "chrome://remote/content/shared/WindowManager.jsm",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyGetter(lazy, "logger", () =>
|
||||
|
|
|
|||
|
|
@ -12,13 +12,16 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
|
|||
|
||||
const lazy = {};
|
||||
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
assert: "chrome://remote/content/shared/webdriver/Assert.sys.mjs",
|
||||
error: "chrome://remote/content/shared/webdriver/Errors.sys.mjs",
|
||||
Log: "chrome://remote/content/shared/Log.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
assert: "chrome://remote/content/shared/webdriver/Assert.jsm",
|
||||
Command: "chrome://remote/content/marionette/message.js",
|
||||
DebuggerTransport: "chrome://remote/content/marionette/transport.js",
|
||||
error: "chrome://remote/content/shared/webdriver/Errors.jsm",
|
||||
GeckoDriver: "chrome://remote/content/marionette/driver.js",
|
||||
Log: "chrome://remote/content/shared/Log.jsm",
|
||||
MarionettePrefs: "chrome://remote/content/marionette/prefs.js",
|
||||
Message: "chrome://remote/content/marionette/message.js",
|
||||
Response: "chrome://remote/content/marionette/message.js",
|
||||
|
|
|
|||
|
|
@ -25,9 +25,9 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
|
|||
|
||||
const lazy = {};
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
error: "chrome://remote/content/shared/webdriver/Errors.jsm",
|
||||
Log: "chrome://remote/content/shared/Log.jsm",
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
error: "chrome://remote/content/shared/webdriver/Errors.sys.mjs",
|
||||
Log: "chrome://remote/content/shared/Log.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyGetter(lazy, "logger", () =>
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@
|
|||
* 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 { error } = ChromeUtils.import(
|
||||
"chrome://remote/content/shared/webdriver/Errors.jsm"
|
||||
const { error } = ChromeUtils.importESModule(
|
||||
"chrome://remote/content/shared/webdriver/Errors.sys.mjs"
|
||||
);
|
||||
const { Command, Message, Response } = ChromeUtils.import(
|
||||
"chrome://remote/content/marionette/message.js"
|
||||
|
|
|
|||
|
|
@ -16,9 +16,12 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
|
|||
|
||||
const lazy = {};
|
||||
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
executeSoon: "chrome://remote/content/shared/Sync.sys.mjs",
|
||||
Log: "chrome://remote/content/shared/Log.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
executeSoon: "chrome://remote/content/shared/Sync.jsm",
|
||||
Log: "chrome://remote/content/shared/Log.jsm",
|
||||
RemoteAgent: "chrome://remote/content/components/RemoteAgent.jsm",
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -2,13 +2,7 @@
|
|||
* 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";
|
||||
|
||||
const EXPORTED_SYMBOLS = ["AppInfo"];
|
||||
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
||||
);
|
||||
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
|
||||
|
||||
const ID_FIREFOX = "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}";
|
||||
const ID_THUNDERBIRD = "{3550f703-e582-4d05-9a08-453d09bdfdc6}";
|
||||
|
|
@ -27,7 +21,7 @@ const ID_THUNDERBIRD = "{3550f703-e582-4d05-9a08-453d09bdfdc6}";
|
|||
*
|
||||
* @since 88
|
||||
*/
|
||||
const AppInfo = new Proxy(
|
||||
export const AppInfo = new Proxy(
|
||||
{},
|
||||
{
|
||||
get(target, prop, receiver) {
|
||||
|
|
@ -2,18 +2,12 @@
|
|||
* 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";
|
||||
|
||||
var EXPORTED_SYMBOLS = ["pprint", "truncate"];
|
||||
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
||||
);
|
||||
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
|
||||
|
||||
const lazy = {};
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
Log: "chrome://remote/content/shared/Log.jsm",
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
Log: "chrome://remote/content/shared/Log.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyGetter(lazy, "logger", () => lazy.Log.get());
|
||||
|
|
@ -44,7 +38,7 @@ const MAX_STRING_LENGTH = 250;
|
|||
* pprint`Current window: ${window}`;
|
||||
* => '[object Window https://www.mozilla.org/]'
|
||||
*/
|
||||
function pprint(ss, ...values) {
|
||||
export function pprint(ss, ...values) {
|
||||
function pretty(val) {
|
||||
let proto = Object.prototype.toString.call(val);
|
||||
if (
|
||||
|
|
@ -136,7 +130,7 @@ function pprint(ss, ...values) {
|
|||
*
|
||||
* Functions named `toJSON` or `toString` on objects will be called.
|
||||
*/
|
||||
function truncate(strings, ...values) {
|
||||
export function truncate(strings, ...values) {
|
||||
function walk(obj) {
|
||||
const typ = Object.prototype.toString.call(obj);
|
||||
|
||||
|
|
@ -2,16 +2,9 @@
|
|||
* 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";
|
||||
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
|
||||
|
||||
var EXPORTED_SYMBOLS = ["Log"];
|
||||
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
||||
);
|
||||
const { Log: StdLog } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/Log.sys.mjs"
|
||||
);
|
||||
const { Log: StdLog } = ChromeUtils.import("resource://gre/modules/Log.jsm");
|
||||
|
||||
const PREF_REMOTE_LOG_LEVEL = "remote.log.level";
|
||||
|
||||
|
|
@ -42,7 +35,7 @@ XPCOMUtils.defineLazyGetter(lazy, "prefLogLevel", () => {
|
|||
});
|
||||
|
||||
/** E10s compatible wrapper for the standard logger from Log.jsm. */
|
||||
class Log {
|
||||
export class Log {
|
||||
static TYPES = {
|
||||
CDP: "CDP",
|
||||
MARIONETTE: "Marionette",
|
||||
|
|
@ -2,24 +2,20 @@
|
|||
* 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";
|
||||
|
||||
var EXPORTED_SYMBOLS = ["MobileTabBrowser"];
|
||||
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
||||
);
|
||||
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
|
||||
|
||||
const lazy = {};
|
||||
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
windowManager: "chrome://remote/content/shared/WindowManager.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
GeckoViewTabUtil: "resource://gre/modules/GeckoViewTestUtils.jsm",
|
||||
|
||||
windowManager: "chrome://remote/content/shared/WindowManager.jsm",
|
||||
});
|
||||
|
||||
// GeckoView shim for Desktop's gBrowser
|
||||
class MobileTabBrowser {
|
||||
export class MobileTabBrowser {
|
||||
constructor(window) {
|
||||
this.window = window;
|
||||
}
|
||||
|
|
@ -2,29 +2,23 @@
|
|||
* 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";
|
||||
|
||||
const EXPORTED_SYMBOLS = [
|
||||
"ProgressListener",
|
||||
"waitForInitialNavigationCompleted",
|
||||
];
|
||||
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
|
||||
|
||||
const { AppConstants } = ChromeUtils.import(
|
||||
"resource://gre/modules/AppConstants.jsm"
|
||||
);
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
||||
);
|
||||
|
||||
const lazy = {};
|
||||
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
Deferred: "chrome://remote/content/shared/Sync.sys.mjs",
|
||||
Log: "chrome://remote/content/shared/Log.sys.mjs",
|
||||
truncate: "chrome://remote/content/shared/Format.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
clearTimeout: "resource://gre/modules/Timer.jsm",
|
||||
setTimeout: "resource://gre/modules/Timer.jsm",
|
||||
|
||||
Deferred: "chrome://remote/content/shared/Sync.jsm",
|
||||
Log: "chrome://remote/content/shared/Log.jsm",
|
||||
truncate: "chrome://remote/content/shared/Format.jsm",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyGetter(lazy, "logger", () =>
|
||||
|
|
@ -69,7 +63,10 @@ const webProgressListeners = new Set();
|
|||
* - {nsIURI} currentURI The current URI of the page
|
||||
* - {nsIURI} targetURI Target URI of the navigation
|
||||
*/
|
||||
async function waitForInitialNavigationCompleted(webProgress, options = {}) {
|
||||
export async function waitForInitialNavigationCompleted(
|
||||
webProgress,
|
||||
options = {}
|
||||
) {
|
||||
const { resolveWhenStarted = false } = options;
|
||||
|
||||
const browsingContext = webProgress.browsingContext;
|
||||
|
|
@ -110,7 +107,7 @@ async function waitForInitialNavigationCompleted(webProgress, options = {}) {
|
|||
/**
|
||||
* WebProgressListener to observe for page loads.
|
||||
*/
|
||||
class ProgressListener {
|
||||
export class ProgressListener {
|
||||
#expectNavigation;
|
||||
#resolveWhenStarted;
|
||||
#unloadTimeout;
|
||||
|
|
@ -2,27 +2,23 @@
|
|||
* 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";
|
||||
|
||||
const EXPORTED_SYMBOLS = ["print"];
|
||||
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
||||
);
|
||||
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
|
||||
|
||||
const lazy = {};
|
||||
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
assert: "chrome://remote/content/shared/webdriver/Assert.sys.mjs",
|
||||
Log: "chrome://remote/content/shared/Log.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
assert: "chrome://remote/content/shared/webdriver/Assert.jsm",
|
||||
clearInterval: "resource://gre/modules/Timer.jsm",
|
||||
setInterval: "resource://gre/modules/Timer.jsm",
|
||||
|
||||
Log: "chrome://remote/content/shared/Log.jsm",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyGetter(lazy, "logger", () => lazy.Log.get());
|
||||
|
||||
const print = {
|
||||
export const print = {
|
||||
maxScaleValue: 2.0,
|
||||
minScaleValue: 0.1,
|
||||
letterPaperSizeCm: {
|
||||
|
|
@ -2,20 +2,16 @@
|
|||
* 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";
|
||||
|
||||
const EXPORTED_SYMBOLS = ["RecommendedPreferences"];
|
||||
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
||||
);
|
||||
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
|
||||
|
||||
const lazy = {};
|
||||
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
Log: "chrome://remote/content/shared/Log.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
Preferences: "resource://gre/modules/Preferences.jsm",
|
||||
|
||||
Log: "chrome://remote/content/shared/Log.jsm",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyPreferenceGetter(
|
||||
|
|
@ -271,7 +267,7 @@ const COMMON_PREFERENCES = new Map([
|
|||
["browser.topsites.contile.enabled", false],
|
||||
]);
|
||||
|
||||
const RecommendedPreferences = {
|
||||
export const RecommendedPreferences = {
|
||||
alteredPrefs: new Set(),
|
||||
|
||||
isInitialized: false,
|
||||
|
|
@ -2,14 +2,10 @@
|
|||
* 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";
|
||||
|
||||
const EXPORTED_SYMBOLS = ["RemoteError"];
|
||||
|
||||
/**
|
||||
* Base class for all remote protocol errors.
|
||||
*/
|
||||
class RemoteError extends Error {
|
||||
export class RemoteError extends Error {
|
||||
get isRemoteError() {
|
||||
return true;
|
||||
}
|
||||
|
|
@ -2,10 +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/. */
|
||||
|
||||
"use strict";
|
||||
|
||||
const EXPORTED_SYMBOLS = ["getFramesFromStack", "isChromeFrame"];
|
||||
|
||||
/**
|
||||
* An object that contains details of a stack frame.
|
||||
*
|
||||
|
|
@ -36,7 +32,7 @@ const EXPORTED_SYMBOLS = ["getFramesFromStack", "isChromeFrame"];
|
|||
*
|
||||
* @returns {Array<StackFrame>=}
|
||||
*/
|
||||
function getFramesFromStack(stack) {
|
||||
export function getFramesFromStack(stack) {
|
||||
if (!stack || (Cu && Cu.isDeadWrapper(stack))) {
|
||||
// If the global from which this error came from has been nuked,
|
||||
// stack is going to be a dead wrapper.
|
||||
|
|
@ -69,7 +65,7 @@ function getFramesFromStack(stack) {
|
|||
* @returns {boolean}
|
||||
* True, if frame is from chrome scope
|
||||
*/
|
||||
function isChromeFrame(frame) {
|
||||
export function isChromeFrame(frame) {
|
||||
return (
|
||||
frame.filename.startsWith("chrome://") ||
|
||||
frame.filename.startsWith("resource://")
|
||||
|
|
@ -2,25 +2,13 @@
|
|||
* 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";
|
||||
|
||||
var EXPORTED_SYMBOLS = [
|
||||
"AnimationFramePromise",
|
||||
"Deferred",
|
||||
"EventPromise",
|
||||
"executeSoon",
|
||||
"PollPromise",
|
||||
];
|
||||
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
||||
);
|
||||
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
|
||||
|
||||
const lazy = {};
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
error: "chrome://remote/content/shared/webdriver/Errors.jsm",
|
||||
Log: "chrome://remote/content/shared/Log.jsm",
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
error: "chrome://remote/content/shared/webdriver/Errors.sys.mjs",
|
||||
Log: "chrome://remote/content/shared/Log.sys.mjs",
|
||||
});
|
||||
|
||||
const { TYPE_ONE_SHOT, TYPE_REPEATING_SLACK } = Ci.nsITimer;
|
||||
|
|
@ -37,7 +25,7 @@ XPCOMUtils.defineLazyGetter(lazy, "logger", () =>
|
|||
*
|
||||
* @return {Promise}
|
||||
*/
|
||||
function AnimationFramePromise(win) {
|
||||
export function AnimationFramePromise(win) {
|
||||
const animationFramePromise = new Promise(resolve => {
|
||||
win.requestAnimationFrame(resolve);
|
||||
});
|
||||
|
|
@ -64,7 +52,7 @@ function AnimationFramePromise(win) {
|
|||
* - rejected Flag that indicates that the promise got rejected
|
||||
* - resolve Callback to resolve the promise
|
||||
*/
|
||||
function Deferred() {
|
||||
export function Deferred() {
|
||||
const deferred = {};
|
||||
|
||||
deferred.promise = new Promise((resolve, reject) => {
|
||||
|
|
@ -133,7 +121,7 @@ function Deferred() {
|
|||
* @throws {TypeError}
|
||||
* @throws {RangeError}
|
||||
*/
|
||||
function EventPromise(subject, eventName, options = {}) {
|
||||
export function EventPromise(subject, eventName, options = {}) {
|
||||
const {
|
||||
capture = false,
|
||||
checkFn = null,
|
||||
|
|
@ -210,7 +198,7 @@ function EventPromise(subject, eventName, options = {}) {
|
|||
* @param {function} fn
|
||||
* Function to be executed.
|
||||
*/
|
||||
function executeSoon(fn) {
|
||||
export function executeSoon(fn) {
|
||||
if (typeof fn != "function") {
|
||||
throw new TypeError();
|
||||
}
|
||||
|
|
@ -269,7 +257,7 @@ function executeSoon(fn) {
|
|||
* @throws {RangeError}
|
||||
* If `timeout` or `interval` are not unsigned integers.
|
||||
*/
|
||||
function PollPromise(func, { timeout = null, interval = 10 } = {}) {
|
||||
export function PollPromise(func, { timeout = null, interval = 10 } = {}) {
|
||||
const timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
|
||||
|
||||
if (typeof func != "function") {
|
||||
|
|
@ -2,26 +2,18 @@
|
|||
* 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";
|
||||
|
||||
var EXPORTED_SYMBOLS = ["TabManager"];
|
||||
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
||||
);
|
||||
|
||||
const lazy = {};
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
AppInfo: "chrome://remote/content/shared/AppInfo.jsm",
|
||||
EventPromise: "chrome://remote/content/shared/Sync.jsm",
|
||||
MobileTabBrowser: "chrome://remote/content/shared/MobileTabBrowser.jsm",
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
AppInfo: "chrome://remote/content/shared/AppInfo.sys.mjs",
|
||||
EventPromise: "chrome://remote/content/shared/Sync.sys.mjs",
|
||||
MobileTabBrowser: "chrome://remote/content/shared/MobileTabBrowser.sys.mjs",
|
||||
});
|
||||
|
||||
// Maps browser's permanentKey to uuid: WeakMap.<Object, string>
|
||||
const browserUniqueIds = new WeakMap();
|
||||
|
||||
var TabManager = {
|
||||
export var TabManager = {
|
||||
/**
|
||||
* Retrieve all the browser elements from tabs as contained in open windows.
|
||||
*
|
||||
|
|
@ -3,25 +3,22 @@
|
|||
* 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";
|
||||
|
||||
var EXPORTED_SYMBOLS = ["WebSocketConnection"];
|
||||
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
||||
);
|
||||
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
|
||||
|
||||
const lazy = {};
|
||||
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
Log: "chrome://remote/content/shared/Log.sys.mjs",
|
||||
truncate: "chrome://remote/content/shared/Format.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
Log: "chrome://remote/content/shared/Log.jsm",
|
||||
truncate: "chrome://remote/content/shared/Format.jsm",
|
||||
WebSocketTransport: "chrome://remote/content/server/WebSocketTransport.jsm",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyGetter(lazy, "logger", () => lazy.Log.get());
|
||||
|
||||
class WebSocketConnection {
|
||||
export class WebSocketConnection {
|
||||
/**
|
||||
* @param {WebSocket} webSocket
|
||||
* The WebSocket server connection to wrap.
|
||||
|
|
@ -2,22 +2,19 @@
|
|||
* 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";
|
||||
|
||||
const EXPORTED_SYMBOLS = ["windowManager"];
|
||||
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
||||
);
|
||||
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
|
||||
|
||||
const lazy = {};
|
||||
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
AppInfo: "chrome://remote/content/shared/AppInfo.sys.mjs",
|
||||
error: "chrome://remote/content/shared/webdriver/Errors.sys.mjs",
|
||||
EventPromise: "chrome://remote/content/shared/Sync.sys.mjs",
|
||||
TabManager: "chrome://remote/content/shared/TabManager.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
AppInfo: "chrome://remote/content/shared/AppInfo.jsm",
|
||||
error: "chrome://remote/content/shared/webdriver/Errors.jsm",
|
||||
TabManager: "chrome://remote/content/shared/TabManager.jsm",
|
||||
TimedPromise: "chrome://remote/content/marionette/sync.js",
|
||||
EventPromise: "chrome://remote/content/shared/Sync.jsm",
|
||||
waitForObserverTopic: "chrome://remote/content/marionette/sync.js",
|
||||
});
|
||||
|
||||
|
|
@ -279,4 +276,4 @@ class WindowManager {
|
|||
}
|
||||
|
||||
// Expose a shared singleton.
|
||||
const windowManager = new WindowManager();
|
||||
export const windowManager = new WindowManager();
|
||||
|
|
@ -2,13 +2,7 @@
|
|||
* 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";
|
||||
|
||||
const EXPORTED_SYMBOLS = ["BrowsingContextListener"];
|
||||
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
||||
);
|
||||
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
|
||||
|
||||
const lazy = {};
|
||||
|
||||
|
|
@ -46,7 +40,7 @@ const OBSERVER_TOPIC_SET_EMBEDDER = "browsing-context-did-set-embedder";
|
|||
* Usually "attach" or "discard", but will contain "replace" if the
|
||||
* browsing context gets replaced by a cross-group navigation.
|
||||
*/
|
||||
class BrowsingContextListener {
|
||||
export class BrowsingContextListener {
|
||||
#listening;
|
||||
#topContextsToAttach;
|
||||
|
||||
|
|
@ -2,13 +2,7 @@
|
|||
* 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";
|
||||
|
||||
const EXPORTED_SYMBOLS = ["ConsoleAPIListener"];
|
||||
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
||||
);
|
||||
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
|
||||
|
||||
const lazy = {};
|
||||
|
||||
|
|
@ -46,7 +40,7 @@ XPCOMUtils.defineLazyGetter(lazy, "ConsoleAPIStorage", () => {
|
|||
* - {Array<Object>} stacktrace - List of stack frames, starting from most recent.
|
||||
* - {Number} timeStamp - Timestamp when the method was called.
|
||||
*/
|
||||
class ConsoleAPIListener {
|
||||
export class ConsoleAPIListener {
|
||||
#emittedMessages;
|
||||
#innerWindowId;
|
||||
#listening;
|
||||
|
|
@ -2,21 +2,17 @@
|
|||
* 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";
|
||||
|
||||
const EXPORTED_SYMBOLS = ["ConsoleListener"];
|
||||
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
||||
);
|
||||
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
|
||||
|
||||
const lazy = {};
|
||||
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
getFramesFromStack: "chrome://remote/content/shared/Stack.sys.mjs",
|
||||
Log: "chrome://remote/content/shared/Log.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
EventEmitter: "resource://gre/modules/EventEmitter.jsm",
|
||||
|
||||
getFramesFromStack: "chrome://remote/content/shared/Stack.jsm",
|
||||
Log: "chrome://remote/content/shared/Log.jsm",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyGetter(lazy, "logger", () => lazy.Log.get());
|
||||
|
|
@ -51,7 +47,7 @@ XPCOMUtils.defineLazyGetter(lazy, "logger", () => lazy.Log.get());
|
|||
* starting from most recent.
|
||||
* - {Number} timeStamp - Timestamp when the method was called.
|
||||
*/
|
||||
class ConsoleListener {
|
||||
export class ConsoleListener {
|
||||
#emittedMessages;
|
||||
#innerWindowId;
|
||||
#listening;
|
||||
|
|
@ -2,13 +2,7 @@
|
|||
* 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";
|
||||
|
||||
const EXPORTED_SYMBOLS = ["LoadListener"];
|
||||
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
||||
);
|
||||
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
|
||||
|
||||
const lazy = {};
|
||||
|
||||
|
|
@ -37,7 +31,7 @@ XPCOMUtils.defineLazyModuleGetters(lazy, {
|
|||
* - {Document} target
|
||||
* The target document.
|
||||
*/
|
||||
class LoadListener {
|
||||
export class LoadListener {
|
||||
#abortController;
|
||||
#window;
|
||||
|
||||
|
|
@ -2,8 +2,8 @@
|
|||
* 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 { BrowsingContextListener } = ChromeUtils.import(
|
||||
"chrome://remote/content/shared/listeners/BrowsingContextListener.jsm"
|
||||
const { BrowsingContextListener } = ChromeUtils.importESModule(
|
||||
"chrome://remote/content/shared/listeners/BrowsingContextListener.sys.mjs"
|
||||
);
|
||||
|
||||
add_task(async function test_attachedOnNewTab() {
|
||||
|
|
|
|||
|
|
@ -115,8 +115,8 @@ function listenToConsoleAPIMessage() {
|
|||
info("Listen to a console api message in content");
|
||||
return SpecialPowers.spawn(gBrowser.selectedBrowser, [], async () => {
|
||||
const innerWindowId = content.windowGlobalChild.innerWindowId;
|
||||
const { ConsoleAPIListener } = ChromeUtils.import(
|
||||
"chrome://remote/content/shared/listeners/ConsoleAPIListener.jsm"
|
||||
const { ConsoleAPIListener } = ChromeUtils.importESModule(
|
||||
"chrome://remote/content/shared/listeners/ConsoleAPIListener.sys.mjs"
|
||||
);
|
||||
const consoleAPIListener = new ConsoleAPIListener(innerWindowId);
|
||||
const onMessage = consoleAPIListener.once("message");
|
||||
|
|
|
|||
|
|
@ -10,8 +10,8 @@ add_task(async function test_cached_messages() {
|
|||
|
||||
await SpecialPowers.spawn(gBrowser.selectedBrowser, [], async () => {
|
||||
const innerWindowId = content.windowGlobalChild.innerWindowId;
|
||||
const { ConsoleAPIListener } = ChromeUtils.import(
|
||||
"chrome://remote/content/shared/listeners/ConsoleAPIListener.jsm"
|
||||
const { ConsoleAPIListener } = ChromeUtils.importESModule(
|
||||
"chrome://remote/content/shared/listeners/ConsoleAPIListener.sys.mjs"
|
||||
);
|
||||
|
||||
info("Log two messages before starting the ConsoleAPIListener");
|
||||
|
|
@ -67,8 +67,8 @@ add_task(async function test_cached_messages() {
|
|||
|
||||
await SpecialPowers.spawn(gBrowser.selectedBrowser, [], async () => {
|
||||
const innerWindowId = content.windowGlobalChild.innerWindowId;
|
||||
const { ConsoleAPIListener } = ChromeUtils.import(
|
||||
"chrome://remote/content/shared/listeners/ConsoleAPIListener.jsm"
|
||||
const { ConsoleAPIListener } = ChromeUtils.importESModule(
|
||||
"chrome://remote/content/shared/listeners/ConsoleAPIListener.sys.mjs"
|
||||
);
|
||||
|
||||
info("Log a message before creating the ConsoleAPIListener");
|
||||
|
|
|
|||
|
|
@ -100,8 +100,8 @@ function listenToConsoleMessage(level) {
|
|||
[level],
|
||||
async _level => {
|
||||
const innerWindowId = content.windowGlobalChild.innerWindowId;
|
||||
const { ConsoleListener } = ChromeUtils.import(
|
||||
"chrome://remote/content/shared/listeners/ConsoleListener.jsm"
|
||||
const { ConsoleListener } = ChromeUtils.importESModule(
|
||||
"chrome://remote/content/shared/listeners/ConsoleListener.sys.mjs"
|
||||
);
|
||||
const consoleListener = new ConsoleListener(innerWindowId);
|
||||
const onMessage = consoleListener.once(_level);
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@ add_task(async function test_cached_javascript_errors() {
|
|||
await createScriptNode(`(() => {throw "error1"})()`);
|
||||
await SpecialPowers.spawn(gBrowser.selectedBrowser, [], async () => {
|
||||
const innerWindowId = content.windowGlobalChild.innerWindowId;
|
||||
const { ConsoleListener } = ChromeUtils.import(
|
||||
"chrome://remote/content/shared/listeners/ConsoleListener.jsm"
|
||||
const { ConsoleListener } = ChromeUtils.importESModule(
|
||||
"chrome://remote/content/shared/listeners/ConsoleListener.sys.mjs"
|
||||
);
|
||||
|
||||
const listener = new ConsoleListener(innerWindowId);
|
||||
|
|
@ -58,8 +58,8 @@ add_task(async function test_cached_javascript_errors() {
|
|||
await createScriptNode(`(() => {throw "error3"})()`);
|
||||
await SpecialPowers.spawn(gBrowser.selectedBrowser, [], async () => {
|
||||
const innerWindowId = content.windowGlobalChild.innerWindowId;
|
||||
const { ConsoleListener } = ChromeUtils.import(
|
||||
"chrome://remote/content/shared/listeners/ConsoleListener.jsm"
|
||||
const { ConsoleListener } = ChromeUtils.importESModule(
|
||||
"chrome://remote/content/shared/listeners/ConsoleListener.sys.mjs"
|
||||
);
|
||||
|
||||
const listener = new ConsoleListener(innerWindowId);
|
||||
|
|
|
|||
|
|
@ -2,13 +2,7 @@
|
|||
* 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";
|
||||
|
||||
const EXPORTED_SYMBOLS = ["error"];
|
||||
|
||||
const { RemoteError } = ChromeUtils.import(
|
||||
"chrome://remote/content/shared/RemoteError.jsm"
|
||||
);
|
||||
import { RemoteError } from "chrome://remote/content/shared/RemoteError.sys.mjs";
|
||||
|
||||
class MessageHandlerError extends RemoteError {
|
||||
/**
|
||||
|
|
@ -90,7 +84,7 @@ const STATUSES = new Map([
|
|||
]);
|
||||
|
||||
/** @namespace */
|
||||
const error = {
|
||||
export const error = {
|
||||
MessageHandlerError,
|
||||
UnsupportedCommandError,
|
||||
};
|
||||
|
|
@ -2,21 +2,15 @@
|
|||
* 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";
|
||||
|
||||
const EXPORTED_SYMBOLS = ["EventsDispatcher"];
|
||||
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
||||
);
|
||||
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
|
||||
|
||||
const lazy = {};
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
ContextDescriptorType:
|
||||
"chrome://remote/content/shared/messagehandler/MessageHandler.jsm",
|
||||
Log: "chrome://remote/content/shared/Log.jsm",
|
||||
TabManager: "chrome://remote/content/shared/TabManager.jsm",
|
||||
"chrome://remote/content/shared/messagehandler/MessageHandler.sys.mjs",
|
||||
Log: "chrome://remote/content/shared/Log.sys.mjs",
|
||||
TabManager: "chrome://remote/content/shared/TabManager.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyGetter(lazy, "logger", () => lazy.Log.get());
|
||||
|
|
@ -27,7 +21,7 @@ XPCOMUtils.defineLazyGetter(lazy, "logger", () => lazy.Log.get());
|
|||
* subscribe and unsubscribe to those events based on SessionData updates
|
||||
* and should use the "event" SessionData category.
|
||||
*/
|
||||
class EventsDispatcher {
|
||||
export class EventsDispatcher {
|
||||
// The MessageHandler owning this EventsDispatcher.
|
||||
#messageHandler;
|
||||
|
||||
|
|
@ -2,13 +2,7 @@
|
|||
* 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";
|
||||
|
||||
const EXPORTED_SYMBOLS = ["ContextDescriptorType", "MessageHandler"];
|
||||
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
||||
);
|
||||
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
|
||||
|
||||
const { EventEmitter } = ChromeUtils.import(
|
||||
"resource://gre/modules/EventEmitter.jsm"
|
||||
|
|
@ -16,12 +10,13 @@ const { EventEmitter } = ChromeUtils.import(
|
|||
|
||||
const lazy = {};
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
error: "chrome://remote/content/shared/messagehandler/Errors.jsm",
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
error: "chrome://remote/content/shared/messagehandler/Errors.sys.mjs",
|
||||
EventsDispatcher:
|
||||
"chrome://remote/content/shared/messagehandler/EventsDispatcher.jsm",
|
||||
Log: "chrome://remote/content/shared/Log.jsm",
|
||||
ModuleCache: "chrome://remote/content/shared/messagehandler/ModuleCache.jsm",
|
||||
"chrome://remote/content/shared/messagehandler/EventsDispatcher.sys.mjs",
|
||||
Log: "chrome://remote/content/shared/Log.sys.mjs",
|
||||
ModuleCache:
|
||||
"chrome://remote/content/shared/messagehandler/ModuleCache.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyGetter(lazy, "logger", () => lazy.Log.get());
|
||||
|
|
@ -45,7 +40,7 @@ XPCOMUtils.defineLazyGetter(lazy, "logger", () => lazy.Log.get());
|
|||
*
|
||||
* @enum {string}
|
||||
*/
|
||||
const ContextDescriptorType = {
|
||||
export const ContextDescriptorType = {
|
||||
All: "All",
|
||||
TopBrowsingContext: "TopBrowsingContext",
|
||||
};
|
||||
|
|
@ -90,7 +85,7 @@ const ContextDescriptorType = {
|
|||
* instances are properly registered and can be retrieved based on a given
|
||||
* session id as well as some other context information.
|
||||
*/
|
||||
class MessageHandler extends EventEmitter {
|
||||
export class MessageHandler extends EventEmitter {
|
||||
#context;
|
||||
#contextId;
|
||||
#eventsDispatcher;
|
||||
|
|
@ -2,13 +2,7 @@
|
|||
* 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";
|
||||
|
||||
const EXPORTED_SYMBOLS = ["getMessageHandlerClass", "MessageHandlerRegistry"];
|
||||
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
||||
);
|
||||
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
|
||||
|
||||
const { EventEmitter } = ChromeUtils.import(
|
||||
"resource://gre/modules/EventEmitter.jsm"
|
||||
|
|
@ -16,14 +10,14 @@ const { EventEmitter } = ChromeUtils.import(
|
|||
|
||||
const lazy = {};
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
Log: "chrome://remote/content/shared/Log.jsm",
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
Log: "chrome://remote/content/shared/Log.sys.mjs",
|
||||
readSessionData:
|
||||
"chrome://remote/content/shared/messagehandler/sessiondata/SessionDataReader.jsm",
|
||||
"chrome://remote/content/shared/messagehandler/sessiondata/SessionDataReader.sys.mjs",
|
||||
RootMessageHandler:
|
||||
"chrome://remote/content/shared/messagehandler/RootMessageHandler.jsm",
|
||||
"chrome://remote/content/shared/messagehandler/RootMessageHandler.sys.mjs",
|
||||
WindowGlobalMessageHandler:
|
||||
"chrome://remote/content/shared/messagehandler/WindowGlobalMessageHandler.jsm",
|
||||
"chrome://remote/content/shared/messagehandler/WindowGlobalMessageHandler.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyGetter(lazy, "logger", () => lazy.Log.get());
|
||||
|
|
@ -51,7 +45,7 @@ XPCOMUtils.defineLazyGetter(
|
|||
* @throws {Error}
|
||||
* Throws if no MessageHandler subclass is found for the provided type.
|
||||
*/
|
||||
function getMessageHandlerClass(type) {
|
||||
export function getMessageHandlerClass(type) {
|
||||
if (!lazy.MessageHandlerClasses.has(type)) {
|
||||
throw new Error(`No MessageHandler class available for type "${type}"`);
|
||||
}
|
||||
|
|
@ -70,7 +64,7 @@ function getMessageHandlerClass(type) {
|
|||
* The registry is useful to retrieve the appropriate MessageHandler instance
|
||||
* after crossing a technical boundary (eg process, thread...).
|
||||
*/
|
||||
class MessageHandlerRegistry extends EventEmitter {
|
||||
export class MessageHandlerRegistry extends EventEmitter {
|
||||
/*
|
||||
* @param {String} type
|
||||
* MessageHandler type, one of MessageHandler.type.
|
||||
|
|
@ -2,27 +2,21 @@
|
|||
* 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";
|
||||
|
||||
const EXPORTED_SYMBOLS = ["Module"];
|
||||
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
||||
);
|
||||
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
|
||||
|
||||
const lazy = {};
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
ContextDescriptorType:
|
||||
"chrome://remote/content/shared/messagehandler/MessageHandler.jsm",
|
||||
error: "chrome://remote/content/shared/webdriver/Errors.jsm",
|
||||
"chrome://remote/content/shared/messagehandler/MessageHandler.sys.mjs",
|
||||
error: "chrome://remote/content/shared/webdriver/Errors.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyGetter(lazy, "disabledExperimentalAPI", () => {
|
||||
return !Services.prefs.getBoolPref("remote.experimental.enabled");
|
||||
});
|
||||
|
||||
class Module {
|
||||
export class Module {
|
||||
#messageHandler;
|
||||
|
||||
/**
|
||||
|
|
@ -2,20 +2,14 @@
|
|||
* 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";
|
||||
|
||||
const EXPORTED_SYMBOLS = ["ModuleCache"];
|
||||
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
||||
);
|
||||
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
|
||||
|
||||
const lazy = {};
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
getMessageHandlerClass:
|
||||
"chrome://remote/content/shared/messagehandler/MessageHandlerRegistry.jsm",
|
||||
Log: "chrome://remote/content/shared/Log.jsm",
|
||||
"chrome://remote/content/shared/messagehandler/MessageHandlerRegistry.sys.mjs",
|
||||
Log: "chrome://remote/content/shared/Log.sys.mjs",
|
||||
});
|
||||
|
||||
const protocols = {
|
||||
|
|
@ -29,9 +23,10 @@ XPCOMUtils.defineLazyModuleGetters(protocols.bidi, {
|
|||
getModuleClass:
|
||||
"chrome://remote/content/webdriver-bidi/modules/ModuleRegistry.jsm",
|
||||
});
|
||||
XPCOMUtils.defineLazyModuleGetters(protocols.test, {
|
||||
// eslint-disable-next-line mozilla/lazy-getter-object-name
|
||||
ChromeUtils.defineESModuleGetters(protocols.test, {
|
||||
getModuleClass:
|
||||
"chrome://mochitests/content/browser/remote/shared/messagehandler/test/browser/resources/modules/ModuleRegistry.jsm",
|
||||
"chrome://mochitests/content/browser/remote/shared/messagehandler/test/browser/resources/modules/ModuleRegistry.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyGetter(lazy, "logger", () => lazy.Log.get());
|
||||
|
|
@ -67,7 +62,7 @@ XPCOMUtils.defineLazyGetter(lazy, "logger", () => lazy.Log.get());
|
|||
* the logic detailed above, the MessageHandler will assume that the command
|
||||
* should simply be forwarded to the next layer of the network.
|
||||
*/
|
||||
class ModuleCache {
|
||||
export class ModuleCache {
|
||||
/*
|
||||
* @param {MessageHandler} messageHandler
|
||||
* The MessageHandler instance which owns this ModuleCache instance.
|
||||
|
|
@ -2,27 +2,17 @@
|
|||
* 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";
|
||||
|
||||
const EXPORTED_SYMBOLS = ["RootMessageHandler"];
|
||||
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
||||
);
|
||||
|
||||
const { MessageHandler } = ChromeUtils.import(
|
||||
"chrome://remote/content/shared/messagehandler/MessageHandler.jsm"
|
||||
);
|
||||
import { MessageHandler } from "chrome://remote/content/shared/messagehandler/MessageHandler.sys.mjs";
|
||||
|
||||
const lazy = {};
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
FrameTransport:
|
||||
"chrome://remote/content/shared/messagehandler/transports/FrameTransport.jsm",
|
||||
"chrome://remote/content/shared/messagehandler/transports/FrameTransport.sys.mjs",
|
||||
SessionData:
|
||||
"chrome://remote/content/shared/messagehandler/sessiondata/SessionData.jsm",
|
||||
"chrome://remote/content/shared/messagehandler/sessiondata/SessionData.sys.mjs",
|
||||
WindowGlobalMessageHandler:
|
||||
"chrome://remote/content/shared/messagehandler/WindowGlobalMessageHandler.jsm",
|
||||
"chrome://remote/content/shared/messagehandler/WindowGlobalMessageHandler.sys.mjs",
|
||||
});
|
||||
|
||||
/**
|
||||
|
|
@ -30,7 +20,7 @@ XPCOMUtils.defineLazyModuleGetters(lazy, {
|
|||
* in the parent process. It can forward commands to MessageHandlers in other
|
||||
* layers (at the moment WindowGlobalMessageHandlers in content processes).
|
||||
*/
|
||||
class RootMessageHandler extends MessageHandler {
|
||||
export class RootMessageHandler extends MessageHandler {
|
||||
#frameTransport;
|
||||
#sessionData;
|
||||
|
||||
|
|
@ -2,16 +2,9 @@
|
|||
* 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";
|
||||
import { MessageHandlerRegistry } from "chrome://remote/content/shared/messagehandler/MessageHandlerRegistry.sys.mjs";
|
||||
|
||||
var EXPORTED_SYMBOLS = ["RootMessageHandlerRegistry"];
|
||||
|
||||
const { MessageHandlerRegistry } = ChromeUtils.import(
|
||||
"chrome://remote/content/shared/messagehandler/MessageHandlerRegistry.jsm"
|
||||
);
|
||||
const { RootMessageHandler } = ChromeUtils.import(
|
||||
"chrome://remote/content/shared/messagehandler/RootMessageHandler.jsm"
|
||||
);
|
||||
import { RootMessageHandler } from "chrome://remote/content/shared/messagehandler/RootMessageHandler.sys.mjs";
|
||||
|
||||
/**
|
||||
* In the parent process, only one Root MessageHandlerRegistry should ever be
|
||||
|
|
@ -19,6 +12,6 @@ const { RootMessageHandler } = ChromeUtils.import(
|
|||
* registry and from there either create or retrieve Root MessageHandler
|
||||
* instances for a specific session.
|
||||
*/
|
||||
var RootMessageHandlerRegistry = new MessageHandlerRegistry(
|
||||
export var RootMessageHandlerRegistry = new MessageHandlerRegistry(
|
||||
RootMessageHandler.type
|
||||
);
|
||||
|
|
@ -2,13 +2,10 @@
|
|||
* 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";
|
||||
|
||||
const EXPORTED_SYMBOLS = ["WindowGlobalMessageHandler"];
|
||||
|
||||
const { ContextDescriptorType, MessageHandler } = ChromeUtils.import(
|
||||
"chrome://remote/content/shared/messagehandler/MessageHandler.jsm"
|
||||
);
|
||||
import {
|
||||
ContextDescriptorType,
|
||||
MessageHandler,
|
||||
} from "chrome://remote/content/shared/messagehandler/MessageHandler.sys.mjs";
|
||||
|
||||
/**
|
||||
* A WindowGlobalMessageHandler is dedicated to debugging a single window
|
||||
|
|
@ -17,7 +14,7 @@ const { ContextDescriptorType, MessageHandler } = ChromeUtils.import(
|
|||
* commands further to other MessageHandlers and represents a leaf node in a
|
||||
* MessageHandler network.
|
||||
*/
|
||||
class WindowGlobalMessageHandler extends MessageHandler {
|
||||
export class WindowGlobalMessageHandler extends MessageHandler {
|
||||
#innerWindowId;
|
||||
|
||||
constructor() {
|
||||
|
|
@ -2,27 +2,21 @@
|
|||
* 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";
|
||||
|
||||
const EXPORTED_SYMBOLS = ["SESSION_DATA_SHARED_DATA_KEY", "SessionData"];
|
||||
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
||||
);
|
||||
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
|
||||
|
||||
const lazy = {};
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
ContextDescriptorType:
|
||||
"chrome://remote/content/shared/messagehandler/MessageHandler.jsm",
|
||||
Log: "chrome://remote/content/shared/Log.jsm",
|
||||
"chrome://remote/content/shared/messagehandler/MessageHandler.sys.mjs",
|
||||
Log: "chrome://remote/content/shared/Log.sys.mjs",
|
||||
RootMessageHandler:
|
||||
"chrome://remote/content/shared/messagehandler/RootMessageHandler.jsm",
|
||||
"chrome://remote/content/shared/messagehandler/RootMessageHandler.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyGetter(lazy, "logger", () => lazy.Log.get());
|
||||
|
||||
const SESSION_DATA_SHARED_DATA_KEY = "MessageHandlerSessionData";
|
||||
export const SESSION_DATA_SHARED_DATA_KEY = "MessageHandlerSessionData";
|
||||
|
||||
// This is a map from session id to session data, which will be persisted and
|
||||
// propagated to all processes using Services' sharedData.
|
||||
|
|
@ -86,7 +80,7 @@ const sessionDataMap = new Map();
|
|||
* SessionDataReader's readSessionData to get read-only access to session data.
|
||||
*
|
||||
*/
|
||||
class SessionData {
|
||||
export class SessionData {
|
||||
constructor(messageHandler) {
|
||||
if (messageHandler.constructor.type != lazy.RootMessageHandler.type) {
|
||||
throw new Error(
|
||||
|
|
@ -2,19 +2,13 @@
|
|||
* 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";
|
||||
|
||||
const EXPORTED_SYMBOLS = ["readSessionData"];
|
||||
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
||||
);
|
||||
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
|
||||
|
||||
const lazy = {};
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
SESSION_DATA_SHARED_DATA_KEY:
|
||||
"chrome://remote/content/shared/messagehandler/sessiondata/SessionData.jsm",
|
||||
"chrome://remote/content/shared/messagehandler/sessiondata/SessionData.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyGetter(lazy, "sharedData", () => {
|
||||
|
|
@ -31,5 +25,5 @@ XPCOMUtils.defineLazyGetter(lazy, "sharedData", () => {
|
|||
* @return {Map.<string, Array<SessionDataItem>>}
|
||||
* Map of session id to arrays of SessionDataItems.
|
||||
*/
|
||||
const readSessionData = () =>
|
||||
export const readSessionData = () =>
|
||||
lazy.sharedData.get(lazy.SESSION_DATA_SHARED_DATA_KEY) || new Map();
|
||||
|
|
@ -36,8 +36,8 @@ function sendTestBroadcastCommand(
|
|||
contextDescriptor,
|
||||
rootMessageHandler
|
||||
) {
|
||||
const { WindowGlobalMessageHandler } = ChromeUtils.import(
|
||||
"chrome://remote/content/shared/messagehandler/WindowGlobalMessageHandler.jsm"
|
||||
const { WindowGlobalMessageHandler } = ChromeUtils.importESModule(
|
||||
"chrome://remote/content/shared/messagehandler/WindowGlobalMessageHandler.sys.mjs"
|
||||
);
|
||||
|
||||
info("Send a test broadcast command");
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const { WindowGlobalMessageHandler } = ChromeUtils.import(
|
||||
"chrome://remote/content/shared/messagehandler/WindowGlobalMessageHandler.jsm"
|
||||
const { WindowGlobalMessageHandler } = ChromeUtils.importESModule(
|
||||
"chrome://remote/content/shared/messagehandler/WindowGlobalMessageHandler.sys.mjs"
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -3,14 +3,14 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const { RootMessageHandlerRegistry } = ChromeUtils.import(
|
||||
"chrome://remote/content/shared/messagehandler/RootMessageHandlerRegistry.jsm"
|
||||
const { RootMessageHandlerRegistry } = ChromeUtils.importESModule(
|
||||
"chrome://remote/content/shared/messagehandler/RootMessageHandlerRegistry.sys.mjs"
|
||||
);
|
||||
const { RootMessageHandler } = ChromeUtils.import(
|
||||
"chrome://remote/content/shared/messagehandler/RootMessageHandler.jsm"
|
||||
const { RootMessageHandler } = ChromeUtils.importESModule(
|
||||
"chrome://remote/content/shared/messagehandler/RootMessageHandler.sys.mjs"
|
||||
);
|
||||
const { WindowGlobalMessageHandler } = ChromeUtils.import(
|
||||
"chrome://remote/content/shared/messagehandler/WindowGlobalMessageHandler.jsm"
|
||||
const { WindowGlobalMessageHandler } = ChromeUtils.importESModule(
|
||||
"chrome://remote/content/shared/messagehandler/WindowGlobalMessageHandler.sys.mjs"
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const { isBrowsingContextCompatible } = ChromeUtils.import(
|
||||
"chrome://remote/content/shared/messagehandler/transports/FrameContextUtils.jsm"
|
||||
const { isBrowsingContextCompatible } = ChromeUtils.importESModule(
|
||||
"chrome://remote/content/shared/messagehandler/transports/FrameContextUtils.sys.mjs"
|
||||
);
|
||||
const TEST_COM_PAGE = "https://example.com/document-builder.sjs?html=com";
|
||||
const TEST_NET_PAGE = "https://example.net/document-builder.sjs?html=net";
|
||||
|
|
@ -81,8 +81,8 @@ async function checkBrowsingContextCompatible(browser, browserId, expected) {
|
|||
browser,
|
||||
[browserId, expected],
|
||||
(_browserId, _expected) => {
|
||||
const FrameContextUtils = ChromeUtils.import(
|
||||
"chrome://remote/content/shared/messagehandler/transports/FrameContextUtils.jsm"
|
||||
const FrameContextUtils = ChromeUtils.importESModule(
|
||||
"chrome://remote/content/shared/messagehandler/transports/FrameContextUtils.sys.mjs"
|
||||
);
|
||||
is(
|
||||
FrameContextUtils.isBrowsingContextCompatible(content.browsingContext, {
|
||||
|
|
|
|||
|
|
@ -3,11 +3,11 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const { RootMessageHandler } = ChromeUtils.import(
|
||||
"chrome://remote/content/shared/messagehandler/RootMessageHandler.jsm"
|
||||
const { RootMessageHandler } = ChromeUtils.importESModule(
|
||||
"chrome://remote/content/shared/messagehandler/RootMessageHandler.sys.mjs"
|
||||
);
|
||||
const { WindowGlobalMessageHandler } = ChromeUtils.import(
|
||||
"chrome://remote/content/shared/messagehandler/WindowGlobalMessageHandler.jsm"
|
||||
const { WindowGlobalMessageHandler } = ChromeUtils.importESModule(
|
||||
"chrome://remote/content/shared/messagehandler/WindowGlobalMessageHandler.sys.mjs"
|
||||
);
|
||||
|
||||
// Check that errors from WindowGlobal modules can be caught by the consumer
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const { WindowGlobalMessageHandler } = ChromeUtils.import(
|
||||
"chrome://remote/content/shared/messagehandler/WindowGlobalMessageHandler.jsm"
|
||||
const { WindowGlobalMessageHandler } = ChromeUtils.importESModule(
|
||||
"chrome://remote/content/shared/messagehandler/WindowGlobalMessageHandler.sys.mjs"
|
||||
);
|
||||
|
||||
// We are forcing the actors to shutdown while queries are unresolved.
|
||||
|
|
|
|||
|
|
@ -3,11 +3,11 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const { RootMessageHandler } = ChromeUtils.import(
|
||||
"chrome://remote/content/shared/messagehandler/RootMessageHandler.jsm"
|
||||
const { RootMessageHandler } = ChromeUtils.importESModule(
|
||||
"chrome://remote/content/shared/messagehandler/RootMessageHandler.sys.mjs"
|
||||
);
|
||||
const { WindowGlobalMessageHandler } = ChromeUtils.import(
|
||||
"chrome://remote/content/shared/messagehandler/WindowGlobalMessageHandler.jsm"
|
||||
const { WindowGlobalMessageHandler } = ChromeUtils.importESModule(
|
||||
"chrome://remote/content/shared/messagehandler/WindowGlobalMessageHandler.sys.mjs"
|
||||
);
|
||||
|
||||
// Test calling methods only implemented in the root version of a module.
|
||||
|
|
|
|||
|
|
@ -3,11 +3,11 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const { MessageHandlerRegistry } = ChromeUtils.import(
|
||||
"chrome://remote/content/shared/messagehandler/MessageHandlerRegistry.jsm"
|
||||
const { MessageHandlerRegistry } = ChromeUtils.importESModule(
|
||||
"chrome://remote/content/shared/messagehandler/MessageHandlerRegistry.sys.mjs"
|
||||
);
|
||||
const { RootMessageHandler } = ChromeUtils.import(
|
||||
"chrome://remote/content/shared/messagehandler/RootMessageHandler.jsm"
|
||||
const { RootMessageHandler } = ChromeUtils.importESModule(
|
||||
"chrome://remote/content/shared/messagehandler/RootMessageHandler.sys.mjs"
|
||||
);
|
||||
|
||||
add_task(async function test_messageHandlerRegistry_API() {
|
||||
|
|
|
|||
|
|
@ -3,14 +3,14 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const { MessageHandlerRegistry } = ChromeUtils.import(
|
||||
"chrome://remote/content/shared/messagehandler/MessageHandlerRegistry.jsm"
|
||||
const { MessageHandlerRegistry } = ChromeUtils.importESModule(
|
||||
"chrome://remote/content/shared/messagehandler/MessageHandlerRegistry.sys.mjs"
|
||||
);
|
||||
const { RootMessageHandler } = ChromeUtils.import(
|
||||
"chrome://remote/content/shared/messagehandler/RootMessageHandler.jsm"
|
||||
const { RootMessageHandler } = ChromeUtils.importESModule(
|
||||
"chrome://remote/content/shared/messagehandler/RootMessageHandler.sys.mjs"
|
||||
);
|
||||
const { SessionData } = ChromeUtils.import(
|
||||
"chrome://remote/content/shared/messagehandler/sessiondata/SessionData.jsm"
|
||||
const { SessionData } = ChromeUtils.importESModule(
|
||||
"chrome://remote/content/shared/messagehandler/sessiondata/SessionData.sys.mjs"
|
||||
);
|
||||
|
||||
const TEST_PAGE = "http://example.com/document-builder.sjs?html=tab";
|
||||
|
|
@ -246,8 +246,8 @@ function checkSessionDataItem(item, moduleName, category, contextType, value) {
|
|||
|
||||
function getSessionDataFromContent() {
|
||||
return SpecialPowers.spawn(gBrowser.selectedBrowser, [], () => {
|
||||
const { readSessionData } = ChromeUtils.import(
|
||||
"chrome://remote/content/shared/messagehandler/sessiondata/SessionDataReader.jsm"
|
||||
const { readSessionData } = ChromeUtils.importESModule(
|
||||
"chrome://remote/content/shared/messagehandler/sessiondata/SessionDataReader.sys.mjs"
|
||||
);
|
||||
return readSessionData();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const { RootMessageHandler } = ChromeUtils.import(
|
||||
"chrome://remote/content/shared/messagehandler/RootMessageHandler.jsm"
|
||||
const { RootMessageHandler } = ChromeUtils.importESModule(
|
||||
"chrome://remote/content/shared/messagehandler/RootMessageHandler.sys.mjs"
|
||||
);
|
||||
|
||||
const TEST_PAGE = "https://example.com/document-builder.sjs?html=tab";
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const { WindowGlobalMessageHandler } = ChromeUtils.import(
|
||||
"chrome://remote/content/shared/messagehandler/WindowGlobalMessageHandler.jsm"
|
||||
const { WindowGlobalMessageHandler } = ChromeUtils.importESModule(
|
||||
"chrome://remote/content/shared/messagehandler/WindowGlobalMessageHandler.sys.mjs"
|
||||
);
|
||||
|
||||
const TEST_PAGE = "https://example.com/document-builder.sjs?html=tab";
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var { ContextDescriptorType } = ChromeUtils.import(
|
||||
"chrome://remote/content/shared/messagehandler/MessageHandler.jsm"
|
||||
var { ContextDescriptorType } = ChromeUtils.importESModule(
|
||||
"chrome://remote/content/shared/messagehandler/MessageHandler.sys.mjs"
|
||||
);
|
||||
|
||||
var contextDescriptorAll = {
|
||||
|
|
@ -13,8 +13,8 @@ var contextDescriptorAll = {
|
|||
};
|
||||
|
||||
function createRootMessageHandler(sessionId) {
|
||||
const { RootMessageHandlerRegistry } = ChromeUtils.import(
|
||||
"chrome://remote/content/shared/messagehandler/RootMessageHandlerRegistry.jsm"
|
||||
const { RootMessageHandlerRegistry } = ChromeUtils.importESModule(
|
||||
"chrome://remote/content/shared/messagehandler/RootMessageHandlerRegistry.sys.mjs"
|
||||
);
|
||||
return RootMessageHandlerRegistry.getOrCreateMessageHandler(sessionId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,10 +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/. */
|
||||
|
||||
"use strict";
|
||||
|
||||
var EXPORTED_SYMBOLS = ["getModuleClass"];
|
||||
|
||||
/**
|
||||
* Retrieve the WebDriver BiDi module class matching the provided module name
|
||||
* and folder.
|
||||
|
|
@ -20,10 +16,11 @@ var EXPORTED_SYMBOLS = ["getModuleClass"];
|
|||
* @throws {Error}
|
||||
* If the provided module folder is unexpected.
|
||||
**/
|
||||
const getModuleClass = function(moduleName, moduleFolder) {
|
||||
const path = `chrome://mochitests/content/browser/remote/shared/messagehandler/test/browser/resources/modules/${moduleFolder}/${moduleName}.jsm`;
|
||||
export const getModuleClass = function(moduleName, moduleFolder) {
|
||||
const root = `chrome://mochitests/content/browser/remote/shared/messagehandler/test/`;
|
||||
const path = `${root}browser/resources/modules/${moduleFolder}/${moduleName}.sys.mjs`;
|
||||
try {
|
||||
return ChromeUtils.import(path)[moduleName];
|
||||
return ChromeUtils.importESModule(path)[moduleName];
|
||||
} catch (e) {
|
||||
if (e.result == Cr.NS_ERROR_FILE_NOT_FOUND) {
|
||||
return null;
|
||||
|
|
@ -2,21 +2,9 @@
|
|||
* 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";
|
||||
|
||||
const EXPORTED_SYMBOLS = ["command"];
|
||||
|
||||
const { ContextDescriptorType } = ChromeUtils.import(
|
||||
"chrome://remote/content/shared/messagehandler/MessageHandler.jsm"
|
||||
);
|
||||
|
||||
const { Module } = ChromeUtils.import(
|
||||
"chrome://remote/content/shared/messagehandler/Module.jsm"
|
||||
);
|
||||
|
||||
const { WindowGlobalMessageHandler } = ChromeUtils.import(
|
||||
"chrome://remote/content/shared/messagehandler/WindowGlobalMessageHandler.jsm"
|
||||
);
|
||||
import { ContextDescriptorType } from "chrome://remote/content/shared/messagehandler/MessageHandler.sys.mjs";
|
||||
import { Module } from "chrome://remote/content/shared/messagehandler/Module.sys.mjs";
|
||||
import { WindowGlobalMessageHandler } from "chrome://remote/content/shared/messagehandler/WindowGlobalMessageHandler.sys.mjs";
|
||||
|
||||
class CommandModule extends Module {
|
||||
destroy() {}
|
||||
|
|
@ -84,4 +72,4 @@ class CommandModule extends Module {
|
|||
}
|
||||
}
|
||||
|
||||
const command = CommandModule;
|
||||
export const command = CommandModule;
|
||||
|
|
@ -2,13 +2,7 @@
|
|||
* 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";
|
||||
|
||||
const EXPORTED_SYMBOLS = ["event"];
|
||||
|
||||
const { Module } = ChromeUtils.import(
|
||||
"chrome://remote/content/shared/messagehandler/Module.jsm"
|
||||
);
|
||||
import { Module } from "chrome://remote/content/shared/messagehandler/Module.sys.mjs";
|
||||
|
||||
class EventModule extends Module {
|
||||
destroy() {}
|
||||
|
|
@ -24,4 +18,4 @@ class EventModule extends Module {
|
|||
}
|
||||
}
|
||||
|
||||
const event = EventModule;
|
||||
export const event = EventModule;
|
||||
|
|
@ -2,13 +2,7 @@
|
|||
* 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";
|
||||
|
||||
const EXPORTED_SYMBOLS = ["rootOnly"];
|
||||
|
||||
const { Module } = ChromeUtils.import(
|
||||
"chrome://remote/content/shared/messagehandler/Module.jsm"
|
||||
);
|
||||
import { Module } from "chrome://remote/content/shared/messagehandler/Module.sys.mjs";
|
||||
|
||||
class RootOnlyModule extends Module {
|
||||
#sessionDataReceived;
|
||||
|
|
@ -38,4 +32,4 @@ class RootOnlyModule extends Module {
|
|||
}
|
||||
}
|
||||
|
||||
const rootOnly = RootOnlyModule;
|
||||
export const rootOnly = RootOnlyModule;
|
||||
|
|
@ -2,13 +2,7 @@
|
|||
* 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";
|
||||
|
||||
const EXPORTED_SYMBOLS = ["command"];
|
||||
|
||||
const { Module } = ChromeUtils.import(
|
||||
"chrome://remote/content/shared/messagehandler/Module.jsm"
|
||||
);
|
||||
import { Module } from "chrome://remote/content/shared/messagehandler/Module.sys.mjs";
|
||||
|
||||
class CommandModule extends Module {
|
||||
destroy() {}
|
||||
|
|
@ -31,4 +25,4 @@ class CommandModule extends Module {
|
|||
}
|
||||
}
|
||||
|
||||
const command = CommandModule;
|
||||
export const command = CommandModule;
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue