browser-debugger-cli 0.7.1 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -6
- package/dist/cdp/protocol.d.ts +1 -1
- package/dist/cdp/protocol.js +1 -1
- package/dist/cdp/schema.d.ts +10 -0
- package/dist/cdp/schema.js +13 -0
- package/dist/commands/cdp.js +75 -23
- package/dist/commands/cleanup.js +31 -23
- package/dist/commands/console.d.ts +18 -1
- package/dist/commands/console.js +98 -53
- package/dist/commands/details.js +13 -3
- package/dist/commands/dom/DomElementResolver.d.ts +24 -69
- package/dist/commands/dom/DomElementResolver.js +71 -162
- package/dist/commands/dom/a11y.js +52 -33
- package/dist/commands/dom/eval.d.ts +13 -0
- package/dist/commands/dom/eval.js +43 -0
- package/dist/commands/dom/form.js +103 -147
- package/dist/commands/dom/formInteraction.d.ts +6 -1
- package/dist/commands/dom/formInteraction.js +223 -305
- package/dist/commands/dom/frames.d.ts +12 -0
- package/dist/commands/dom/frames.js +28 -0
- package/dist/commands/dom/get.d.ts +20 -0
- package/dist/commands/dom/get.js +141 -0
- package/dist/commands/dom/helpers/index.d.ts +11 -0
- package/dist/commands/dom/helpers/index.js +10 -0
- package/dist/commands/dom/helpers/query.d.ts +78 -0
- package/dist/commands/dom/helpers/query.js +457 -0
- package/dist/commands/dom/helpers/runElementCommand.d.ts +56 -0
- package/dist/commands/dom/helpers/runElementCommand.js +63 -0
- package/dist/commands/dom/helpers/screenshot.d.ts +30 -0
- package/dist/commands/dom/helpers/screenshot.js +374 -0
- package/dist/commands/dom/index.d.ts +15 -3
- package/dist/commands/dom/index.js +45 -511
- package/dist/commands/dom/listeners.d.ts +16 -0
- package/dist/commands/dom/listeners.js +54 -0
- package/dist/commands/dom/query.d.ts +14 -0
- package/dist/commands/dom/query.js +36 -0
- package/dist/commands/dom/screenshot.d.ts +21 -0
- package/dist/commands/dom/screenshot.js +248 -0
- package/dist/commands/dom/semanticUtils.d.ts +44 -0
- package/dist/commands/dom/semanticUtils.js +102 -0
- package/dist/commands/helpJson.d.ts +4 -2
- package/dist/commands/helpJson.js +12 -32
- package/dist/commands/helpTopic.d.ts +32 -0
- package/dist/commands/helpTopic.js +58 -0
- package/dist/commands/network/har.js +50 -24
- package/dist/commands/network/list.js +96 -63
- package/dist/commands/network/shared.d.ts +9 -15
- package/dist/commands/network/shared.js +30 -51
- package/dist/commands/optionBehaviors.d.ts +1 -9
- package/dist/commands/optionBehaviors.js +46 -25
- package/dist/commands/page.d.ts +11 -0
- package/dist/commands/page.js +112 -0
- package/dist/commands/peek.js +62 -48
- package/dist/commands/shared/CommandRunner.d.ts +18 -1
- package/dist/commands/shared/CommandRunner.js +83 -26
- package/dist/commands/shared/commonOptions.d.ts +10 -0
- package/dist/commands/shared/commonOptions.js +12 -0
- package/dist/commands/shared/daemonErrorHandler.d.ts +9 -0
- package/dist/commands/shared/daemonErrorHandler.js +31 -11
- package/dist/commands/shared/dataFetcher.d.ts +33 -10
- package/dist/commands/shared/dataFetcher.js +57 -20
- package/dist/commands/shared/followMode.d.ts +0 -3
- package/dist/commands/shared/followMode.js +6 -11
- package/dist/commands/shared/handleValidationError.d.ts +14 -0
- package/dist/commands/shared/handleValidationError.js +39 -0
- package/dist/commands/shared/optionTypes.d.ts +42 -22
- package/dist/commands/shared/outputFile.d.ts +33 -0
- package/dist/commands/shared/outputFile.js +78 -0
- package/dist/commands/shared/startHelpers.d.ts +5 -8
- package/dist/commands/shared/startHelpers.js +226 -37
- package/dist/commands/shared/validation.d.ts +42 -0
- package/dist/commands/shared/validation.js +101 -22
- package/dist/commands/start.d.ts +28 -1
- package/dist/commands/start.js +226 -38
- package/dist/commands/status.js +48 -11
- package/dist/commands/stop.js +16 -26
- package/dist/commands/tail.js +20 -35
- package/dist/commands.js +2 -0
- package/dist/connection/cdp.d.ts +12 -6
- package/dist/connection/cdp.js +59 -16
- package/dist/connection/diagnostics.d.ts +0 -9
- package/dist/connection/diagnostics.js +0 -13
- package/dist/connection/errors.d.ts +36 -1
- package/dist/connection/errors.js +43 -3
- package/dist/connection/handlers.d.ts +5 -5
- package/dist/connection/handlers.js +1 -1
- package/dist/connection/inFlightRequests.d.ts +33 -0
- package/dist/connection/inFlightRequests.js +52 -0
- package/dist/connection/launcher/binaryResolver.js +20 -7
- package/dist/connection/launcher/flagsBuilder.d.ts +24 -54
- package/dist/connection/launcher/flagsBuilder.js +65 -40
- package/dist/connection/launcher/preferencesLoader.js +27 -8
- package/dist/connection/launcher.d.ts +2 -0
- package/dist/connection/launcher.js +48 -29
- package/dist/connection/pageReadiness.d.ts +5 -6
- package/dist/connection/pageReadiness.js +63 -120
- package/dist/connection/portReservation.d.ts +10 -0
- package/dist/connection/portReservation.js +37 -2
- package/dist/connection/startupExit.d.ts +37 -0
- package/dist/connection/startupExit.js +107 -0
- package/dist/connection/typed-cdp.d.ts +8 -6
- package/dist/connection/typed-cdp.js +5 -3
- package/dist/connection/types.d.ts +3 -0
- package/dist/constants.d.ts +21 -22
- package/dist/constants.js +28 -25
- package/dist/daemon/SessionController.d.ts +125 -0
- package/dist/daemon/SessionController.js +472 -0
- package/dist/daemon/errors.d.ts +15 -19
- package/dist/daemon/errors.js +18 -21
- package/dist/daemon/ipcServer.d.ts +44 -30
- package/dist/daemon/ipcServer.js +164 -132
- package/dist/daemon/launcher.d.ts +13 -21
- package/dist/daemon/launcher.js +94 -101
- package/dist/daemon/messages.d.ts +29 -0
- package/dist/daemon/messages.js +35 -0
- package/dist/daemon/patternDefinitions.d.ts +1 -1
- package/dist/daemon/patternDefinitions.js +3 -2
- package/dist/daemon/patternDetector.d.ts +13 -29
- package/dist/daemon/patternDetector.js +26 -47
- package/dist/daemon/server/SocketServer.d.ts +56 -2
- package/dist/daemon/server/SocketServer.js +131 -30
- package/dist/daemon/session/Session.d.ts +137 -0
- package/dist/daemon/session/Session.js +288 -0
- package/dist/daemon/session/TelemetryStore.d.ts +30 -0
- package/dist/daemon/session/TelemetryStore.js +44 -0
- package/dist/daemon/session/cdpSetup.d.ts +47 -0
- package/dist/daemon/session/cdpSetup.js +94 -0
- package/dist/daemon/session/chromeConnection.d.ts +38 -0
- package/dist/daemon/session/chromeConnection.js +178 -0
- package/dist/daemon/{worker → session}/collectors.d.ts +3 -3
- package/dist/daemon/{worker → session}/collectors.js +3 -3
- package/dist/daemon/session/commandRegistry.js +445 -0
- package/dist/daemon/session/interactions.d.ts +27 -0
- package/dist/daemon/session/interactions.js +44 -0
- package/dist/daemon/{worker → session}/plugins.d.ts +3 -3
- package/dist/daemon/session/plugins.js +219 -0
- package/dist/daemon/session/targetMismatch.d.ts +34 -0
- package/dist/daemon/session/targetMismatch.js +83 -0
- package/dist/daemon/session/teardown.d.ts +27 -0
- package/dist/daemon/session/teardown.js +128 -0
- package/dist/daemon/{worker → session}/types.d.ts +2 -2
- package/dist/daemon.d.ts +3 -4
- package/dist/daemon.js +15356 -24
- package/dist/{ui/errors → errors}/CommandError.js +1 -1
- package/dist/{ui/errors → errors}/index.d.ts +2 -0
- package/dist/errors/issues.d.ts +16 -0
- package/dist/errors/issues.js +11 -0
- package/dist/errors/messages.d.ts +545 -0
- package/dist/errors/messages.js +959 -0
- package/dist/errors/notices.d.ts +30 -0
- package/dist/errors/notices.js +11 -0
- package/dist/{ui/errors → errors}/utils.js +1 -1
- package/dist/index.js +16410 -168
- package/dist/ipc/client.d.ts +44 -8
- package/dist/ipc/client.js +95 -18
- package/dist/ipc/index.d.ts +2 -2
- package/dist/ipc/index.js +2 -2
- package/dist/ipc/protocol/commands.d.ts +220 -59
- package/dist/ipc/protocol/commands.js +27 -21
- package/dist/ipc/protocol/domTypes.d.ts +236 -0
- package/dist/ipc/protocol/domTypes.js +10 -0
- package/dist/ipc/protocol/guards.d.ts +4 -4
- package/dist/ipc/protocol/guards.js +4 -4
- package/dist/ipc/protocol/messages.d.ts +9 -33
- package/dist/ipc/protocol/messages.js +1 -1
- package/dist/ipc/session/errors.d.ts +10 -2
- package/dist/ipc/session/errors.js +10 -2
- package/dist/ipc/session/lifecycle.d.ts +20 -22
- package/dist/ipc/session/queries.d.ts +21 -4
- package/dist/ipc/session/types.d.ts +1 -1
- package/dist/ipc/session/types.js +1 -1
- package/dist/ipc/transport/IPCError.d.ts +3 -3
- package/dist/ipc/transport/IPCError.js +3 -3
- package/dist/ipc/transport/index.d.ts +7 -1
- package/dist/ipc/transport/index.js +7 -2
- package/dist/ipc/transport/jsonl.d.ts +28 -2
- package/dist/ipc/transport/jsonl.js +57 -10
- package/dist/ipc/utils/errors.d.ts +4 -2
- package/dist/ipc/utils/errors.js +10 -4
- package/dist/ipc/utils/index.d.ts +0 -1
- package/dist/ipc/utils/index.js +0 -1
- package/dist/ipc/utils/responseValidator.d.ts +5 -1
- package/dist/ipc/utils/responseValidator.js +7 -3
- package/dist/runtime/dom/evalHelpers.d.ts +76 -0
- package/dist/runtime/dom/evalHelpers.js +406 -0
- package/dist/runtime/dom/eventListeners.d.ts +23 -0
- package/dist/runtime/dom/eventListeners.js +252 -0
- package/dist/runtime/dom/formDiscovery.d.ts +26 -0
- package/dist/{commands → runtime}/dom/formDiscovery.js +48 -9
- package/dist/runtime/dom/formFillHelpers/fill.d.ts +29 -0
- package/dist/runtime/dom/formFillHelpers/fill.js +299 -0
- package/dist/runtime/dom/formFillHelpers/index.d.ts +17 -0
- package/dist/runtime/dom/formFillHelpers/index.js +17 -0
- package/dist/runtime/dom/formFillHelpers/pressKey.d.ts +28 -0
- package/dist/runtime/dom/formFillHelpers/pressKey.js +195 -0
- package/dist/runtime/dom/formFillHelpers/scroll.d.ts +24 -0
- package/dist/runtime/dom/formFillHelpers/scroll.js +188 -0
- package/dist/runtime/dom/formFillHelpers/shared.d.ts +43 -0
- package/dist/runtime/dom/formFillHelpers/shared.js +100 -0
- package/dist/runtime/dom/formFillHelpers/stability.d.ts +14 -0
- package/dist/runtime/dom/formFillHelpers/stability.js +40 -0
- package/dist/runtime/dom/formSubmitHelpers.d.ts +29 -0
- package/dist/runtime/dom/formSubmitHelpers.js +252 -0
- package/dist/runtime/dom/formTypes.d.ts +8 -0
- package/dist/runtime/dom/frameSelection.d.ts +27 -0
- package/dist/runtime/dom/frameSelection.js +66 -0
- package/dist/runtime/dom/frames.d.ts +38 -0
- package/dist/runtime/dom/frames.js +305 -0
- package/dist/runtime/dom/keyMapping.d.ts +103 -0
- package/dist/runtime/dom/keyMapping.js +232 -0
- package/dist/runtime/dom/listenerSummary.d.ts +72 -0
- package/dist/runtime/dom/listenerSummary.js +150 -0
- package/dist/runtime/dom/reactEventHelpers.d.ts +61 -0
- package/dist/runtime/dom/reactEventHelpers.js +470 -0
- package/dist/runtime/dom/targetNode.d.ts +78 -0
- package/dist/runtime/dom/targetNode.js +154 -0
- package/dist/runtime/page/navigation.d.ts +34 -0
- package/dist/runtime/page/navigation.js +249 -0
- package/dist/session/QueryCacheManager.d.ts +25 -82
- package/dist/session/QueryCacheManager.js +41 -133
- package/dist/session/chrome.d.ts +21 -16
- package/dist/session/chrome.js +28 -44
- package/dist/session/cleanup/staleSession.d.ts +49 -0
- package/dist/session/cleanup/staleSession.js +124 -0
- package/dist/session/cleanup/userCommands.d.ts +36 -0
- package/dist/session/cleanup/userCommands.js +95 -0
- package/dist/session/daemonSocket.d.ts +25 -0
- package/dist/session/daemonSocket.js +40 -0
- package/dist/session/lastSession.d.ts +29 -0
- package/dist/session/lastSession.js +45 -0
- package/dist/session/metadata.d.ts +3 -1
- package/dist/session/paths.d.ts +2 -4
- package/dist/session/paths.js +2 -4
- package/dist/session/pid.d.ts +9 -38
- package/dist/session/pid.js +14 -64
- package/dist/session/port.d.ts +0 -5
- package/dist/session/port.js +9 -19
- package/dist/telemetry/a11y.d.ts +26 -20
- package/dist/telemetry/a11y.js +237 -104
- package/dist/telemetry/attachedTargets.d.ts +36 -0
- package/dist/telemetry/attachedTargets.js +163 -0
- package/dist/telemetry/console.d.ts +21 -4
- package/dist/telemetry/console.js +122 -11
- package/dist/telemetry/dialogs.d.ts +4 -2
- package/dist/telemetry/dialogs.js +3 -1
- package/dist/telemetry/dom.d.ts +1 -11
- package/dist/telemetry/dom.js +0 -102
- package/dist/telemetry/filterDsl.d.ts +9 -1
- package/dist/telemetry/filterDsl.js +101 -31
- package/dist/telemetry/filterPresets.js +12 -2
- package/dist/telemetry/filters.d.ts +1 -1
- package/dist/telemetry/filters.js +38 -3
- package/dist/telemetry/har/builder.js +190 -160
- package/dist/telemetry/har/types.d.ts +21 -4
- package/dist/telemetry/navigation.d.ts +13 -29
- package/dist/telemetry/navigation.js +12 -46
- package/dist/telemetry/network.d.ts +37 -1
- package/dist/telemetry/network.js +343 -130
- package/dist/telemetry/networkExtraInfo.d.ts +106 -0
- package/dist/telemetry/networkExtraInfo.js +241 -0
- package/dist/telemetry/objectExpander.d.ts +14 -5
- package/dist/telemetry/objectExpander.js +13 -6
- package/dist/telemetry/remoteObject.d.ts +10 -2
- package/dist/telemetry/remoteObject.js +59 -2
- package/dist/telemetry/remoteObjectUtils.js +22 -3
- package/dist/types.d.ts +64 -44
- package/dist/types.js +1 -33
- package/dist/ui/OutputBuilder.d.ts +17 -14
- package/dist/ui/OutputBuilder.js +18 -87
- package/dist/ui/formatters/a11y.js +72 -9
- package/dist/ui/formatters/console/chronological.d.ts +14 -0
- package/dist/ui/formatters/console/chronological.js +58 -0
- package/dist/ui/formatters/console/follow.d.ts +18 -0
- package/dist/ui/formatters/console/follow.js +36 -0
- package/dist/ui/formatters/console/json.d.ts +21 -0
- package/dist/ui/formatters/console/json.js +53 -0
- package/dist/ui/formatters/console/shared.d.ts +136 -0
- package/dist/ui/formatters/console/shared.js +158 -0
- package/dist/ui/formatters/console/summarize.d.ts +10 -0
- package/dist/ui/formatters/console/summarize.js +63 -0
- package/dist/ui/formatters/console.d.ts +16 -137
- package/dist/ui/formatters/console.js +17 -418
- package/dist/ui/formatters/cookies.js +3 -3
- package/dist/ui/formatters/details.d.ts +5 -2
- package/dist/ui/formatters/details.js +183 -24
- package/dist/ui/formatters/dom.d.ts +27 -6
- package/dist/ui/formatters/dom.js +80 -28
- package/dist/ui/formatters/form.js +35 -56
- package/dist/ui/formatters/helpFormatters.js +5 -4
- package/dist/ui/formatters/listeners.d.ts +24 -0
- package/dist/ui/formatters/listeners.js +96 -0
- package/dist/ui/formatters/networkHeaders.d.ts +3 -3
- package/dist/ui/formatters/networkHeaders.js +7 -4
- package/dist/ui/formatters/networkList.d.ts +14 -2
- package/dist/ui/formatters/networkList.js +80 -35
- package/dist/ui/formatters/preview.d.ts +21 -3
- package/dist/ui/formatters/preview.js +53 -72
- package/dist/ui/formatters/requestStatus.d.ts +34 -0
- package/dist/ui/formatters/requestStatus.js +55 -0
- package/dist/ui/formatters/semantic.d.ts +1 -1
- package/dist/ui/formatters/semantic.js +1 -1
- package/dist/ui/formatters/sessionFormatters.js +11 -8
- package/dist/ui/formatters/status.d.ts +23 -5
- package/dist/ui/formatters/status.js +48 -24
- package/dist/ui/formatting.d.ts +35 -0
- package/dist/ui/formatting.js +122 -23
- package/dist/ui/logging/logger.d.ts +1 -1
- package/dist/ui/messages/chrome.d.ts +35 -100
- package/dist/ui/messages/chrome.js +102 -136
- package/dist/ui/messages/commands.d.ts +121 -3
- package/dist/ui/messages/commands.js +153 -6
- package/dist/ui/messages/consoleMessages.d.ts +0 -6
- package/dist/ui/messages/consoleMessages.js +0 -8
- package/dist/ui/messages/hints.d.ts +9 -15
- package/dist/ui/messages/hints.js +17 -16
- package/dist/ui/messages/networkMessages.d.ts +0 -6
- package/dist/ui/messages/networkMessages.js +0 -8
- package/dist/ui/messages/preview.js +2 -2
- package/dist/ui/messages/session.d.ts +24 -3
- package/dist/ui/messages/session.js +38 -7
- package/dist/ui/messages/validation.d.ts +15 -26
- package/dist/ui/messages/validation.js +33 -38
- package/dist/utils/atomicFile.js +1 -1
- package/dist/utils/decisionTrees.js +1 -1
- package/dist/utils/errorMapping.js +15 -4
- package/dist/utils/errors.d.ts +13 -0
- package/dist/utils/errors.js +21 -0
- package/dist/utils/exitCodes.d.ts +5 -0
- package/dist/utils/exitCodes.js +36 -2
- package/dist/utils/http.d.ts +35 -4
- package/dist/utils/http.js +59 -6
- package/dist/utils/packageRoot.d.ts +12 -0
- package/dist/utils/packageRoot.js +33 -0
- package/dist/utils/process.d.ts +10 -0
- package/dist/utils/process.js +35 -3
- package/dist/utils/selectorFilters.d.ts +45 -0
- package/dist/utils/selectorFilters.js +224 -0
- package/dist/utils/suggestions.js +1 -1
- package/dist/utils/taskMappings.js +7 -2
- package/dist/utils/typeGuards.js +2 -2
- package/dist/utils/url.d.ts +13 -5
- package/dist/utils/url.js +53 -52
- package/dist/utils/validation.d.ts +15 -93
- package/dist/utils/validation.js +10 -118
- package/dist/utils/version.js +3 -5
- package/package.json +39 -30
- package/dist/__testfixtures__/cdpMessages.d.ts +0 -43
- package/dist/__testfixtures__/cdpMessages.d.ts.map +0 -1
- package/dist/__testfixtures__/cdpMessages.js +0 -118
- package/dist/__testfixtures__/cdpMessages.js.map +0 -1
- package/dist/__testfixtures__/connectionTargets.d.ts +0 -21
- package/dist/__testfixtures__/connectionTargets.d.ts.map +0 -1
- package/dist/__testfixtures__/connectionTargets.js +0 -59
- package/dist/__testfixtures__/connectionTargets.js.map +0 -1
- package/dist/__tests__/fixtures/schema-v0.2.1.golden.json +0 -47
- package/dist/__tests__/integration/session-files.integration.test.d.ts +0 -2
- package/dist/__tests__/integration/session-files.integration.test.d.ts.map +0 -1
- package/dist/__tests__/integration/session-files.integration.test.js +0 -66
- package/dist/__tests__/integration/session-files.integration.test.js.map +0 -1
- package/dist/__tests__/schema.contract.test.d.ts +0 -19
- package/dist/__tests__/schema.contract.test.d.ts.map +0 -1
- package/dist/__tests__/schema.contract.test.js +0 -236
- package/dist/__tests__/schema.contract.test.js.map +0 -1
- package/dist/__tests__/smoke/error-handling.smoke.test.d.ts +0 -8
- package/dist/__tests__/smoke/error-handling.smoke.test.d.ts.map +0 -1
- package/dist/__tests__/smoke/error-handling.smoke.test.js +0 -66
- package/dist/__tests__/smoke/error-handling.smoke.test.js.map +0 -1
- package/dist/__tests__/smoke/session-lifecycle.smoke.test.d.ts +0 -8
- package/dist/__tests__/smoke/session-lifecycle.smoke.test.d.ts.map +0 -1
- package/dist/__tests__/smoke/session-lifecycle.smoke.test.js +0 -112
- package/dist/__tests__/smoke/session-lifecycle.smoke.test.js.map +0 -1
- package/dist/__tests__/telemetry/filterDsl.unit.test.d.ts +0 -12
- package/dist/__tests__/telemetry/filterDsl.unit.test.d.ts.map +0 -1
- package/dist/__tests__/telemetry/filterDsl.unit.test.js +0 -374
- package/dist/__tests__/telemetry/filterDsl.unit.test.js.map +0 -1
- package/dist/__tests__/telemetry/filterPresets.unit.test.d.ts +0 -10
- package/dist/__tests__/telemetry/filterPresets.unit.test.d.ts.map +0 -1
- package/dist/__tests__/telemetry/filterPresets.unit.test.js +0 -89
- package/dist/__tests__/telemetry/filterPresets.unit.test.js.map +0 -1
- package/dist/__testutils__/FakeClock.d.ts +0 -67
- package/dist/__testutils__/FakeClock.d.ts.map +0 -1
- package/dist/__testutils__/FakeClock.js +0 -132
- package/dist/__testutils__/FakeClock.js.map +0 -1
- package/dist/__testutils__/FakeWebSocket.d.ts +0 -106
- package/dist/__testutils__/FakeWebSocket.d.ts.map +0 -1
- package/dist/__testutils__/FakeWebSocket.js +0 -213
- package/dist/__testutils__/FakeWebSocket.js.map +0 -1
- package/dist/__testutils__/assertions.d.ts +0 -33
- package/dist/__testutils__/assertions.d.ts.map +0 -1
- package/dist/__testutils__/assertions.js +0 -57
- package/dist/__testutils__/assertions.js.map +0 -1
- package/dist/__testutils__/commandRunner.d.ts +0 -45
- package/dist/__testutils__/commandRunner.d.ts.map +0 -1
- package/dist/__testutils__/commandRunner.js +0 -108
- package/dist/__testutils__/commandRunner.js.map +0 -1
- package/dist/__testutils__/daemonHelpers.d.ts +0 -93
- package/dist/__testutils__/daemonHelpers.d.ts.map +0 -1
- package/dist/__testutils__/daemonHelpers.js +0 -255
- package/dist/__testutils__/daemonHelpers.js.map +0 -1
- package/dist/__testutils__/index.d.ts +0 -16
- package/dist/__testutils__/index.d.ts.map +0 -1
- package/dist/__testutils__/index.js +0 -16
- package/dist/__testutils__/index.js.map +0 -1
- package/dist/__testutils__/testCleanup.d.ts +0 -45
- package/dist/__testutils__/testCleanup.d.ts.map +0 -1
- package/dist/__testutils__/testCleanup.js +0 -87
- package/dist/__testutils__/testCleanup.js.map +0 -1
- package/dist/__testutils__/testClock.d.ts +0 -28
- package/dist/__testutils__/testClock.d.ts.map +0 -1
- package/dist/__testutils__/testClock.js +0 -81
- package/dist/__testutils__/testClock.js.map +0 -1
- package/dist/__testutils__/testFixtures.d.ts +0 -15
- package/dist/__testutils__/testFixtures.d.ts.map +0 -1
- package/dist/__testutils__/testFixtures.js +0 -23
- package/dist/__testutils__/testFixtures.js.map +0 -1
- package/dist/__testutils__/testHome.d.ts +0 -26
- package/dist/__testutils__/testHome.d.ts.map +0 -1
- package/dist/__testutils__/testHome.js +0 -57
- package/dist/__testutils__/testHome.js.map +0 -1
- package/dist/__testutils__/testProcess.d.ts +0 -46
- package/dist/__testutils__/testProcess.d.ts.map +0 -1
- package/dist/__testutils__/testProcess.js +0 -85
- package/dist/__testutils__/testProcess.js.map +0 -1
- package/dist/cdp/protocol.d.ts.map +0 -1
- package/dist/cdp/protocol.js.map +0 -1
- package/dist/cdp/schema.d.ts.map +0 -1
- package/dist/cdp/schema.js.map +0 -1
- package/dist/cdp/types.d.ts.map +0 -1
- package/dist/cdp/types.js.map +0 -1
- package/dist/commands/__tests__/cdp.contract.test.d.ts +0 -24
- package/dist/commands/__tests__/cdp.contract.test.d.ts.map +0 -1
- package/dist/commands/__tests__/cdp.contract.test.js +0 -466
- package/dist/commands/__tests__/cdp.contract.test.js.map +0 -1
- package/dist/commands/__tests__/console.contract.test.d.ts +0 -9
- package/dist/commands/__tests__/console.contract.test.d.ts.map +0 -1
- package/dist/commands/__tests__/console.contract.test.js +0 -118
- package/dist/commands/__tests__/console.contract.test.js.map +0 -1
- package/dist/commands/__tests__/domEval.contract.test.d.ts +0 -17
- package/dist/commands/__tests__/domEval.contract.test.d.ts.map +0 -1
- package/dist/commands/__tests__/domEval.contract.test.js +0 -235
- package/dist/commands/__tests__/domEval.contract.test.js.map +0 -1
- package/dist/commands/__tests__/helpJson.contract.test.d.ts +0 -12
- package/dist/commands/__tests__/helpJson.contract.test.d.ts.map +0 -1
- package/dist/commands/__tests__/helpJson.contract.test.js +0 -121
- package/dist/commands/__tests__/helpJson.contract.test.js.map +0 -1
- package/dist/commands/__tests__/machineReadableHelp.contract.test.d.ts +0 -12
- package/dist/commands/__tests__/machineReadableHelp.contract.test.d.ts.map +0 -1
- package/dist/commands/__tests__/machineReadableHelp.contract.test.js +0 -121
- package/dist/commands/__tests__/machineReadableHelp.contract.test.js.map +0 -1
- package/dist/commands/cdp.d.ts.map +0 -1
- package/dist/commands/cdp.js.map +0 -1
- package/dist/commands/cleanup.d.ts.map +0 -1
- package/dist/commands/cleanup.js.map +0 -1
- package/dist/commands/console.d.ts.map +0 -1
- package/dist/commands/console.js.map +0 -1
- package/dist/commands/details.d.ts.map +0 -1
- package/dist/commands/details.js.map +0 -1
- package/dist/commands/dom/DomElementResolver.d.ts.map +0 -1
- package/dist/commands/dom/DomElementResolver.js.map +0 -1
- package/dist/commands/dom/__tests__/screenshotResize.unit.test.d.ts +0 -2
- package/dist/commands/dom/__tests__/screenshotResize.unit.test.d.ts.map +0 -1
- package/dist/commands/dom/__tests__/screenshotResize.unit.test.js +0 -184
- package/dist/commands/dom/__tests__/screenshotResize.unit.test.js.map +0 -1
- package/dist/commands/dom/a11y.d.ts.map +0 -1
- package/dist/commands/dom/a11y.js.map +0 -1
- package/dist/commands/dom/evalHelpers.d.ts +0 -38
- package/dist/commands/dom/evalHelpers.d.ts.map +0 -1
- package/dist/commands/dom/evalHelpers.js +0 -121
- package/dist/commands/dom/evalHelpers.js.map +0 -1
- package/dist/commands/dom/form.d.ts.map +0 -1
- package/dist/commands/dom/form.js.map +0 -1
- package/dist/commands/dom/formDiscovery.d.ts +0 -26
- package/dist/commands/dom/formDiscovery.d.ts.map +0 -1
- package/dist/commands/dom/formDiscovery.js.map +0 -1
- package/dist/commands/dom/formFillHelpers.d.ts +0 -186
- package/dist/commands/dom/formFillHelpers.d.ts.map +0 -1
- package/dist/commands/dom/formFillHelpers.js +0 -650
- package/dist/commands/dom/formFillHelpers.js.map +0 -1
- package/dist/commands/dom/formInteraction.d.ts.map +0 -1
- package/dist/commands/dom/formInteraction.js.map +0 -1
- package/dist/commands/dom/formSubmitHelpers.d.ts +0 -59
- package/dist/commands/dom/formSubmitHelpers.d.ts.map +0 -1
- package/dist/commands/dom/formSubmitHelpers.js +0 -163
- package/dist/commands/dom/formSubmitHelpers.js.map +0 -1
- package/dist/commands/dom/formTypes.d.ts +0 -75
- package/dist/commands/dom/formTypes.d.ts.map +0 -1
- package/dist/commands/dom/formTypes.js.map +0 -1
- package/dist/commands/dom/helpers.d.ts +0 -86
- package/dist/commands/dom/helpers.d.ts.map +0 -1
- package/dist/commands/dom/helpers.js +0 -656
- package/dist/commands/dom/helpers.js.map +0 -1
- package/dist/commands/dom/index.d.ts.map +0 -1
- package/dist/commands/dom/index.js.map +0 -1
- package/dist/commands/dom/keyMapping.d.ts +0 -56
- package/dist/commands/dom/keyMapping.d.ts.map +0 -1
- package/dist/commands/dom/keyMapping.js +0 -110
- package/dist/commands/dom/keyMapping.js.map +0 -1
- package/dist/commands/dom/reactEventHelpers.d.ts +0 -79
- package/dist/commands/dom/reactEventHelpers.d.ts.map +0 -1
- package/dist/commands/dom/reactEventHelpers.js +0 -239
- package/dist/commands/dom/reactEventHelpers.js.map +0 -1
- package/dist/commands/dom/screenshotResize.d.ts.map +0 -1
- package/dist/commands/dom/screenshotResize.js.map +0 -1
- package/dist/commands/helpJson.d.ts.map +0 -1
- package/dist/commands/helpJson.js.map +0 -1
- package/dist/commands/machineReadableHelp.d.ts +0 -165
- package/dist/commands/machineReadableHelp.d.ts.map +0 -1
- package/dist/commands/machineReadableHelp.js +0 -252
- package/dist/commands/machineReadableHelp.js.map +0 -1
- package/dist/commands/network/har.d.ts.map +0 -1
- package/dist/commands/network/har.js.map +0 -1
- package/dist/commands/network/index.d.ts.map +0 -1
- package/dist/commands/network/index.js.map +0 -1
- package/dist/commands/network/list.d.ts.map +0 -1
- package/dist/commands/network/list.js.map +0 -1
- package/dist/commands/network/shared.d.ts.map +0 -1
- package/dist/commands/network/shared.js.map +0 -1
- package/dist/commands/network.d.ts +0 -8
- package/dist/commands/network.d.ts.map +0 -1
- package/dist/commands/network.js +0 -216
- package/dist/commands/network.js.map +0 -1
- package/dist/commands/optionBehaviors.d.ts.map +0 -1
- package/dist/commands/optionBehaviors.js.map +0 -1
- package/dist/commands/peek.d.ts.map +0 -1
- package/dist/commands/peek.js.map +0 -1
- package/dist/commands/shared/CommandRunner.d.ts.map +0 -1
- package/dist/commands/shared/CommandRunner.js.map +0 -1
- package/dist/commands/shared/__tests__/validation.unit.test.d.ts +0 -7
- package/dist/commands/shared/__tests__/validation.unit.test.d.ts.map +0 -1
- package/dist/commands/shared/__tests__/validation.unit.test.js +0 -141
- package/dist/commands/shared/__tests__/validation.unit.test.js.map +0 -1
- package/dist/commands/shared/commonOptions.d.ts.map +0 -1
- package/dist/commands/shared/commonOptions.js.map +0 -1
- package/dist/commands/shared/daemonErrorHandler.d.ts.map +0 -1
- package/dist/commands/shared/daemonErrorHandler.js.map +0 -1
- package/dist/commands/shared/dataFetcher.d.ts.map +0 -1
- package/dist/commands/shared/dataFetcher.js.map +0 -1
- package/dist/commands/shared/followMode.d.ts.map +0 -1
- package/dist/commands/shared/followMode.js.map +0 -1
- package/dist/commands/shared/landingPage.d.ts.map +0 -1
- package/dist/commands/shared/landingPage.js.map +0 -1
- package/dist/commands/shared/optionTypes.d.ts.map +0 -1
- package/dist/commands/shared/optionTypes.js.map +0 -1
- package/dist/commands/shared/startHelpers.d.ts.map +0 -1
- package/dist/commands/shared/startHelpers.js.map +0 -1
- package/dist/commands/shared/validation.d.ts.map +0 -1
- package/dist/commands/shared/validation.js.map +0 -1
- package/dist/commands/start.d.ts.map +0 -1
- package/dist/commands/start.js.map +0 -1
- package/dist/commands/status.d.ts.map +0 -1
- package/dist/commands/status.js.map +0 -1
- package/dist/commands/stop.d.ts.map +0 -1
- package/dist/commands/stop.js.map +0 -1
- package/dist/commands/tail.d.ts.map +0 -1
- package/dist/commands/tail.js.map +0 -1
- package/dist/commands/types.d.ts.map +0 -1
- package/dist/commands/types.js.map +0 -1
- package/dist/commands.d.ts.map +0 -1
- package/dist/commands.js.map +0 -1
- package/dist/connection/__tests__/cdp.contract.test.d.ts +0 -16
- package/dist/connection/__tests__/cdp.contract.test.d.ts.map +0 -1
- package/dist/connection/__tests__/cdp.contract.test.js +0 -377
- package/dist/connection/__tests__/cdp.contract.test.js.map +0 -1
- package/dist/connection/__tests__/flagsBuilder.unit.test.d.ts +0 -9
- package/dist/connection/__tests__/flagsBuilder.unit.test.d.ts.map +0 -1
- package/dist/connection/__tests__/flagsBuilder.unit.test.js +0 -94
- package/dist/connection/__tests__/flagsBuilder.unit.test.js.map +0 -1
- package/dist/connection/__tests__/handlers.unit.test.d.ts +0 -11
- package/dist/connection/__tests__/handlers.unit.test.d.ts.map +0 -1
- package/dist/connection/__tests__/handlers.unit.test.js +0 -220
- package/dist/connection/__tests__/handlers.unit.test.js.map +0 -1
- package/dist/connection/__tests__/pageReadiness.contract.test.d.ts +0 -14
- package/dist/connection/__tests__/pageReadiness.contract.test.d.ts.map +0 -1
- package/dist/connection/__tests__/pageReadiness.contract.test.js +0 -382
- package/dist/connection/__tests__/pageReadiness.contract.test.js.map +0 -1
- package/dist/connection/__tests__/portReservation.contract.test.d.ts +0 -14
- package/dist/connection/__tests__/portReservation.contract.test.d.ts.map +0 -1
- package/dist/connection/__tests__/portReservation.contract.test.js +0 -250
- package/dist/connection/__tests__/portReservation.contract.test.js.map +0 -1
- package/dist/connection/cdp.d.ts.map +0 -1
- package/dist/connection/cdp.js.map +0 -1
- package/dist/connection/config.d.ts.map +0 -1
- package/dist/connection/config.js.map +0 -1
- package/dist/connection/diagnostics.d.ts.map +0 -1
- package/dist/connection/diagnostics.js.map +0 -1
- package/dist/connection/errors.d.ts.map +0 -1
- package/dist/connection/errors.js.map +0 -1
- package/dist/connection/events.d.ts.map +0 -1
- package/dist/connection/events.js.map +0 -1
- package/dist/connection/handlers.d.ts.map +0 -1
- package/dist/connection/handlers.js.map +0 -1
- package/dist/connection/launcher/binaryResolver.d.ts.map +0 -1
- package/dist/connection/launcher/binaryResolver.js.map +0 -1
- package/dist/connection/launcher/flagsBuilder.d.ts.map +0 -1
- package/dist/connection/launcher/flagsBuilder.js.map +0 -1
- package/dist/connection/launcher/preferencesLoader.d.ts.map +0 -1
- package/dist/connection/launcher/preferencesLoader.js.map +0 -1
- package/dist/connection/launcher.d.ts.map +0 -1
- package/dist/connection/launcher.js.map +0 -1
- package/dist/connection/pageReadiness.d.ts.map +0 -1
- package/dist/connection/pageReadiness.js.map +0 -1
- package/dist/connection/portReservation.d.ts.map +0 -1
- package/dist/connection/portReservation.js.map +0 -1
- package/dist/connection/typed-cdp.d.ts.map +0 -1
- package/dist/connection/typed-cdp.js.map +0 -1
- package/dist/connection/types.d.ts.map +0 -1
- package/dist/connection/types.js.map +0 -1
- package/dist/constants.d.ts.map +0 -1
- package/dist/constants.js.map +0 -1
- package/dist/daemon/__tests__/JsonlParser.unit.test.d.ts +0 -8
- package/dist/daemon/__tests__/JsonlParser.unit.test.d.ts.map +0 -1
- package/dist/daemon/__tests__/JsonlParser.unit.test.js +0 -140
- package/dist/daemon/__tests__/JsonlParser.unit.test.js.map +0 -1
- package/dist/daemon/__tests__/PendingRequestManager.unit.test.d.ts +0 -8
- package/dist/daemon/__tests__/PendingRequestManager.unit.test.d.ts.map +0 -1
- package/dist/daemon/__tests__/PendingRequestManager.unit.test.js +0 -276
- package/dist/daemon/__tests__/PendingRequestManager.unit.test.js.map +0 -1
- package/dist/daemon/__tests__/TelemetryStore.unit.test.d.ts +0 -8
- package/dist/daemon/__tests__/TelemetryStore.unit.test.d.ts.map +0 -1
- package/dist/daemon/__tests__/TelemetryStore.unit.test.js +0 -290
- package/dist/daemon/__tests__/TelemetryStore.unit.test.js.map +0 -1
- package/dist/daemon/__tests__/commandRegistry.contract.test.d.ts +0 -8
- package/dist/daemon/__tests__/commandRegistry.contract.test.d.ts.map +0 -1
- package/dist/daemon/__tests__/commandRegistry.contract.test.js +0 -647
- package/dist/daemon/__tests__/commandRegistry.contract.test.js.map +0 -1
- package/dist/daemon/__tests__/ipcServer.cleanup.unit.test.d.ts +0 -19
- package/dist/daemon/__tests__/ipcServer.cleanup.unit.test.d.ts.map +0 -1
- package/dist/daemon/__tests__/ipcServer.cleanup.unit.test.js +0 -212
- package/dist/daemon/__tests__/ipcServer.cleanup.unit.test.js.map +0 -1
- package/dist/daemon/__tests__/ipcServer.contract.test.d.ts +0 -23
- package/dist/daemon/__tests__/ipcServer.contract.test.d.ts.map +0 -1
- package/dist/daemon/__tests__/ipcServer.contract.test.js +0 -416
- package/dist/daemon/__tests__/ipcServer.contract.test.js.map +0 -1
- package/dist/daemon/__tests__/launcher.unit.test.d.ts +0 -8
- package/dist/daemon/__tests__/launcher.unit.test.d.ts.map +0 -1
- package/dist/daemon/__tests__/launcher.unit.test.js +0 -20
- package/dist/daemon/__tests__/launcher.unit.test.js.map +0 -1
- package/dist/daemon/errors.d.ts.map +0 -1
- package/dist/daemon/errors.js.map +0 -1
- package/dist/daemon/handlers/BaseHandler.d.ts +0 -75
- package/dist/daemon/handlers/BaseHandler.d.ts.map +0 -1
- package/dist/daemon/handlers/BaseHandler.js +0 -103
- package/dist/daemon/handlers/BaseHandler.js.map +0 -1
- package/dist/daemon/handlers/CommandHandlers.d.ts +0 -36
- package/dist/daemon/handlers/CommandHandlers.d.ts.map +0 -1
- package/dist/daemon/handlers/CommandHandlers.js +0 -60
- package/dist/daemon/handlers/CommandHandlers.js.map +0 -1
- package/dist/daemon/handlers/QueryHandlers.d.ts +0 -37
- package/dist/daemon/handlers/QueryHandlers.d.ts.map +0 -1
- package/dist/daemon/handlers/QueryHandlers.js +0 -126
- package/dist/daemon/handlers/QueryHandlers.js.map +0 -1
- package/dist/daemon/handlers/SessionHandlers.d.ts +0 -32
- package/dist/daemon/handlers/SessionHandlers.d.ts.map +0 -1
- package/dist/daemon/handlers/SessionHandlers.js +0 -213
- package/dist/daemon/handlers/SessionHandlers.js.map +0 -1
- package/dist/daemon/handlers/pendingRequests.d.ts +0 -50
- package/dist/daemon/handlers/pendingRequests.d.ts.map +0 -1
- package/dist/daemon/handlers/pendingRequests.js +0 -57
- package/dist/daemon/handlers/pendingRequests.js.map +0 -1
- package/dist/daemon/handlers/requestHandlers.d.ts +0 -55
- package/dist/daemon/handlers/requestHandlers.d.ts.map +0 -1
- package/dist/daemon/handlers/requestHandlers.js +0 -66
- package/dist/daemon/handlers/requestHandlers.js.map +0 -1
- package/dist/daemon/handlers/responseHandler.d.ts +0 -42
- package/dist/daemon/handlers/responseHandler.d.ts.map +0 -1
- package/dist/daemon/handlers/responseHandler.js +0 -217
- package/dist/daemon/handlers/responseHandler.js.map +0 -1
- package/dist/daemon/ipcServer.d.ts.map +0 -1
- package/dist/daemon/ipcServer.js.map +0 -1
- package/dist/daemon/launcher.d.ts.map +0 -1
- package/dist/daemon/launcher.js.map +0 -1
- package/dist/daemon/lifecycle/cdpSetup.d.ts +0 -24
- package/dist/daemon/lifecycle/cdpSetup.d.ts.map +0 -1
- package/dist/daemon/lifecycle/cdpSetup.js +0 -55
- package/dist/daemon/lifecycle/cdpSetup.js.map +0 -1
- package/dist/daemon/lifecycle/chromeConnection.d.ts +0 -17
- package/dist/daemon/lifecycle/chromeConnection.d.ts.map +0 -1
- package/dist/daemon/lifecycle/chromeConnection.js +0 -79
- package/dist/daemon/lifecycle/chromeConnection.js.map +0 -1
- package/dist/daemon/lifecycle/signalHandlers.d.ts +0 -14
- package/dist/daemon/lifecycle/signalHandlers.d.ts.map +0 -1
- package/dist/daemon/lifecycle/signalHandlers.js +0 -48
- package/dist/daemon/lifecycle/signalHandlers.js.map +0 -1
- package/dist/daemon/lifecycle/workerCleanup.d.ts +0 -27
- package/dist/daemon/lifecycle/workerCleanup.d.ts.map +0 -1
- package/dist/daemon/lifecycle/workerCleanup.js +0 -143
- package/dist/daemon/lifecycle/workerCleanup.js.map +0 -1
- package/dist/daemon/lifecycle/workerConfig.d.ts +0 -14
- package/dist/daemon/lifecycle/workerConfig.d.ts.map +0 -1
- package/dist/daemon/lifecycle/workerConfig.js +0 -69
- package/dist/daemon/lifecycle/workerConfig.js.map +0 -1
- package/dist/daemon/lifecycle/workerIpc.d.ts +0 -14
- package/dist/daemon/lifecycle/workerIpc.d.ts.map +0 -1
- package/dist/daemon/lifecycle/workerIpc.js +0 -86
- package/dist/daemon/lifecycle/workerIpc.js.map +0 -1
- package/dist/daemon/patternDefinitions.d.ts.map +0 -1
- package/dist/daemon/patternDefinitions.js.map +0 -1
- package/dist/daemon/patternDetector.d.ts.map +0 -1
- package/dist/daemon/patternDetector.js.map +0 -1
- package/dist/daemon/server/JsonlParser.d.ts +0 -31
- package/dist/daemon/server/JsonlParser.d.ts.map +0 -1
- package/dist/daemon/server/JsonlParser.js +0 -55
- package/dist/daemon/server/JsonlParser.js.map +0 -1
- package/dist/daemon/server/SocketServer.d.ts.map +0 -1
- package/dist/daemon/server/SocketServer.js.map +0 -1
- package/dist/daemon/server/WorkerManager.d.ts +0 -36
- package/dist/daemon/server/WorkerManager.d.ts.map +0 -1
- package/dist/daemon/server/WorkerManager.js +0 -89
- package/dist/daemon/server/WorkerManager.js.map +0 -1
- package/dist/daemon/services/SessionService.d.ts +0 -87
- package/dist/daemon/services/SessionService.d.ts.map +0 -1
- package/dist/daemon/services/SessionService.js +0 -45
- package/dist/daemon/services/SessionService.js.map +0 -1
- package/dist/daemon/startSession.d.ts +0 -55
- package/dist/daemon/startSession.d.ts.map +0 -1
- package/dist/daemon/startSession.js +0 -168
- package/dist/daemon/startSession.js.map +0 -1
- package/dist/daemon/worker/TelemetryStore.d.ts +0 -19
- package/dist/daemon/worker/TelemetryStore.d.ts.map +0 -1
- package/dist/daemon/worker/TelemetryStore.js +0 -53
- package/dist/daemon/worker/TelemetryStore.js.map +0 -1
- package/dist/daemon/worker/__tests__/PatternDetector.unit.test.d.ts +0 -11
- package/dist/daemon/worker/__tests__/PatternDetector.unit.test.d.ts.map +0 -1
- package/dist/daemon/worker/__tests__/PatternDetector.unit.test.js +0 -136
- package/dist/daemon/worker/__tests__/PatternDetector.unit.test.js.map +0 -1
- package/dist/daemon/worker/collectors.d.ts.map +0 -1
- package/dist/daemon/worker/collectors.js.map +0 -1
- package/dist/daemon/worker/commandRegistry.d.ts.map +0 -1
- package/dist/daemon/worker/commandRegistry.js +0 -236
- package/dist/daemon/worker/commandRegistry.js.map +0 -1
- package/dist/daemon/worker/plugins.d.ts.map +0 -1
- package/dist/daemon/worker/plugins.js +0 -75
- package/dist/daemon/worker/plugins.js.map +0 -1
- package/dist/daemon/worker/types.d.ts.map +0 -1
- package/dist/daemon/worker/types.js.map +0 -1
- package/dist/daemon/worker.d.ts +0 -9
- package/dist/daemon/worker.d.ts.map +0 -1
- package/dist/daemon/worker.js +0 -98
- package/dist/daemon/worker.js.map +0 -1
- package/dist/daemon/workerIpc.d.ts +0 -33
- package/dist/daemon/workerIpc.d.ts.map +0 -1
- package/dist/daemon/workerIpc.js +0 -8
- package/dist/daemon/workerIpc.js.map +0 -1
- package/dist/daemon.d.ts.map +0 -1
- package/dist/daemon.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/ipc/__tests__/client.contract.test.d.ts +0 -8
- package/dist/ipc/__tests__/client.contract.test.d.ts.map +0 -1
- package/dist/ipc/__tests__/client.contract.test.js +0 -693
- package/dist/ipc/__tests__/client.contract.test.js.map +0 -1
- package/dist/ipc/__tests__/errors.unit.test.d.ts +0 -7
- package/dist/ipc/__tests__/errors.unit.test.d.ts.map +0 -1
- package/dist/ipc/__tests__/errors.unit.test.js +0 -77
- package/dist/ipc/__tests__/errors.unit.test.js.map +0 -1
- package/dist/ipc/__tests__/guards.unit.test.d.ts +0 -7
- package/dist/ipc/__tests__/guards.unit.test.d.ts.map +0 -1
- package/dist/ipc/__tests__/guards.unit.test.js +0 -73
- package/dist/ipc/__tests__/guards.unit.test.js.map +0 -1
- package/dist/ipc/__tests__/jsonl.unit.test.d.ts +0 -7
- package/dist/ipc/__tests__/jsonl.unit.test.d.ts.map +0 -1
- package/dist/ipc/__tests__/jsonl.unit.test.js +0 -103
- package/dist/ipc/__tests__/jsonl.unit.test.js.map +0 -1
- package/dist/ipc/__tests__/validation.unit.test.d.ts +0 -7
- package/dist/ipc/__tests__/validation.unit.test.d.ts.map +0 -1
- package/dist/ipc/__tests__/validation.unit.test.js +0 -60
- package/dist/ipc/__tests__/validation.unit.test.js.map +0 -1
- package/dist/ipc/client.d.ts.map +0 -1
- package/dist/ipc/client.js.map +0 -1
- package/dist/ipc/index.d.ts.map +0 -1
- package/dist/ipc/index.js.map +0 -1
- package/dist/ipc/protocol/commands.d.ts.map +0 -1
- package/dist/ipc/protocol/commands.js.map +0 -1
- package/dist/ipc/protocol/guards.d.ts.map +0 -1
- package/dist/ipc/protocol/guards.js.map +0 -1
- package/dist/ipc/protocol/index.d.ts.map +0 -1
- package/dist/ipc/protocol/index.js.map +0 -1
- package/dist/ipc/protocol/messages.d.ts.map +0 -1
- package/dist/ipc/protocol/messages.js.map +0 -1
- package/dist/ipc/session/errors.d.ts.map +0 -1
- package/dist/ipc/session/errors.js.map +0 -1
- package/dist/ipc/session/index.d.ts.map +0 -1
- package/dist/ipc/session/index.js.map +0 -1
- package/dist/ipc/session/lifecycle.d.ts.map +0 -1
- package/dist/ipc/session/lifecycle.js.map +0 -1
- package/dist/ipc/session/queries.d.ts.map +0 -1
- package/dist/ipc/session/queries.js.map +0 -1
- package/dist/ipc/session/types.d.ts.map +0 -1
- package/dist/ipc/session/types.js.map +0 -1
- package/dist/ipc/transport/IPCError.d.ts.map +0 -1
- package/dist/ipc/transport/IPCError.js.map +0 -1
- package/dist/ipc/transport/errors.d.ts.map +0 -1
- package/dist/ipc/transport/errors.js.map +0 -1
- package/dist/ipc/transport/index.d.ts.map +0 -1
- package/dist/ipc/transport/index.js.map +0 -1
- package/dist/ipc/transport/jsonl.d.ts.map +0 -1
- package/dist/ipc/transport/jsonl.js.map +0 -1
- package/dist/ipc/transport/socket.d.ts.map +0 -1
- package/dist/ipc/transport/socket.js.map +0 -1
- package/dist/ipc/transport/validation.d.ts.map +0 -1
- package/dist/ipc/transport/validation.js.map +0 -1
- package/dist/ipc/utils/errors.d.ts.map +0 -1
- package/dist/ipc/utils/errors.js.map +0 -1
- package/dist/ipc/utils/index.d.ts.map +0 -1
- package/dist/ipc/utils/index.js.map +0 -1
- package/dist/ipc/utils/requestId.d.ts +0 -23
- package/dist/ipc/utils/requestId.d.ts.map +0 -1
- package/dist/ipc/utils/requestId.js +0 -27
- package/dist/ipc/utils/requestId.js.map +0 -1
- package/dist/ipc/utils/responseValidator.d.ts.map +0 -1
- package/dist/ipc/utils/responseValidator.js.map +0 -1
- package/dist/ipc/utils/session.d.ts.map +0 -1
- package/dist/ipc/utils/session.js.map +0 -1
- package/dist/ipc/utils/types.d.ts.map +0 -1
- package/dist/ipc/utils/types.js.map +0 -1
- package/dist/session/QueryCacheManager.d.ts.map +0 -1
- package/dist/session/QueryCacheManager.js.map +0 -1
- package/dist/session/__tests__/chrome-cache.contract.test.d.ts +0 -7
- package/dist/session/__tests__/chrome-cache.contract.test.d.ts.map +0 -1
- package/dist/session/__tests__/chrome-cache.contract.test.js +0 -77
- package/dist/session/__tests__/chrome-cache.contract.test.js.map +0 -1
- package/dist/session/__tests__/cleanup.contract.test.d.ts +0 -7
- package/dist/session/__tests__/cleanup.contract.test.d.ts.map +0 -1
- package/dist/session/__tests__/cleanup.contract.test.js +0 -84
- package/dist/session/__tests__/cleanup.contract.test.js.map +0 -1
- package/dist/session/__tests__/lock.contract.test.d.ts +0 -7
- package/dist/session/__tests__/lock.contract.test.d.ts.map +0 -1
- package/dist/session/__tests__/lock.contract.test.js +0 -77
- package/dist/session/__tests__/lock.contract.test.js.map +0 -1
- package/dist/session/__tests__/metadata.contract.test.d.ts +0 -7
- package/dist/session/__tests__/metadata.contract.test.d.ts.map +0 -1
- package/dist/session/__tests__/metadata.contract.test.js +0 -87
- package/dist/session/__tests__/metadata.contract.test.js.map +0 -1
- package/dist/session/chrome.d.ts.map +0 -1
- package/dist/session/chrome.js.map +0 -1
- package/dist/session/cleanup.d.ts +0 -141
- package/dist/session/cleanup.d.ts.map +0 -1
- package/dist/session/cleanup.js +0 -514
- package/dist/session/cleanup.js.map +0 -1
- package/dist/session/lock.d.ts +0 -57
- package/dist/session/lock.d.ts.map +0 -1
- package/dist/session/lock.js +0 -165
- package/dist/session/lock.js.map +0 -1
- package/dist/session/metadata.d.ts.map +0 -1
- package/dist/session/metadata.js.map +0 -1
- package/dist/session/output.d.ts +0 -18
- package/dist/session/output.d.ts.map +0 -1
- package/dist/session/output.js +0 -24
- package/dist/session/output.js.map +0 -1
- package/dist/session/paths.d.ts.map +0 -1
- package/dist/session/paths.js.map +0 -1
- package/dist/session/pid.d.ts.map +0 -1
- package/dist/session/pid.js.map +0 -1
- package/dist/session/port.d.ts.map +0 -1
- package/dist/session/port.js.map +0 -1
- package/dist/session/process.d.ts +0 -8
- package/dist/session/process.d.ts.map +0 -1
- package/dist/session/process.js +0 -8
- package/dist/session/process.js.map +0 -1
- package/dist/session/queryCache.d.ts +0 -46
- package/dist/session/queryCache.d.ts.map +0 -1
- package/dist/session/queryCache.js +0 -54
- package/dist/session/queryCache.js.map +0 -1
- package/dist/session/statusData.d.ts.map +0 -1
- package/dist/session/statusData.js.map +0 -1
- package/dist/telemetry/__tests__/a11y.unit.test.d.ts +0 -10
- package/dist/telemetry/__tests__/a11y.unit.test.d.ts.map +0 -1
- package/dist/telemetry/__tests__/a11y.unit.test.js +0 -265
- package/dist/telemetry/__tests__/a11y.unit.test.js.map +0 -1
- package/dist/telemetry/__tests__/filters.unit.test.d.ts +0 -2
- package/dist/telemetry/__tests__/filters.unit.test.d.ts.map +0 -1
- package/dist/telemetry/__tests__/filters.unit.test.js +0 -357
- package/dist/telemetry/__tests__/filters.unit.test.js.map +0 -1
- package/dist/telemetry/__tests__/navigation.contract.test.d.ts +0 -8
- package/dist/telemetry/__tests__/navigation.contract.test.d.ts.map +0 -1
- package/dist/telemetry/__tests__/navigation.contract.test.js +0 -211
- package/dist/telemetry/__tests__/navigation.contract.test.js.map +0 -1
- package/dist/telemetry/__tests__/network.contract.test.d.ts +0 -8
- package/dist/telemetry/__tests__/network.contract.test.d.ts.map +0 -1
- package/dist/telemetry/__tests__/network.contract.test.js +0 -623
- package/dist/telemetry/__tests__/network.contract.test.js.map +0 -1
- package/dist/telemetry/__tests__/remoteObject.unit.test.d.ts +0 -2
- package/dist/telemetry/__tests__/remoteObject.unit.test.d.ts.map +0 -1
- package/dist/telemetry/__tests__/remoteObject.unit.test.js +0 -261
- package/dist/telemetry/__tests__/remoteObject.unit.test.js.map +0 -1
- package/dist/telemetry/__tests__/roleInference.unit.test.d.ts +0 -9
- package/dist/telemetry/__tests__/roleInference.unit.test.d.ts.map +0 -1
- package/dist/telemetry/__tests__/roleInference.unit.test.js +0 -138
- package/dist/telemetry/__tests__/roleInference.unit.test.js.map +0 -1
- package/dist/telemetry/__tests__/utils.unit.test.d.ts +0 -7
- package/dist/telemetry/__tests__/utils.unit.test.d.ts.map +0 -1
- package/dist/telemetry/__tests__/utils.unit.test.js +0 -91
- package/dist/telemetry/__tests__/utils.unit.test.js.map +0 -1
- package/dist/telemetry/a11y.d.ts.map +0 -1
- package/dist/telemetry/a11y.js.map +0 -1
- package/dist/telemetry/console.d.ts.map +0 -1
- package/dist/telemetry/console.js.map +0 -1
- package/dist/telemetry/dialogs.d.ts.map +0 -1
- package/dist/telemetry/dialogs.js.map +0 -1
- package/dist/telemetry/dom.d.ts.map +0 -1
- package/dist/telemetry/dom.js.map +0 -1
- package/dist/telemetry/filterDsl.d.ts.map +0 -1
- package/dist/telemetry/filterDsl.js.map +0 -1
- package/dist/telemetry/filterPresets.d.ts.map +0 -1
- package/dist/telemetry/filterPresets.js.map +0 -1
- package/dist/telemetry/filters.d.ts.map +0 -1
- package/dist/telemetry/filters.js.map +0 -1
- package/dist/telemetry/har/__tests__/builder.unit.test.d.ts +0 -8
- package/dist/telemetry/har/__tests__/builder.unit.test.d.ts.map +0 -1
- package/dist/telemetry/har/__tests__/builder.unit.test.js +0 -694
- package/dist/telemetry/har/__tests__/builder.unit.test.js.map +0 -1
- package/dist/telemetry/har/builder.d.ts.map +0 -1
- package/dist/telemetry/har/builder.js.map +0 -1
- package/dist/telemetry/har/types.d.ts.map +0 -1
- package/dist/telemetry/har/types.js.map +0 -1
- package/dist/telemetry/navigation.d.ts.map +0 -1
- package/dist/telemetry/navigation.js.map +0 -1
- package/dist/telemetry/network.d.ts.map +0 -1
- package/dist/telemetry/network.js.map +0 -1
- package/dist/telemetry/objectExpander.d.ts.map +0 -1
- package/dist/telemetry/objectExpander.js.map +0 -1
- package/dist/telemetry/remoteObject.d.ts.map +0 -1
- package/dist/telemetry/remoteObject.js.map +0 -1
- package/dist/telemetry/remoteObjectUtils.d.ts.map +0 -1
- package/dist/telemetry/remoteObjectUtils.js.map +0 -1
- package/dist/telemetry/roleInference.d.ts.map +0 -1
- package/dist/telemetry/roleInference.js.map +0 -1
- package/dist/telemetry/utils.d.ts.map +0 -1
- package/dist/telemetry/utils.js.map +0 -1
- package/dist/types/dom.d.ts +0 -77
- package/dist/types/dom.d.ts.map +0 -1
- package/dist/types/dom.js +0 -8
- package/dist/types/dom.js.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist/ui/OutputBuilder.d.ts.map +0 -1
- package/dist/ui/OutputBuilder.js.map +0 -1
- package/dist/ui/errors/CommandError.d.ts.map +0 -1
- package/dist/ui/errors/CommandError.js.map +0 -1
- package/dist/ui/errors/index.d.ts.map +0 -1
- package/dist/ui/errors/index.js.map +0 -1
- package/dist/ui/errors/utils.d.ts.map +0 -1
- package/dist/ui/errors/utils.js.map +0 -1
- package/dist/ui/formatters/__tests__/preview.unit.test.d.ts +0 -13
- package/dist/ui/formatters/__tests__/preview.unit.test.d.ts.map +0 -1
- package/dist/ui/formatters/__tests__/preview.unit.test.js +0 -180
- package/dist/ui/formatters/__tests__/preview.unit.test.js.map +0 -1
- package/dist/ui/formatters/__tests__/semantic.unit.test.d.ts +0 -2
- package/dist/ui/formatters/__tests__/semantic.unit.test.d.ts.map +0 -1
- package/dist/ui/formatters/__tests__/semantic.unit.test.js +0 -111
- package/dist/ui/formatters/__tests__/semantic.unit.test.js.map +0 -1
- package/dist/ui/formatters/a11y.d.ts.map +0 -1
- package/dist/ui/formatters/a11y.js.map +0 -1
- package/dist/ui/formatters/console.d.ts.map +0 -1
- package/dist/ui/formatters/console.js.map +0 -1
- package/dist/ui/formatters/cookies.d.ts.map +0 -1
- package/dist/ui/formatters/cookies.js.map +0 -1
- package/dist/ui/formatters/details.d.ts.map +0 -1
- package/dist/ui/formatters/details.js.map +0 -1
- package/dist/ui/formatters/dom.d.ts.map +0 -1
- package/dist/ui/formatters/dom.js.map +0 -1
- package/dist/ui/formatters/form.d.ts.map +0 -1
- package/dist/ui/formatters/form.js.map +0 -1
- package/dist/ui/formatters/helpFormatters.d.ts.map +0 -1
- package/dist/ui/formatters/helpFormatters.js.map +0 -1
- package/dist/ui/formatters/index.d.ts.map +0 -1
- package/dist/ui/formatters/index.js.map +0 -1
- package/dist/ui/formatters/networkHeaders.d.ts.map +0 -1
- package/dist/ui/formatters/networkHeaders.js.map +0 -1
- package/dist/ui/formatters/networkList.d.ts.map +0 -1
- package/dist/ui/formatters/networkList.js.map +0 -1
- package/dist/ui/formatters/preview.d.ts.map +0 -1
- package/dist/ui/formatters/preview.js.map +0 -1
- package/dist/ui/formatters/semantic.d.ts.map +0 -1
- package/dist/ui/formatters/semantic.js.map +0 -1
- package/dist/ui/formatters/sessionFormatters.d.ts.map +0 -1
- package/dist/ui/formatters/sessionFormatters.js.map +0 -1
- package/dist/ui/formatters/status.d.ts.map +0 -1
- package/dist/ui/formatters/status.js.map +0 -1
- package/dist/ui/formatting.d.ts.map +0 -1
- package/dist/ui/formatting.js.map +0 -1
- package/dist/ui/logging/index.d.ts.map +0 -1
- package/dist/ui/logging/index.js.map +0 -1
- package/dist/ui/logging/logger.d.ts.map +0 -1
- package/dist/ui/logging/logger.js.map +0 -1
- package/dist/ui/messages/chrome.d.ts.map +0 -1
- package/dist/ui/messages/chrome.js.map +0 -1
- package/dist/ui/messages/commands.d.ts.map +0 -1
- package/dist/ui/messages/commands.js.map +0 -1
- package/dist/ui/messages/consoleMessages.d.ts.map +0 -1
- package/dist/ui/messages/consoleMessages.js.map +0 -1
- package/dist/ui/messages/debug.d.ts +0 -168
- package/dist/ui/messages/debug.d.ts.map +0 -1
- package/dist/ui/messages/debug.js +0 -219
- package/dist/ui/messages/debug.js.map +0 -1
- package/dist/ui/messages/dom.d.ts +0 -14
- package/dist/ui/messages/dom.d.ts.map +0 -1
- package/dist/ui/messages/dom.js +0 -28
- package/dist/ui/messages/dom.js.map +0 -1
- package/dist/ui/messages/errors.d.ts +0 -233
- package/dist/ui/messages/errors.d.ts.map +0 -1
- package/dist/ui/messages/errors.js +0 -395
- package/dist/ui/messages/errors.js.map +0 -1
- package/dist/ui/messages/hints.d.ts.map +0 -1
- package/dist/ui/messages/hints.js.map +0 -1
- package/dist/ui/messages/internal.d.ts +0 -23
- package/dist/ui/messages/internal.d.ts.map +0 -1
- package/dist/ui/messages/internal.js +0 -27
- package/dist/ui/messages/internal.js.map +0 -1
- package/dist/ui/messages/networkMessages.d.ts.map +0 -1
- package/dist/ui/messages/networkMessages.js.map +0 -1
- package/dist/ui/messages/preview.d.ts.map +0 -1
- package/dist/ui/messages/preview.js.map +0 -1
- package/dist/ui/messages/session.d.ts.map +0 -1
- package/dist/ui/messages/session.js.map +0 -1
- package/dist/ui/messages/validation.d.ts.map +0 -1
- package/dist/ui/messages/validation.js.map +0 -1
- package/dist/utils/__tests__/atomicFile.test.d.ts +0 -2
- package/dist/utils/__tests__/atomicFile.test.d.ts.map +0 -1
- package/dist/utils/__tests__/atomicFile.test.js +0 -43
- package/dist/utils/__tests__/atomicFile.test.js.map +0 -1
- package/dist/utils/__tests__/errors.unit.test.d.ts +0 -12
- package/dist/utils/__tests__/errors.unit.test.d.ts.map +0 -1
- package/dist/utils/__tests__/errors.unit.test.js +0 -255
- package/dist/utils/__tests__/errors.unit.test.js.map +0 -1
- package/dist/utils/__tests__/http.unit.test.d.ts +0 -12
- package/dist/utils/__tests__/http.unit.test.d.ts.map +0 -1
- package/dist/utils/__tests__/http.unit.test.js +0 -218
- package/dist/utils/__tests__/http.unit.test.js.map +0 -1
- package/dist/utils/__tests__/objects.test.d.ts +0 -2
- package/dist/utils/__tests__/objects.test.d.ts.map +0 -1
- package/dist/utils/__tests__/objects.test.js +0 -50
- package/dist/utils/__tests__/objects.test.js.map +0 -1
- package/dist/utils/__tests__/process.unit.test.d.ts +0 -14
- package/dist/utils/__tests__/process.unit.test.d.ts.map +0 -1
- package/dist/utils/__tests__/process.unit.test.js +0 -124
- package/dist/utils/__tests__/process.unit.test.js.map +0 -1
- package/dist/utils/__tests__/session.contract.test.d.ts +0 -2
- package/dist/utils/__tests__/session.contract.test.d.ts.map +0 -1
- package/dist/utils/__tests__/session.contract.test.js +0 -258
- package/dist/utils/__tests__/session.contract.test.js.map +0 -1
- package/dist/utils/__tests__/shellDetection.unit.test.d.ts +0 -12
- package/dist/utils/__tests__/shellDetection.unit.test.d.ts.map +0 -1
- package/dist/utils/__tests__/shellDetection.unit.test.js +0 -220
- package/dist/utils/__tests__/shellDetection.unit.test.js.map +0 -1
- package/dist/utils/__tests__/url.test.d.ts +0 -2
- package/dist/utils/__tests__/url.test.d.ts.map +0 -1
- package/dist/utils/__tests__/url.test.js +0 -42
- package/dist/utils/__tests__/url.test.js.map +0 -1
- package/dist/utils/async.d.ts.map +0 -1
- package/dist/utils/async.js.map +0 -1
- package/dist/utils/atomicFile.d.ts.map +0 -1
- package/dist/utils/atomicFile.js.map +0 -1
- package/dist/utils/concurrency.d.ts.map +0 -1
- package/dist/utils/concurrency.js.map +0 -1
- package/dist/utils/daemonErrors.d.ts +0 -60
- package/dist/utils/daemonErrors.d.ts.map +0 -1
- package/dist/utils/daemonErrors.js +0 -58
- package/dist/utils/daemonErrors.js.map +0 -1
- package/dist/utils/decisionTrees.d.ts.map +0 -1
- package/dist/utils/decisionTrees.js.map +0 -1
- package/dist/utils/errorMapping.d.ts.map +0 -1
- package/dist/utils/errorMapping.js.map +0 -1
- package/dist/utils/errors.d.ts.map +0 -1
- package/dist/utils/errors.js.map +0 -1
- package/dist/utils/exitCodes.d.ts.map +0 -1
- package/dist/utils/exitCodes.js.map +0 -1
- package/dist/utils/file.d.ts.map +0 -1
- package/dist/utils/file.js.map +0 -1
- package/dist/utils/http.d.ts.map +0 -1
- package/dist/utils/http.js.map +0 -1
- package/dist/utils/levenshtein.d.ts.map +0 -1
- package/dist/utils/levenshtein.js.map +0 -1
- package/dist/utils/objects.d.ts.map +0 -1
- package/dist/utils/objects.js.map +0 -1
- package/dist/utils/process.d.ts.map +0 -1
- package/dist/utils/process.js.map +0 -1
- package/dist/utils/shellDetection.d.ts.map +0 -1
- package/dist/utils/shellDetection.js.map +0 -1
- package/dist/utils/strings.d.ts.map +0 -1
- package/dist/utils/strings.js.map +0 -1
- package/dist/utils/suggestions.d.ts.map +0 -1
- package/dist/utils/suggestions.js.map +0 -1
- package/dist/utils/taskMappings.d.ts.map +0 -1
- package/dist/utils/taskMappings.js.map +0 -1
- package/dist/utils/typeGuards.d.ts.map +0 -1
- package/dist/utils/typeGuards.js.map +0 -1
- package/dist/utils/url.d.ts.map +0 -1
- package/dist/utils/url.js.map +0 -1
- package/dist/utils/validation.d.ts.map +0 -1
- package/dist/utils/validation.js.map +0 -1
- package/dist/utils/version.d.ts.map +0 -1
- package/dist/utils/version.js.map +0 -1
- /package/dist/daemon/{worker → session}/commandRegistry.d.ts +0 -0
- /package/dist/daemon/{worker → session}/types.js +0 -0
- /package/dist/{ui/errors → errors}/CommandError.d.ts +0 -0
- /package/dist/{ui/errors → errors}/index.js +0 -0
- /package/dist/{ui/errors → errors}/utils.d.ts +0 -0
- /package/dist/{commands → runtime}/dom/formTypes.js +0 -0
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fill and click operations — inject React-compatible page-context scripts
|
|
3
|
+
* and unpack structured results.
|
|
4
|
+
*/
|
|
5
|
+
import * as fs from 'node:fs';
|
|
6
|
+
import * as path from 'node:path';
|
|
7
|
+
import { CommandError } from '../../../errors/index.js';
|
|
8
|
+
import { fileNotFoundError, uploadDirectoryError, singleFileInputError, fillableElementNotFoundError, clickableElementNotFoundError, clickTargetDetachedError, unexpectedResponseFormatError, operationFailedError, } from '../../../errors/messages.js';
|
|
9
|
+
import { escapeValueForJS, formatScriptExecutionError, throwIfInvalidSelector, withMultipleMatchesWarning, } from './shared.js';
|
|
10
|
+
import { REACT_FILL_SCRIPT, CLICK_ELEMENT_SCRIPT, isFillResult, isClickResult, } from '../reactEventHelpers.js';
|
|
11
|
+
import { FIND_ELEMENTS_JS, selectorArgsJS } from '../targetNode.js';
|
|
12
|
+
import { createLogger } from '../../../ui/logging/index.js';
|
|
13
|
+
import { POINTER_ACTION_DONE, domClickFallbackWarning } from '../../../ui/messages/commands.js';
|
|
14
|
+
import { getErrorMessage } from '../../../utils/errors.js';
|
|
15
|
+
import { EXIT_CODES } from '../../../utils/exitCodes.js';
|
|
16
|
+
const log = createLogger('dom');
|
|
17
|
+
/**
|
|
18
|
+
* Fill a form element with a value in a React-compatible way.
|
|
19
|
+
*/
|
|
20
|
+
export async function fillElement(cdp, selector, value, options = {}) {
|
|
21
|
+
const scriptOptions = {
|
|
22
|
+
blur: options.blur ?? true,
|
|
23
|
+
index: options.index,
|
|
24
|
+
};
|
|
25
|
+
const expression = `(${REACT_FILL_SCRIPT})(${selectorArgsJS(selector)}, '${escapeValueForJS(value)}', ${JSON.stringify(scriptOptions)})`;
|
|
26
|
+
try {
|
|
27
|
+
const response = await cdp.send('Runtime.evaluate', {
|
|
28
|
+
expression,
|
|
29
|
+
returnByValue: true,
|
|
30
|
+
userGesture: true,
|
|
31
|
+
});
|
|
32
|
+
const cdpResponse = response;
|
|
33
|
+
if (cdpResponse.exceptionDetails) {
|
|
34
|
+
throwIfInvalidSelector(cdpResponse.exceptionDetails, selector);
|
|
35
|
+
const errorMessage = formatScriptExecutionError(cdpResponse.exceptionDetails, selector, 'fill', expression);
|
|
36
|
+
const err = fillableElementNotFoundError(selector);
|
|
37
|
+
throw new CommandError(errorMessage, { suggestion: err.suggestion }, EXIT_CODES.SOFTWARE_ERROR);
|
|
38
|
+
}
|
|
39
|
+
if (cdpResponse.result?.value && isFillResult(cdpResponse.result.value)) {
|
|
40
|
+
const result = cdpResponse.result.value;
|
|
41
|
+
return result.fileInput ? await setFileInput(cdp, selector, value, options) : result;
|
|
42
|
+
}
|
|
43
|
+
const err = unexpectedResponseFormatError('FillResult');
|
|
44
|
+
throw new CommandError(err.message, { suggestion: err.suggestion }, EXIT_CODES.SOFTWARE_ERROR);
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
if (error instanceof CommandError) {
|
|
48
|
+
throw error;
|
|
49
|
+
}
|
|
50
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
51
|
+
const err = operationFailedError('fill element', errorMessage);
|
|
52
|
+
throw new CommandError(err.message, { suggestion: err.suggestion }, EXIT_CODES.SOFTWARE_ERROR);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
/** Empties a file input as a user removing the selection would (with events). */
|
|
56
|
+
const CLEAR_FILE_INPUT_FUNCTION = `function () {
|
|
57
|
+
this.value = '';
|
|
58
|
+
this.dispatchEvent(new Event('input', { bubbles: true }));
|
|
59
|
+
this.dispatchEvent(new Event('change', { bubbles: true }));
|
|
60
|
+
}`;
|
|
61
|
+
/** Object group for remote objects created while selecting files. */
|
|
62
|
+
const UPLOAD_OBJECT_GROUP = 'bdg-upload';
|
|
63
|
+
/**
|
|
64
|
+
* Resolve the files of a file-input value: one path (even with commas in its
|
|
65
|
+
* name, when that file exists), several separated by commas, or none for "".
|
|
66
|
+
*
|
|
67
|
+
* @param value - Value given to `dom fill`
|
|
68
|
+
* @param cwd - Directory relative paths are resolved against
|
|
69
|
+
* @returns Absolute paths (empty clears the input)
|
|
70
|
+
*/
|
|
71
|
+
function uploadPaths(value, cwd) {
|
|
72
|
+
if (!value.trim())
|
|
73
|
+
return [];
|
|
74
|
+
const whole = path.resolve(cwd, value.trim());
|
|
75
|
+
if (fs.existsSync(whole))
|
|
76
|
+
return [whole];
|
|
77
|
+
return value
|
|
78
|
+
.split(',')
|
|
79
|
+
.map((file) => file.trim())
|
|
80
|
+
.filter(Boolean)
|
|
81
|
+
.map((file) => path.resolve(cwd, file));
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* The first file that cannot be uploaded, as a failed fill result.
|
|
85
|
+
*
|
|
86
|
+
* @param files - Absolute paths
|
|
87
|
+
* @returns Failure, or null when all are readable files
|
|
88
|
+
*/
|
|
89
|
+
function uploadProblem(files) {
|
|
90
|
+
for (const file of files) {
|
|
91
|
+
if (!fs.existsSync(file)) {
|
|
92
|
+
const err = fileNotFoundError(file);
|
|
93
|
+
return {
|
|
94
|
+
success: false,
|
|
95
|
+
error: err.message,
|
|
96
|
+
suggestion: err.suggestion,
|
|
97
|
+
exitCode: EXIT_CODES.RESOURCE_NOT_FOUND,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
if (fs.statSync(file).isDirectory()) {
|
|
101
|
+
const err = uploadDirectoryError(file);
|
|
102
|
+
return {
|
|
103
|
+
success: false,
|
|
104
|
+
error: err.message,
|
|
105
|
+
suggestion: err.suggestion,
|
|
106
|
+
exitCode: EXIT_CODES.INVALID_ARGUMENTS,
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Select files in a file input, as a user picking them in the file dialog.
|
|
114
|
+
*
|
|
115
|
+
* @param cdp - CDP connection
|
|
116
|
+
* @param selector - Selector (or bound-node placeholder) of the file input
|
|
117
|
+
* @param value - File path, several separated by commas, or "" to clear the input
|
|
118
|
+
* @param options - Fill options (index, cwd for relative paths)
|
|
119
|
+
* @returns Fill result
|
|
120
|
+
*/
|
|
121
|
+
async function setFileInput(cdp, selector, value, options) {
|
|
122
|
+
const files = uploadPaths(value, options.cwd ?? process.cwd());
|
|
123
|
+
const problem = uploadProblem(files);
|
|
124
|
+
if (problem)
|
|
125
|
+
return problem;
|
|
126
|
+
try {
|
|
127
|
+
const located = (await cdp.send('Runtime.evaluate', {
|
|
128
|
+
expression: `(${FIND_ELEMENTS_JS})(${selectorArgsJS(selector)})[${options.index ?? 0}]`,
|
|
129
|
+
objectGroup: UPLOAD_OBJECT_GROUP,
|
|
130
|
+
}));
|
|
131
|
+
if (located.exceptionDetails)
|
|
132
|
+
throwIfInvalidSelector(located.exceptionDetails, selector);
|
|
133
|
+
const objectId = located.result?.objectId;
|
|
134
|
+
if (!objectId) {
|
|
135
|
+
const err = fillableElementNotFoundError(selector);
|
|
136
|
+
return { success: false, error: err.message, suggestion: err.suggestion };
|
|
137
|
+
}
|
|
138
|
+
const multiple = (await cdp.send('Runtime.callFunctionOn', {
|
|
139
|
+
objectId,
|
|
140
|
+
functionDeclaration: 'function () { return this.multiple; }',
|
|
141
|
+
returnByValue: true,
|
|
142
|
+
}));
|
|
143
|
+
if (files.length > 1 && multiple.result?.value !== true) {
|
|
144
|
+
const err = singleFileInputError(files.length);
|
|
145
|
+
return {
|
|
146
|
+
success: false,
|
|
147
|
+
error: err.message,
|
|
148
|
+
suggestion: err.suggestion,
|
|
149
|
+
exitCode: EXIT_CODES.INVALID_ARGUMENTS,
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
if (files.length > 0)
|
|
153
|
+
await cdp.send('DOM.setFileInputFiles', { files, objectId });
|
|
154
|
+
else {
|
|
155
|
+
await cdp.send('Runtime.callFunctionOn', {
|
|
156
|
+
objectId,
|
|
157
|
+
functionDeclaration: CLEAR_FILE_INPUT_FUNCTION,
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
finally {
|
|
162
|
+
await cdp
|
|
163
|
+
.send('Runtime.releaseObjectGroup', { objectGroup: UPLOAD_OBJECT_GROUP })
|
|
164
|
+
.catch((error) => log.debug(`Could not release upload objects: ${getErrorMessage(error)}`));
|
|
165
|
+
}
|
|
166
|
+
return {
|
|
167
|
+
success: true,
|
|
168
|
+
selector,
|
|
169
|
+
value: files.length > 0 ? files.map((file) => path.basename(file)).join(', ') : '(cleared)',
|
|
170
|
+
elementType: 'input',
|
|
171
|
+
inputType: 'file',
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Page script doing an action on the located target with DOM events (when
|
|
176
|
+
* the mouse cannot reach it); evaluates to false if the target is gone.
|
|
177
|
+
*
|
|
178
|
+
* @param action - What to do
|
|
179
|
+
* @returns Script
|
|
180
|
+
*/
|
|
181
|
+
function domFallbackScript(action) {
|
|
182
|
+
const events = {
|
|
183
|
+
click: 'el.click();',
|
|
184
|
+
double: "el.click(); el.click(); el.dispatchEvent(new MouseEvent('dblclick', init));",
|
|
185
|
+
right: "el.dispatchEvent(new MouseEvent('contextmenu', { ...init, button: 2 }));",
|
|
186
|
+
hover: "['pointerover', 'pointerenter', 'mouseover', 'mouseenter', 'mousemove'].forEach((type) => el.dispatchEvent(new MouseEvent(type, init)));",
|
|
187
|
+
};
|
|
188
|
+
return `(() => {
|
|
189
|
+
const el = window.__bdgClickTarget;
|
|
190
|
+
delete window.__bdgClickTarget;
|
|
191
|
+
if (!el || !el.isConnected) return false;
|
|
192
|
+
const init = { bubbles: true, cancelable: true, composed: true, view: el.ownerDocument.defaultView };
|
|
193
|
+
${events[action]}
|
|
194
|
+
return true;
|
|
195
|
+
})()`;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Real mouse events for an action at a point.
|
|
199
|
+
*
|
|
200
|
+
* @param action - What to do
|
|
201
|
+
* @param x - Page x
|
|
202
|
+
* @param y - Page y
|
|
203
|
+
* @returns `Input.dispatchMouseEvent` parameters, in order
|
|
204
|
+
*/
|
|
205
|
+
export function mouseEvents(action, x, y) {
|
|
206
|
+
const moved = { type: 'mouseMoved', x, y };
|
|
207
|
+
if (action === 'hover')
|
|
208
|
+
return [moved];
|
|
209
|
+
const button = action === 'right' ? 'right' : 'left';
|
|
210
|
+
const press = (clickCount) => [
|
|
211
|
+
{ type: 'mousePressed', x, y, button, clickCount },
|
|
212
|
+
{ type: 'mouseReleased', x, y, button, clickCount },
|
|
213
|
+
];
|
|
214
|
+
return action === 'double' ? [moved, ...press(1), ...press(2)] : [moved, ...press(1)];
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Drop the located element from the page without waiting: right after a
|
|
218
|
+
* click on a link, evaluation waits until the new page commits (seconds for a
|
|
219
|
+
* slow server), which `--no-wait` must not.
|
|
220
|
+
*
|
|
221
|
+
* @param cdp - CDP connection
|
|
222
|
+
*/
|
|
223
|
+
function releaseClickTarget(cdp) {
|
|
224
|
+
void cdp
|
|
225
|
+
.send('Runtime.evaluate', { expression: 'delete window.__bdgClickTarget' })
|
|
226
|
+
.catch((error) => log.debug(`Click target not released: ${getErrorMessage(error)}`));
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Click a located element.
|
|
230
|
+
*
|
|
231
|
+
* Uses real mouse events (pointerdown/mousedown/pointerup/mouseup/click, all
|
|
232
|
+
* trusted) at the element's center when it is the topmost element there, so
|
|
233
|
+
* components that react to pointer or mouse events (menus, selects) respond.
|
|
234
|
+
* Otherwise (covered or zero-size) falls back to `el.click()` and says so.
|
|
235
|
+
* Double and right clicks, and hovering, work the same way.
|
|
236
|
+
*
|
|
237
|
+
* @param cdp - CDP connection
|
|
238
|
+
* @param located - Locate result with center point
|
|
239
|
+
* @param action - Click, double click, right click or hover
|
|
240
|
+
* @returns Click result
|
|
241
|
+
*/
|
|
242
|
+
async function performClick(cdp, located, action) {
|
|
243
|
+
const { x, y, hittable, obstruction, ...result } = located;
|
|
244
|
+
if (!result.success)
|
|
245
|
+
return result;
|
|
246
|
+
if (hittable && x !== undefined && y !== undefined) {
|
|
247
|
+
for (const event of mouseEvents(action, x, y)) {
|
|
248
|
+
await cdp.send('Input.dispatchMouseEvent', event);
|
|
249
|
+
}
|
|
250
|
+
releaseClickTarget(cdp);
|
|
251
|
+
return withMultipleMatchesWarning({ ...result, action, method: 'mouse' }, result.selectedIndex, `${POINTER_ACTION_DONE[action].toLowerCase()} the first visible one`);
|
|
252
|
+
}
|
|
253
|
+
const response = (await cdp.send('Runtime.evaluate', {
|
|
254
|
+
expression: domFallbackScript(action),
|
|
255
|
+
returnByValue: true,
|
|
256
|
+
userGesture: true,
|
|
257
|
+
}));
|
|
258
|
+
if (response.result?.value !== true) {
|
|
259
|
+
const err = clickTargetDetachedError(result.selector ?? '');
|
|
260
|
+
throw new CommandError(err.message, { suggestion: err.suggestion }, EXIT_CODES.RESOURCE_NOT_FOUND);
|
|
261
|
+
}
|
|
262
|
+
return withMultipleMatchesWarning({ ...result, action, method: 'dom', warning: domClickFallbackWarning(obstruction) }, result.selectedIndex, `${POINTER_ACTION_DONE[action].toLowerCase()} the first visible one`);
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Click an element.
|
|
266
|
+
*/
|
|
267
|
+
export async function clickElement(cdp, selector, options = {}) {
|
|
268
|
+
const indexArg = options.index ?? 'null';
|
|
269
|
+
const action = options.action ?? 'click';
|
|
270
|
+
const expression = `(${CLICK_ELEMENT_SCRIPT})(${selectorArgsJS(selector)}, ${indexArg}, '${action}')`;
|
|
271
|
+
try {
|
|
272
|
+
const response = await cdp.send('Runtime.evaluate', {
|
|
273
|
+
expression,
|
|
274
|
+
returnByValue: true,
|
|
275
|
+
userGesture: true,
|
|
276
|
+
});
|
|
277
|
+
const cdpResponse = response;
|
|
278
|
+
if (cdpResponse.exceptionDetails) {
|
|
279
|
+
throwIfInvalidSelector(cdpResponse.exceptionDetails, selector);
|
|
280
|
+
const errorMessage = formatScriptExecutionError(cdpResponse.exceptionDetails, selector, 'click', expression);
|
|
281
|
+
const err = clickableElementNotFoundError(selector);
|
|
282
|
+
throw new CommandError(errorMessage, { suggestion: err.suggestion }, EXIT_CODES.SOFTWARE_ERROR);
|
|
283
|
+
}
|
|
284
|
+
if (cdpResponse.result?.value && isClickResult(cdpResponse.result.value)) {
|
|
285
|
+
return await performClick(cdp, cdpResponse.result.value, action);
|
|
286
|
+
}
|
|
287
|
+
const err = unexpectedResponseFormatError('ClickResult');
|
|
288
|
+
throw new CommandError(err.message, { suggestion: err.suggestion }, EXIT_CODES.SOFTWARE_ERROR);
|
|
289
|
+
}
|
|
290
|
+
catch (error) {
|
|
291
|
+
if (error instanceof CommandError) {
|
|
292
|
+
throw error;
|
|
293
|
+
}
|
|
294
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
295
|
+
const err = operationFailedError('click element', errorMessage);
|
|
296
|
+
throw new CommandError(err.message, { suggestion: err.suggestion }, EXIT_CODES.SOFTWARE_ERROR);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
//# sourceMappingURL=fill.js.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Form-fill helper barrel. Splits the former formFillHelpers.ts into:
|
|
3
|
+
*
|
|
4
|
+
* - `fill.ts` — fillElement, clickElement
|
|
5
|
+
* - `pressKey.ts` — pressKeyElement + types
|
|
6
|
+
* - `scroll.ts` — scrollPage + types
|
|
7
|
+
* - `stability.ts` — waitForActionStability
|
|
8
|
+
* - `shared.ts` — internal script/error helpers
|
|
9
|
+
*
|
|
10
|
+
* Callers keep importing from `@/commands/dom/formFillHelpers.js` which
|
|
11
|
+
* resolves to this barrel.
|
|
12
|
+
*/
|
|
13
|
+
export { fillElement, clickElement } from './fill.js';
|
|
14
|
+
export { pressKeyElement, type PressKeyOptions, type PressKeyResult, } from './pressKey.js';
|
|
15
|
+
export { scrollPage, type ScrollOptions, type ScrollResult, } from './scroll.js';
|
|
16
|
+
export { waitForActionStability } from './stability.js';
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Form-fill helper barrel. Splits the former formFillHelpers.ts into:
|
|
3
|
+
*
|
|
4
|
+
* - `fill.ts` — fillElement, clickElement
|
|
5
|
+
* - `pressKey.ts` — pressKeyElement + types
|
|
6
|
+
* - `scroll.ts` — scrollPage + types
|
|
7
|
+
* - `stability.ts` — waitForActionStability
|
|
8
|
+
* - `shared.ts` — internal script/error helpers
|
|
9
|
+
*
|
|
10
|
+
* Callers keep importing from `@/commands/dom/formFillHelpers.js` which
|
|
11
|
+
* resolves to this barrel.
|
|
12
|
+
*/
|
|
13
|
+
export { fillElement, clickElement } from './fill.js';
|
|
14
|
+
export { pressKeyElement, } from './pressKey.js';
|
|
15
|
+
export { scrollPage, } from './scroll.js';
|
|
16
|
+
export { waitForActionStability } from './stability.js';
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Key press on a focused element — focuses the element, then dispatches
|
|
3
|
+
* CDP Input.dispatchKeyEvent pairs plus synthetic browser-level events
|
|
4
|
+
* that CDP skips (keypress / input / change / submit).
|
|
5
|
+
*/
|
|
6
|
+
import type { CDPConnection } from '../../../connection/cdp.js';
|
|
7
|
+
import type { PressKeyResult } from '../../../ipc/protocol/domTypes.js';
|
|
8
|
+
/**
|
|
9
|
+
* Options for pressing a key on an element.
|
|
10
|
+
*/
|
|
11
|
+
export interface PressKeyOptions {
|
|
12
|
+
index?: number;
|
|
13
|
+
times?: number;
|
|
14
|
+
modifiers?: string;
|
|
15
|
+
}
|
|
16
|
+
export type { PressKeyResult } from '../../../ipc/protocol/domTypes.js';
|
|
17
|
+
/**
|
|
18
|
+
* Press a key on an element: focus it, then dispatch a real keyDown/keyUp
|
|
19
|
+
* pair through CDP. Repeats `times` times with the given modifiers.
|
|
20
|
+
*
|
|
21
|
+
* Keys that type text (letters, digits, Space, Enter) carry `text`, so the
|
|
22
|
+
* browser performs the key's default action exactly like a physical key:
|
|
23
|
+
* the character is inserted (with trusted keypress/input events), Enter adds
|
|
24
|
+
* a newline in a textarea or submits the form once from an input, and Tab
|
|
25
|
+
* moves focus. No synthetic events are fired.
|
|
26
|
+
*/
|
|
27
|
+
export declare function pressKeyElement(cdp: CDPConnection, selector: string, keyName: string, options?: PressKeyOptions): Promise<PressKeyResult>;
|
|
28
|
+
//# sourceMappingURL=pressKey.d.ts.map
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Key press on a focused element — focuses the element, then dispatches
|
|
3
|
+
* CDP Input.dispatchKeyEvent pairs plus synthetic browser-level events
|
|
4
|
+
* that CDP skips (keypress / input / change / submit).
|
|
5
|
+
*/
|
|
6
|
+
import { CommandError } from '../../../errors/index.js';
|
|
7
|
+
import { keyPressFailedError, operationFailedError, unknownKeyError } from '../../../errors/messages.js';
|
|
8
|
+
import { throwIfInvalidSelector, withMultipleMatchesWarning, } from './shared.js';
|
|
9
|
+
import { describeModifiers, getKeyDefinition, impliesShift, MODIFIER_FLAGS, parseModifiers, similarKeyNames, shortcutCommands, } from '../keyMapping.js';
|
|
10
|
+
import { FIND_ELEMENTS_JS, selectorArgsJS } from '../targetNode.js';
|
|
11
|
+
import { EXIT_CODES } from '../../../utils/exitCodes.js';
|
|
12
|
+
const FOCUS_ELEMENT_SCRIPT = `
|
|
13
|
+
(function(selector, parts, index) {
|
|
14
|
+
const allMatches = (${FIND_ELEMENTS_JS})(selector, parts);
|
|
15
|
+
if (allMatches.length === 0) {
|
|
16
|
+
return { success: false, reason: 'not-found', error: 'Element not found: ' + selector };
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
let el;
|
|
20
|
+
if (typeof index === 'number' && index >= 0) {
|
|
21
|
+
if (index >= allMatches.length) {
|
|
22
|
+
return {
|
|
23
|
+
success: false,
|
|
24
|
+
reason: 'range',
|
|
25
|
+
error: 'Index ' + index + ' out of range (found ' + allMatches.length + ' nodes, use 0-' + (allMatches.length - 1) + ')'
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
el = allMatches[index];
|
|
29
|
+
} else {
|
|
30
|
+
el = allMatches[0];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const pageLevel = el === document.body || el === document.documentElement;
|
|
34
|
+
if (!pageLevel) {
|
|
35
|
+
const wasFocused = el.getRootNode().activeElement === el;
|
|
36
|
+
el.focus();
|
|
37
|
+
// A user clicking into a field before typing lands at the end of its text
|
|
38
|
+
if (!wasFocused) {
|
|
39
|
+
try {
|
|
40
|
+
if (typeof el.setSelectionRange === 'function' && typeof el.value === 'string') {
|
|
41
|
+
el.setSelectionRange(el.value.length, el.value.length);
|
|
42
|
+
} else if (el.isContentEditable) {
|
|
43
|
+
const range = el.ownerDocument.createRange();
|
|
44
|
+
range.selectNodeContents(el);
|
|
45
|
+
range.collapse(false);
|
|
46
|
+
const selection = el.ownerDocument.getSelection();
|
|
47
|
+
selection.removeAllRanges();
|
|
48
|
+
selection.addRange(range);
|
|
49
|
+
}
|
|
50
|
+
} catch (e) {
|
|
51
|
+
// Inputs without a caret (number, email, checkbox) keep theirs
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
const focused = el.getRootNode().activeElement;
|
|
55
|
+
if (focused !== el && !el.contains(focused)) {
|
|
56
|
+
return {
|
|
57
|
+
success: false,
|
|
58
|
+
reason: 'not-focusable',
|
|
59
|
+
error: 'Element <' + el.tagName.toLowerCase() + '> cannot receive keyboard focus' + (el.matches(':disabled') ? ' (it is disabled)' : '')
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return { success: true, selector: selector, elementType: el.tagName.toLowerCase(), matchCount: allMatches.length };
|
|
65
|
+
})`;
|
|
66
|
+
/** Exit codes and suggestions for focus failures, by reason. */
|
|
67
|
+
const FOCUS_FAILURES = {
|
|
68
|
+
'not-found': {
|
|
69
|
+
exitCode: EXIT_CODES.RESOURCE_NOT_FOUND,
|
|
70
|
+
suggestion: 'Verify the selector matches a focusable element',
|
|
71
|
+
},
|
|
72
|
+
range: {
|
|
73
|
+
exitCode: EXIT_CODES.INVALID_ARGUMENTS,
|
|
74
|
+
suggestion: 'Use an --index within the matches',
|
|
75
|
+
},
|
|
76
|
+
'not-focusable': {
|
|
77
|
+
exitCode: EXIT_CODES.INVALID_ARGUMENTS,
|
|
78
|
+
suggestion: 'Target an input, textarea, button, link or [tabindex] element; use "body" for page-level keys like Escape',
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* Press a key on an element: focus it, then dispatch a real keyDown/keyUp
|
|
83
|
+
* pair through CDP. Repeats `times` times with the given modifiers.
|
|
84
|
+
*
|
|
85
|
+
* Keys that type text (letters, digits, Space, Enter) carry `text`, so the
|
|
86
|
+
* browser performs the key's default action exactly like a physical key:
|
|
87
|
+
* the character is inserted (with trusted keypress/input events), Enter adds
|
|
88
|
+
* a newline in a textarea or submits the form once from an input, and Tab
|
|
89
|
+
* moves focus. No synthetic events are fired.
|
|
90
|
+
*/
|
|
91
|
+
export async function pressKeyElement(cdp, selector, keyName, options = {}) {
|
|
92
|
+
const keyDef = getKeyDefinition(keyName);
|
|
93
|
+
if (!keyDef) {
|
|
94
|
+
const err = unknownKeyError(keyName, similarKeyNames(keyName));
|
|
95
|
+
return {
|
|
96
|
+
success: false,
|
|
97
|
+
error: err.message,
|
|
98
|
+
suggestion: err.suggestion,
|
|
99
|
+
exitCode: EXIT_CODES.INVALID_ARGUMENTS,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
const times = options.times ?? 1;
|
|
103
|
+
const implicitShift = impliesShift(keyName) ? MODIFIER_FLAGS.shift : 0;
|
|
104
|
+
const modifierFlags = parseModifiers(options.modifiers) | implicitShift;
|
|
105
|
+
const indexArg = options.index ?? 'null';
|
|
106
|
+
const focusExpression = `(${FOCUS_ELEMENT_SCRIPT})(${selectorArgsJS(selector)}, ${indexArg})`;
|
|
107
|
+
try {
|
|
108
|
+
const focusResponse = await cdp.send('Runtime.evaluate', {
|
|
109
|
+
expression: focusExpression,
|
|
110
|
+
returnByValue: true,
|
|
111
|
+
});
|
|
112
|
+
const focusCdpResponse = focusResponse;
|
|
113
|
+
if (focusCdpResponse.exceptionDetails) {
|
|
114
|
+
throwIfInvalidSelector(focusCdpResponse.exceptionDetails, selector);
|
|
115
|
+
const err = keyPressFailedError(`focus: ${focusCdpResponse.exceptionDetails.text}`);
|
|
116
|
+
throw new CommandError(err.message, { suggestion: err.suggestion }, EXIT_CODES.SOFTWARE_ERROR);
|
|
117
|
+
}
|
|
118
|
+
const focusResult = focusCdpResponse.result?.value;
|
|
119
|
+
if (!focusResult?.success) {
|
|
120
|
+
const failure = FOCUS_FAILURES[focusResult?.reason ?? ''];
|
|
121
|
+
return {
|
|
122
|
+
success: false,
|
|
123
|
+
error: focusResult?.error ?? 'Failed to focus element',
|
|
124
|
+
selector,
|
|
125
|
+
...(failure && { exitCode: failure.exitCode, suggestion: failure.suggestion }),
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
for (let i = 0; i < times; i++) {
|
|
129
|
+
await dispatchKeyEvent(cdp, 'keyDown', keyDef, modifierFlags);
|
|
130
|
+
await dispatchKeyEvent(cdp, 'keyUp', keyDef, modifierFlags);
|
|
131
|
+
}
|
|
132
|
+
return withMultipleMatchesWarning({
|
|
133
|
+
success: true,
|
|
134
|
+
selector,
|
|
135
|
+
key: keyName,
|
|
136
|
+
times,
|
|
137
|
+
...(modifierFlags > 0 && { modifiers: describeModifiers(modifierFlags) }),
|
|
138
|
+
elementType: focusResult.elementType,
|
|
139
|
+
...(focusResult.matchCount !== undefined && { matchCount: focusResult.matchCount }),
|
|
140
|
+
}, options.index, 'pressed the key on the first');
|
|
141
|
+
}
|
|
142
|
+
catch (error) {
|
|
143
|
+
if (error instanceof CommandError) {
|
|
144
|
+
throw error;
|
|
145
|
+
}
|
|
146
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
147
|
+
const err = operationFailedError('press key', errorMessage);
|
|
148
|
+
throw new CommandError(err.message, { suggestion: err.suggestion }, EXIT_CODES.SOFTWARE_ERROR);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Text a key types with the given modifiers, or undefined for shortcuts and
|
|
153
|
+
* non-text keys.
|
|
154
|
+
*
|
|
155
|
+
* @param keyDef - Key definition
|
|
156
|
+
* @param modifiers - CDP modifier bit flags
|
|
157
|
+
* @returns Text to insert, if any
|
|
158
|
+
*/
|
|
159
|
+
function keyText(keyDef, modifiers) {
|
|
160
|
+
if (!keyDef.text)
|
|
161
|
+
return undefined;
|
|
162
|
+
const shortcut = MODIFIER_FLAGS.ctrl | MODIFIER_FLAGS.meta | MODIFIER_FLAGS.alt;
|
|
163
|
+
if (modifiers & shortcut)
|
|
164
|
+
return undefined;
|
|
165
|
+
if (!(modifiers & MODIFIER_FLAGS.shift))
|
|
166
|
+
return keyDef.text;
|
|
167
|
+
return keyDef.shiftText ?? keyDef.text.toUpperCase();
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Dispatch one key event through CDP.
|
|
171
|
+
*
|
|
172
|
+
* A keyDown with text is sent as `keyDown` (the browser generates the
|
|
173
|
+
* keypress/input and default action); without text as `rawKeyDown`. Editing
|
|
174
|
+
* shortcuts (Ctrl/Cmd+A, C, X, V, Z) name their editor command.
|
|
175
|
+
*
|
|
176
|
+
* @param cdp - CDP connection
|
|
177
|
+
* @param type - Event phase
|
|
178
|
+
* @param keyDef - Key definition
|
|
179
|
+
* @param modifiers - CDP modifier bit flags
|
|
180
|
+
*/
|
|
181
|
+
async function dispatchKeyEvent(cdp, type, keyDef, modifiers) {
|
|
182
|
+
const text = keyText(keyDef, modifiers);
|
|
183
|
+
const key = text && text !== '\r' ? text : keyDef.key;
|
|
184
|
+
const commands = type === 'keyDown' ? shortcutCommands(keyDef.code, modifiers) : [];
|
|
185
|
+
await cdp.send('Input.dispatchKeyEvent', {
|
|
186
|
+
type: type === 'keyDown' && !text ? 'rawKeyDown' : type,
|
|
187
|
+
code: keyDef.code,
|
|
188
|
+
key,
|
|
189
|
+
windowsVirtualKeyCode: keyDef.keyCode,
|
|
190
|
+
modifiers,
|
|
191
|
+
...(type === 'keyDown' && text && { text, unmodifiedText: keyDef.text }),
|
|
192
|
+
...(commands.length > 0 && { commands }),
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
//# sourceMappingURL=pressKey.js.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Page scroll operations: scroll element into view, by pixel offset, or to
|
|
3
|
+
* page boundaries.
|
|
4
|
+
*/
|
|
5
|
+
import type { CDPConnection } from '../../../connection/cdp.js';
|
|
6
|
+
import type { ScrollResult } from '../../../ipc/protocol/domTypes.js';
|
|
7
|
+
/**
|
|
8
|
+
* Scroll options.
|
|
9
|
+
*/
|
|
10
|
+
export interface ScrollOptions {
|
|
11
|
+
down?: number;
|
|
12
|
+
up?: number;
|
|
13
|
+
left?: number;
|
|
14
|
+
right?: number;
|
|
15
|
+
top?: boolean;
|
|
16
|
+
bottom?: boolean;
|
|
17
|
+
index?: number;
|
|
18
|
+
}
|
|
19
|
+
export type { ScrollResult } from '../../../ipc/protocol/domTypes.js';
|
|
20
|
+
/**
|
|
21
|
+
* Scroll the page to an element, by offset, or to a boundary.
|
|
22
|
+
*/
|
|
23
|
+
export declare function scrollPage(cdp: CDPConnection, selector: string | undefined, options?: ScrollOptions): Promise<ScrollResult>;
|
|
24
|
+
//# sourceMappingURL=scroll.d.ts.map
|