browser-debugger-cli 0.8.0 → 0.10.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 +7 -1
- package/dist/cdp/schema.d.ts +4 -1
- package/dist/cdp/schema.js +48 -7
- package/dist/commands/cdp.js +3 -2
- package/dist/commands/cleanup.d.ts +11 -0
- package/dist/commands/cleanup.js +161 -57
- package/dist/commands/console.d.ts +20 -1
- package/dist/commands/console.js +57 -17
- package/dist/commands/details.js +3 -2
- package/dist/commands/dom/DomElementResolver.d.ts +10 -3
- package/dist/commands/dom/DomElementResolver.js +35 -17
- package/dist/commands/dom/a11y.d.ts +10 -0
- package/dist/commands/dom/a11y.js +29 -6
- package/dist/commands/dom/eval.d.ts +3 -1
- package/dist/commands/dom/eval.js +29 -4
- package/dist/commands/dom/form.js +16 -62
- package/dist/commands/dom/formInteraction.js +189 -119
- package/dist/commands/dom/formSummary.d.ts +49 -0
- package/dist/commands/dom/formSummary.js +180 -0
- package/dist/commands/dom/frames.d.ts +2 -1
- package/dist/commands/dom/frames.js +17 -2
- package/dist/commands/dom/get.d.ts +6 -5
- package/dist/commands/dom/get.js +92 -82
- package/dist/commands/dom/helpers/index.d.ts +1 -1
- package/dist/commands/dom/helpers/index.js +1 -1
- package/dist/commands/dom/helpers/keyAttributes.d.ts +20 -0
- package/dist/commands/dom/helpers/keyAttributes.js +54 -0
- package/dist/commands/dom/helpers/query.d.ts +44 -17
- package/dist/commands/dom/helpers/query.js +300 -106
- package/dist/commands/dom/helpers/runElementCommand.d.ts +10 -2
- package/dist/commands/dom/helpers/runElementCommand.js +98 -30
- package/dist/commands/dom/helpers/screenshot.d.ts +4 -1
- package/dist/commands/dom/helpers/screenshot.js +239 -51
- package/dist/commands/dom/index.d.ts +4 -1
- package/dist/commands/dom/index.js +22 -7
- package/dist/commands/dom/inspect.d.ts +15 -0
- package/dist/commands/dom/inspect.js +82 -0
- package/dist/commands/dom/layout.d.ts +14 -0
- package/dist/commands/dom/layout.js +54 -0
- package/dist/commands/dom/listeners.d.ts +5 -1
- package/dist/commands/dom/listeners.js +15 -5
- package/dist/commands/dom/query.js +2 -3
- package/dist/commands/dom/screenshot.d.ts +12 -2
- package/dist/commands/dom/screenshot.js +27 -3
- package/dist/commands/dom/semanticUtils.d.ts +16 -10
- package/dist/commands/dom/semanticUtils.js +53 -16
- package/dist/commands/dom/wait.d.ts +13 -0
- package/dist/commands/dom/wait.js +83 -0
- package/dist/commands/helpJson.js +2 -2
- package/dist/commands/network/list.js +17 -13
- package/dist/commands/optionBehaviors.js +154 -21
- package/dist/commands/page.d.ts +3 -2
- package/dist/commands/page.js +100 -5
- package/dist/commands/peek.js +4 -11
- package/dist/commands/sessions.d.ts +8 -0
- package/dist/commands/sessions.js +19 -0
- package/dist/commands/shared/CommandRunner.js +4 -4
- package/dist/commands/shared/commonOptions.d.ts +4 -0
- package/dist/commands/shared/commonOptions.js +9 -0
- package/dist/commands/shared/dataFetcher.js +2 -2
- package/dist/commands/shared/followMode.d.ts +21 -1
- package/dist/commands/shared/followMode.js +29 -2
- package/dist/commands/shared/handleValidationError.d.ts +2 -2
- package/dist/commands/shared/handleValidationError.js +12 -3
- package/dist/commands/shared/optionTypes.d.ts +61 -5
- package/dist/commands/shared/startHelpers.d.ts +66 -0
- package/dist/commands/shared/startHelpers.js +103 -13
- package/dist/commands/shared/validation.d.ts +14 -2
- package/dist/commands/shared/validation.js +20 -3
- package/dist/commands/start.d.ts +63 -0
- package/dist/commands/start.js +115 -15
- package/dist/commands/status.js +29 -7
- package/dist/commands/stop.js +7 -6
- package/dist/commands/tail.js +4 -11
- package/dist/commands/types.d.ts +2 -0
- package/dist/commands.js +2 -0
- package/dist/connection/chromeIdentity.d.ts +65 -0
- package/dist/connection/chromeIdentity.js +143 -0
- package/dist/connection/launcher/profilePreferences.d.ts +47 -0
- package/dist/connection/launcher/profilePreferences.js +151 -0
- package/dist/connection/launcher.d.ts +21 -2
- package/dist/connection/launcher.js +42 -16
- package/dist/connection/portReservation.d.ts +14 -4
- package/dist/connection/portReservation.js +21 -6
- package/dist/connection/startupExit.d.ts +8 -0
- package/dist/connection/startupExit.js +15 -6
- package/dist/constants.d.ts +6 -2
- package/dist/constants.js +9 -2
- package/dist/daemon/SessionController.js +23 -7
- package/dist/daemon/errors.d.ts +1 -1
- package/dist/daemon/errors.js +1 -1
- package/dist/daemon/launcher.d.ts +10 -2
- package/dist/daemon/launcher.js +8 -7
- package/dist/daemon/server/SocketServer.js +1 -2
- package/dist/daemon/session/Session.d.ts +20 -0
- package/dist/daemon/session/Session.js +80 -9
- package/dist/daemon/session/chromeConnection.d.ts +9 -0
- package/dist/daemon/session/chromeConnection.js +45 -8
- package/dist/daemon/session/commandRegistry.d.ts +14 -1
- package/dist/daemon/session/commandRegistry.js +113 -67
- package/dist/daemon/session/interactions.d.ts +48 -9
- package/dist/daemon/session/interactions.js +46 -9
- package/dist/daemon/session/triggeredRequests.d.ts +67 -0
- package/dist/daemon/session/triggeredRequests.js +157 -0
- package/dist/daemon/session/types.d.ts +5 -1
- package/dist/daemon.js +10630 -3601
- package/dist/errors/messages.d.ts +456 -24
- package/dist/errors/messages.js +862 -67
- package/dist/index.js +6915 -3401
- package/dist/ipc/client.d.ts +21 -1
- package/dist/ipc/client.js +35 -3
- package/dist/ipc/protocol/commands.d.ts +145 -5
- package/dist/ipc/protocol/commands.js +4 -0
- package/dist/ipc/protocol/domTypes.d.ts +291 -7
- package/dist/ipc/protocol/inspectTypes.d.ts +388 -0
- package/dist/ipc/protocol/inspectTypes.js +10 -0
- package/dist/ipc/session/lifecycle.d.ts +8 -1
- package/dist/ipc/session/queries.d.ts +5 -1
- package/dist/ipc/session/types.d.ts +5 -0
- package/dist/ipc/transport/index.d.ts +2 -1
- package/dist/ipc/transport/index.js +2 -2
- package/dist/runtime/dom/actionEffects.d.ts +185 -0
- package/dist/runtime/dom/actionEffects.js +402 -0
- package/dist/runtime/dom/actionEffectsScripts.d.ts +90 -0
- package/dist/runtime/dom/actionEffectsScripts.js +426 -0
- package/dist/runtime/dom/elementGeometry.d.ts +170 -0
- package/dist/runtime/dom/elementGeometry.js +553 -0
- package/dist/runtime/dom/elementInfo.d.ts +103 -0
- package/dist/runtime/dom/elementInfo.js +256 -0
- package/dist/runtime/dom/evalHelpers.d.ts +51 -6
- package/dist/runtime/dom/evalHelpers.js +136 -26
- package/dist/runtime/dom/eventListeners.d.ts +2 -1
- package/dist/runtime/dom/eventListeners.js +184 -47
- package/dist/runtime/dom/formDiscovery.d.ts +1 -1
- package/dist/runtime/dom/formDiscovery.js +116 -16
- package/dist/runtime/dom/formFillHelpers/fill.d.ts +9 -0
- package/dist/runtime/dom/formFillHelpers/fill.js +178 -14
- package/dist/runtime/dom/formFillHelpers/index.d.ts +2 -2
- package/dist/runtime/dom/formFillHelpers/index.js +2 -2
- package/dist/runtime/dom/formFillHelpers/pressKey.js +14 -3
- package/dist/runtime/dom/formFillHelpers/scroll.d.ts +3 -0
- package/dist/runtime/dom/formFillHelpers/scroll.js +60 -18
- package/dist/runtime/dom/formFillHelpers/shared.d.ts +17 -0
- package/dist/runtime/dom/formFillHelpers/shared.js +25 -1
- package/dist/runtime/dom/formFillHelpers/stability.d.ts +20 -6
- package/dist/runtime/dom/formFillHelpers/stability.js +50 -19
- package/dist/runtime/dom/formSubmitHelpers.d.ts +3 -0
- package/dist/runtime/dom/formSubmitHelpers.js +89 -15
- package/dist/runtime/dom/frameLayout.d.ts +60 -0
- package/dist/runtime/dom/frameLayout.js +140 -0
- package/dist/runtime/dom/frameOrigin.d.ts +50 -0
- package/dist/runtime/dom/frameOrigin.js +62 -0
- package/dist/runtime/dom/frameScopedConnection.d.ts +92 -0
- package/dist/runtime/dom/frameScopedConnection.js +252 -0
- package/dist/runtime/dom/frameSelection.d.ts +12 -1
- package/dist/runtime/dom/frameSelection.js +22 -3
- package/dist/runtime/dom/frames.d.ts +61 -5
- package/dist/runtime/dom/frames.js +329 -75
- package/dist/runtime/dom/inspect.d.ts +28 -0
- package/dist/runtime/dom/inspect.js +557 -0
- package/dist/runtime/dom/inspectAllStyles.d.ts +62 -0
- package/dist/runtime/dom/inspectAllStyles.js +385 -0
- package/dist/runtime/dom/inspectCascade.d.ts +94 -0
- package/dist/runtime/dom/inspectCascade.js +371 -0
- package/dist/runtime/dom/inspectCascadeModel.d.ts +39 -0
- package/dist/runtime/dom/inspectCascadeModel.js +232 -0
- package/dist/runtime/dom/inspectHints.d.ts +62 -0
- package/dist/runtime/dom/inspectHints.js +305 -0
- package/dist/runtime/dom/inspectLayoutModel.d.ts +87 -0
- package/dist/runtime/dom/inspectLayoutModel.js +346 -0
- package/dist/runtime/dom/inspectModel.d.ts +74 -0
- package/dist/runtime/dom/inspectModel.js +184 -0
- package/dist/runtime/dom/inspectPaintModel.d.ts +157 -0
- package/dist/runtime/dom/inspectPaintModel.js +461 -0
- package/dist/runtime/dom/inspectRules.d.ts +37 -0
- package/dist/runtime/dom/inspectRules.js +101 -0
- package/dist/runtime/dom/inspectScripts.d.ts +132 -0
- package/dist/runtime/dom/inspectScripts.js +263 -0
- package/dist/runtime/dom/inspectTree.d.ts +40 -0
- package/dist/runtime/dom/inspectTree.js +134 -0
- package/dist/runtime/dom/inspectVariables.d.ts +33 -0
- package/dist/runtime/dom/inspectVariables.js +94 -0
- package/dist/runtime/dom/inspectWhyModel.d.ts +20 -0
- package/dist/runtime/dom/inspectWhyModel.js +134 -0
- package/dist/runtime/dom/layout.d.ts +71 -0
- package/dist/runtime/dom/layout.js +340 -0
- package/dist/runtime/dom/listenerPageScripts.d.ts +72 -0
- package/dist/runtime/dom/listenerPageScripts.js +365 -0
- package/dist/runtime/dom/listenerSummary.d.ts +136 -11
- package/dist/runtime/dom/listenerSummary.js +361 -22
- package/dist/runtime/dom/pageActivity.d.ts +41 -0
- package/dist/runtime/dom/pageActivity.js +123 -0
- package/dist/runtime/dom/reactEventHelpers.d.ts +63 -2
- package/dist/runtime/dom/reactEventHelpers.js +220 -41
- package/dist/runtime/dom/targetNode.d.ts +80 -27
- package/dist/runtime/dom/targetNode.js +249 -33
- package/dist/runtime/dom/wait.d.ts +25 -0
- package/dist/runtime/dom/wait.js +199 -0
- package/dist/runtime/dom/waitCondition.d.ts +71 -0
- package/dist/runtime/dom/waitCondition.js +75 -0
- package/dist/runtime/page/emulation.d.ts +71 -0
- package/dist/runtime/page/emulation.js +117 -0
- package/dist/runtime/page/loadingState.d.ts +36 -0
- package/dist/runtime/page/loadingState.js +86 -0
- package/dist/runtime/page/navigation.d.ts +46 -2
- package/dist/runtime/page/navigation.js +69 -33
- package/dist/session/QueryCacheManager.d.ts +11 -1
- package/dist/session/QueryCacheManager.js +25 -3
- package/dist/session/chromeOwners.d.ts +34 -0
- package/dist/session/chromeOwners.js +51 -0
- package/dist/session/cleanup/staleSession.d.ts +11 -1
- package/dist/session/cleanup/staleSession.js +17 -6
- package/dist/session/cleanup/userCommands.js +2 -4
- package/dist/session/metadata.d.ts +5 -1
- package/dist/session/metadata.js +2 -1
- package/dist/session/paths.d.ts +77 -3
- package/dist/session/paths.js +111 -5
- package/dist/session/port.d.ts +31 -7
- package/dist/session/port.js +50 -43
- package/dist/session/portClaims.d.ts +66 -0
- package/dist/session/portClaims.js +284 -0
- package/dist/session/sessionList.d.ts +58 -0
- package/dist/session/sessionList.js +199 -0
- package/dist/session/sessionName.d.ts +46 -0
- package/dist/session/sessionName.js +97 -0
- package/dist/telemetry/a11y.d.ts +18 -3
- package/dist/telemetry/a11y.js +170 -29
- package/dist/telemetry/console.d.ts +1 -0
- package/dist/telemetry/console.js +100 -5
- package/dist/telemetry/network.js +3 -1
- package/dist/telemetry/requestKinds.d.ts +32 -0
- package/dist/telemetry/requestKinds.js +61 -0
- package/dist/telemetry/requestState.d.ts +31 -0
- package/dist/telemetry/requestState.js +38 -0
- package/dist/types.d.ts +112 -3
- package/dist/ui/formatters/a11y.js +3 -0
- package/dist/ui/formatters/console/chronological.d.ts +8 -0
- package/dist/ui/formatters/console/chronological.js +17 -4
- package/dist/ui/formatters/console/json.js +3 -4
- package/dist/ui/formatters/console/shared.d.ts +12 -0
- package/dist/ui/formatters/console.d.ts +2 -2
- package/dist/ui/formatters/console.js +1 -1
- package/dist/ui/formatters/details.d.ts +8 -0
- package/dist/ui/formatters/details.js +61 -4
- package/dist/ui/formatters/dom.d.ts +27 -14
- package/dist/ui/formatters/dom.js +88 -59
- package/dist/ui/formatters/form.js +29 -18
- package/dist/ui/formatters/inspect.d.ts +39 -0
- package/dist/ui/formatters/inspect.js +596 -0
- package/dist/ui/formatters/keyAttributes.d.ts +19 -0
- package/dist/ui/formatters/keyAttributes.js +84 -0
- package/dist/ui/formatters/layout.d.ts +31 -0
- package/dist/ui/formatters/layout.js +53 -0
- package/dist/ui/formatters/listeners.d.ts +3 -2
- package/dist/ui/formatters/listeners.js +73 -9
- package/dist/ui/formatters/networkHeaders.d.ts +13 -0
- package/dist/ui/formatters/networkHeaders.js +36 -3
- package/dist/ui/formatters/networkList.d.ts +29 -1
- package/dist/ui/formatters/networkList.js +86 -20
- package/dist/ui/formatters/preview.js +2 -1
- package/dist/ui/formatters/requestStatus.d.ts +1 -17
- package/dist/ui/formatters/requestStatus.js +2 -30
- package/dist/ui/formatters/sessions.d.ts +12 -0
- package/dist/ui/formatters/sessions.js +40 -0
- package/dist/ui/formatters/status.d.ts +21 -2
- package/dist/ui/formatters/status.js +47 -10
- package/dist/ui/formatters/triggeredRequests.d.ts +36 -0
- package/dist/ui/formatters/triggeredRequests.js +65 -0
- package/dist/ui/formatting.d.ts +19 -0
- package/dist/ui/formatting.js +31 -36
- package/dist/ui/messages/chrome.d.ts +9 -0
- package/dist/ui/messages/chrome.js +17 -5
- package/dist/ui/messages/commands.d.ts +504 -14
- package/dist/ui/messages/commands.js +835 -21
- package/dist/ui/messages/consoleMessages.d.ts +10 -0
- package/dist/ui/messages/consoleMessages.js +17 -0
- package/dist/ui/messages/hints.js +2 -1
- package/dist/ui/messages/networkMessages.d.ts +14 -0
- package/dist/ui/messages/networkMessages.js +18 -0
- package/dist/ui/messages/preview.js +5 -4
- package/dist/ui/messages/session.d.ts +30 -21
- package/dist/ui/messages/session.js +48 -26
- package/dist/ui/messages/sessionCommand.d.ts +43 -0
- package/dist/ui/messages/sessionCommand.js +52 -0
- package/dist/utils/async.d.ts +17 -0
- package/dist/utils/async.js +36 -0
- package/dist/utils/color.d.ts +84 -0
- package/dist/utils/color.js +376 -0
- package/dist/utils/cssValues.d.ts +109 -0
- package/dist/utils/cssValues.js +236 -0
- package/dist/utils/http.d.ts +22 -1
- package/dist/utils/http.js +28 -9
- package/dist/utils/selectorFilters.d.ts +48 -8
- package/dist/utils/selectorFilters.js +296 -53
- package/dist/utils/shellDetection.d.ts +8 -2
- package/dist/utils/shellDetection.js +120 -33
- package/dist/utils/suggestions.d.ts +26 -0
- package/dist/utils/suggestions.js +73 -0
- package/dist/utils/taskMappings.js +10 -0
- package/dist/utils/url.d.ts +12 -2
- package/dist/utils/url.js +69 -7
- package/package.json +1 -1
- package/dist/ui/formatters/sessionFormatters.d.ts +0 -58
- package/dist/ui/formatters/sessionFormatters.js +0 -121
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* CLI commands and IPC transport consume them directly. Keeping the contract
|
|
7
7
|
* here lets runtime and transport evolve independently.
|
|
8
8
|
*/
|
|
9
|
-
import type { FormStep, FieldOption } from '../../types.js';
|
|
9
|
+
import type { FormStep, FieldOption, ViewportPosition } from '../../types.js';
|
|
10
10
|
/**
|
|
11
11
|
* A JavaScript dialog (alert, confirm, prompt, beforeunload) that bdg accepted
|
|
12
12
|
* while a command ran.
|
|
@@ -17,20 +17,122 @@ export interface DialogInfo {
|
|
|
17
17
|
/** Text the page showed */
|
|
18
18
|
message: string;
|
|
19
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* A network request that started while a command ran (after the action began
|
|
22
|
+
* and before the command returned).
|
|
23
|
+
*/
|
|
24
|
+
export interface TriggeredRequest {
|
|
25
|
+
/** Request id (what `bdg details network <id>` takes) */
|
|
26
|
+
requestId: string;
|
|
27
|
+
method: string;
|
|
28
|
+
url: string;
|
|
29
|
+
/** CDP resource type, e.g. `Document`, `Fetch`, `Stylesheet` */
|
|
30
|
+
resourceType?: string;
|
|
31
|
+
/** HTTP status, once a response arrived */
|
|
32
|
+
status?: number;
|
|
33
|
+
/** How long it took, once it finished or failed */
|
|
34
|
+
durationMs?: number;
|
|
35
|
+
/** Set when it failed without a response (DNS, refused, aborted, blocked) */
|
|
36
|
+
failed?: true;
|
|
37
|
+
/** Why it failed (also set when loading failed after the response) */
|
|
38
|
+
errorText?: string;
|
|
39
|
+
/** Set when it was still running when the command returned */
|
|
40
|
+
pending?: true;
|
|
41
|
+
/**
|
|
42
|
+
* Set when the response arrived but its body was still loading when the
|
|
43
|
+
* command returned (a stream such as EventSource, a slow download)
|
|
44
|
+
*/
|
|
45
|
+
loading?: true;
|
|
46
|
+
}
|
|
47
|
+
/** How the page changed location during an action */
|
|
48
|
+
export interface PageNavigation {
|
|
49
|
+
/** URL the page shows after the action */
|
|
50
|
+
url: string;
|
|
51
|
+
/** True for a same-document change (history API, hash); false for a new document */
|
|
52
|
+
sameDocument: boolean;
|
|
53
|
+
/** HTTP status of the new document, when known */
|
|
54
|
+
status?: number;
|
|
55
|
+
}
|
|
56
|
+
/** A message (alert, status, flash, error text) the page showed during an action */
|
|
57
|
+
export interface NewMessage {
|
|
58
|
+
/** Its visible text (close buttons and aria-hidden parts left out), at most 120 characters */
|
|
59
|
+
text: string;
|
|
60
|
+
/** The element showing it, e.g. `div#flash.flash.error` */
|
|
61
|
+
element: string;
|
|
62
|
+
}
|
|
63
|
+
/** An element a hover or key press showed (added, or made visible) */
|
|
64
|
+
export interface ShownElement {
|
|
65
|
+
/** Its visible text, at most 120 characters */
|
|
66
|
+
text: string;
|
|
67
|
+
/** The element, e.g. `div.figcaption` */
|
|
68
|
+
element: string;
|
|
69
|
+
}
|
|
70
|
+
/** What the page was still working on when an action returned */
|
|
71
|
+
export interface PendingChanges {
|
|
72
|
+
/** Content requests (documents, fetch/XHR, scripts) the action started that were still running */
|
|
73
|
+
requests?: number;
|
|
74
|
+
/** A new document was still loading */
|
|
75
|
+
navigation?: true;
|
|
76
|
+
/** A loading indicator that appeared during the action and was still shown, e.g. `div#loading` */
|
|
77
|
+
loading?: string;
|
|
78
|
+
/** The DOM was still changing (several bursts of changes, the last one under 150 ms ago) */
|
|
79
|
+
domChanging?: true;
|
|
80
|
+
/** The page did not answer within 250 ms (a long-running script) */
|
|
81
|
+
busy?: true;
|
|
82
|
+
}
|
|
83
|
+
/** What an action changed on the page, besides its triggered requests */
|
|
84
|
+
export interface ActionEffects {
|
|
85
|
+
/** The page navigated or changed its URL (absent when it did not) */
|
|
86
|
+
navigation?: PageNavigation;
|
|
87
|
+
/** Messages that appeared or changed (at most 3; absent when none did) */
|
|
88
|
+
messages?: NewMessage[];
|
|
89
|
+
/** Elements a hover or key press showed (at most 3, outermost first; absent when none) */
|
|
90
|
+
shown?: ShownElement[];
|
|
91
|
+
/** "none" when the action had no visible effect: no DOM change, request or navigation */
|
|
92
|
+
effect?: 'none';
|
|
93
|
+
/** False when the page was still changing as the action returned (absent otherwise) */
|
|
94
|
+
settled?: false;
|
|
95
|
+
/** What the page was still working on (with `settled: false`) */
|
|
96
|
+
pending?: PendingChanges;
|
|
97
|
+
}
|
|
98
|
+
/** A filled field's value differing from the one given */
|
|
99
|
+
export interface FillValueMismatch {
|
|
100
|
+
/** Value given (for a select: the chosen option's value; checkboxes: checked/unchecked) */
|
|
101
|
+
expected: string;
|
|
102
|
+
/** Value the field has after filling */
|
|
103
|
+
actual: string;
|
|
104
|
+
/** Set when the page cut the value to the field's maxlength */
|
|
105
|
+
truncatedTo?: number;
|
|
106
|
+
/** Password fields (values masked): length of the value given */
|
|
107
|
+
expectedLength?: number;
|
|
108
|
+
/** Password fields (values masked): length of the field's value */
|
|
109
|
+
actualLength?: number;
|
|
110
|
+
/** Another field of the form that holds the value given, e.g. `input#first-name` */
|
|
111
|
+
movedTo?: string;
|
|
112
|
+
}
|
|
20
113
|
/**
|
|
21
114
|
* Result of filling an element.
|
|
22
115
|
*/
|
|
23
|
-
export interface FillResult {
|
|
116
|
+
export interface FillResult extends ActionEffects {
|
|
24
117
|
success: boolean;
|
|
25
118
|
error?: string;
|
|
26
119
|
selector?: string;
|
|
27
120
|
value?: string;
|
|
121
|
+
/** The element acted on, e.g. `input.toggle in div.view "Write report"` */
|
|
122
|
+
element?: string;
|
|
28
123
|
elementType?: string;
|
|
29
124
|
inputType?: string | null;
|
|
30
125
|
checked?: boolean;
|
|
126
|
+
/**
|
|
127
|
+
* Set when the field's value read back after filling is not the one given
|
|
128
|
+
* (the page rejected, reformatted or moved it; passwords masked)
|
|
129
|
+
*/
|
|
130
|
+
valueMismatch?: FillValueMismatch;
|
|
31
131
|
suggestion?: string;
|
|
32
132
|
/** Set when the target is a file input (filled through CDP instead) */
|
|
33
133
|
fileInput?: boolean;
|
|
134
|
+
/** Set when the target is not a field (nor a label of one): a list from another command was likely meant */
|
|
135
|
+
unsuitableElement?: boolean;
|
|
34
136
|
/** Something the page will likely object to (e.g. a value above max) */
|
|
35
137
|
warning?: string;
|
|
36
138
|
/** Elements the selector matched */
|
|
@@ -38,14 +140,20 @@ export interface FillResult {
|
|
|
38
140
|
exitCode?: number;
|
|
39
141
|
/** Dialogs accepted while the command ran */
|
|
40
142
|
dialogs?: DialogInfo[];
|
|
143
|
+
/** Requests the action triggered (absent when network telemetry is off) */
|
|
144
|
+
triggeredRequests?: TriggeredRequest[];
|
|
145
|
+
/** Requests left out of `triggeredRequests` (it lists the first 50) */
|
|
146
|
+
triggeredRequestsOmitted?: number;
|
|
41
147
|
}
|
|
42
148
|
/**
|
|
43
149
|
* Result of clicking an element.
|
|
44
150
|
*/
|
|
45
|
-
export interface ClickResult {
|
|
151
|
+
export interface ClickResult extends ActionEffects {
|
|
46
152
|
success: boolean;
|
|
47
153
|
error?: string;
|
|
48
154
|
selector?: string;
|
|
155
|
+
/** The element acted on, e.g. `input.toggle in div.view "Write report"` */
|
|
156
|
+
element?: string;
|
|
49
157
|
elementType?: string;
|
|
50
158
|
matchCount?: number;
|
|
51
159
|
selectedIndex?: number;
|
|
@@ -61,14 +169,20 @@ export interface ClickResult {
|
|
|
61
169
|
warning?: string;
|
|
62
170
|
/** Dialogs accepted while the command ran */
|
|
63
171
|
dialogs?: DialogInfo[];
|
|
172
|
+
/** Requests the action triggered (absent when network telemetry is off) */
|
|
173
|
+
triggeredRequests?: TriggeredRequest[];
|
|
174
|
+
/** Requests left out of `triggeredRequests` (it lists the first 50) */
|
|
175
|
+
triggeredRequestsOmitted?: number;
|
|
64
176
|
}
|
|
65
177
|
/**
|
|
66
178
|
* Result of pressing a key on an element.
|
|
67
179
|
*/
|
|
68
|
-
export interface PressKeyResult {
|
|
180
|
+
export interface PressKeyResult extends ActionEffects {
|
|
69
181
|
success: boolean;
|
|
70
182
|
error?: string;
|
|
71
183
|
selector?: string;
|
|
184
|
+
/** The element acted on, e.g. `input.toggle in div.view "Write report"` */
|
|
185
|
+
element?: string;
|
|
72
186
|
key?: string;
|
|
73
187
|
times?: number;
|
|
74
188
|
/** Modifier keys held, e.g. ["Ctrl", "Shift"] */
|
|
@@ -82,17 +196,23 @@ export interface PressKeyResult {
|
|
|
82
196
|
warning?: string;
|
|
83
197
|
/** Dialogs accepted while the command ran */
|
|
84
198
|
dialogs?: DialogInfo[];
|
|
199
|
+
/** Requests the action triggered (absent when network telemetry is off) */
|
|
200
|
+
triggeredRequests?: TriggeredRequest[];
|
|
201
|
+
/** Requests left out of `triggeredRequests` (it lists the first 50) */
|
|
202
|
+
triggeredRequestsOmitted?: number;
|
|
85
203
|
}
|
|
86
204
|
/**
|
|
87
205
|
* Result of a scroll operation.
|
|
88
206
|
*/
|
|
89
|
-
export interface ScrollResult {
|
|
207
|
+
export interface ScrollResult extends ActionEffects {
|
|
90
208
|
success: boolean;
|
|
91
209
|
error?: string;
|
|
92
210
|
suggestion?: string;
|
|
93
211
|
exitCode?: number;
|
|
94
212
|
scrollType: 'element' | 'position' | 'offset';
|
|
95
213
|
selector?: string;
|
|
214
|
+
/** The element acted on, e.g. `input.toggle in div.view "Write report"` */
|
|
215
|
+
element?: string;
|
|
96
216
|
scrolledTo?: {
|
|
97
217
|
x: number;
|
|
98
218
|
y: number;
|
|
@@ -113,22 +233,36 @@ export interface ScrollResult {
|
|
|
113
233
|
matchCount?: number;
|
|
114
234
|
/** Set when the selector matched several elements */
|
|
115
235
|
warning?: string;
|
|
236
|
+
/** Requests the action triggered (absent when network telemetry is off) */
|
|
237
|
+
triggeredRequests?: TriggeredRequest[];
|
|
238
|
+
/** Requests left out of `triggeredRequests` (it lists the first 50) */
|
|
239
|
+
triggeredRequestsOmitted?: number;
|
|
116
240
|
}
|
|
117
241
|
/**
|
|
118
242
|
* Result of submitting a form.
|
|
119
243
|
*/
|
|
120
|
-
export interface SubmitResult {
|
|
244
|
+
export interface SubmitResult extends ActionEffects {
|
|
121
245
|
success: boolean;
|
|
122
246
|
error?: string;
|
|
123
247
|
selector?: string;
|
|
248
|
+
/** The element acted on, e.g. `input.toggle in div.view "Write report"` */
|
|
249
|
+
element?: string;
|
|
124
250
|
clicked?: boolean;
|
|
251
|
+
/** Set when the target is neither a form nor a button: a list from another command was likely meant */
|
|
252
|
+
unsuitableElement?: boolean;
|
|
125
253
|
networkRequests?: number;
|
|
126
254
|
navigationOccurred?: boolean;
|
|
127
255
|
waitTimeMs?: number;
|
|
256
|
+
/** Set when the page loaded but its requests had not finished by the timeout */
|
|
257
|
+
warning?: string;
|
|
128
258
|
suggestion?: string;
|
|
129
259
|
exitCode?: number;
|
|
130
260
|
/** Dialogs accepted while the command ran */
|
|
131
261
|
dialogs?: DialogInfo[];
|
|
262
|
+
/** Requests the action triggered (absent when network telemetry is off) */
|
|
263
|
+
triggeredRequests?: TriggeredRequest[];
|
|
264
|
+
/** Requests left out of `triggeredRequests` (it lists the first 50) */
|
|
265
|
+
triggeredRequestsOmitted?: number;
|
|
132
266
|
}
|
|
133
267
|
/** Where an event listener is attached, seen from the inspected element. */
|
|
134
268
|
export type ListenerPlacement = 'target' | 'ancestor' | 'document' | 'window';
|
|
@@ -157,6 +291,41 @@ export interface ElementListener {
|
|
|
157
291
|
passive: boolean;
|
|
158
292
|
once: boolean;
|
|
159
293
|
handler: ListenerHandler;
|
|
294
|
+
/** The handler does nothing (an empty function, like React's `onclick` placeholder) */
|
|
295
|
+
noop?: true;
|
|
296
|
+
/**
|
|
297
|
+
* Registered through this framework; `handler` is the real handler, not
|
|
298
|
+
* the framework's dispatcher. React handlers are `on…` props of the node
|
|
299
|
+
* (`reactProp`), run by React's dispatchers on its root container;
|
|
300
|
+
* Preact handlers are run by Preact's event proxy on the node itself.
|
|
301
|
+
*/
|
|
302
|
+
framework?: 'jQuery' | 'Preact' | 'React';
|
|
303
|
+
/** React prop the handler is set as, e.g. `onClick`, `onClickCapture` */
|
|
304
|
+
reactProp?: string;
|
|
305
|
+
/** jQuery delegate selector (`.on(type, selector, fn)`) the element matched */
|
|
306
|
+
delegateSelector?: string;
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* Listeners of one node collapsed into a summary: a framework root (React's
|
|
310
|
+
* root container) registers the same few dispatchers for dozens of event types.
|
|
311
|
+
*/
|
|
312
|
+
export interface CollapsedListeners {
|
|
313
|
+
/** Where the listeners are attached */
|
|
314
|
+
on: ListenerPlacement;
|
|
315
|
+
/** The node or object they are attached to, e.g. `div#__next` */
|
|
316
|
+
node: string;
|
|
317
|
+
/** Framework recognised on the node, e.g. `React root` */
|
|
318
|
+
framework?: string;
|
|
319
|
+
/** Event types, alphabetically */
|
|
320
|
+
types: string[];
|
|
321
|
+
/** Number of listeners collapsed */
|
|
322
|
+
count: number;
|
|
323
|
+
/** Some listen in the capture phase */
|
|
324
|
+
capture: boolean;
|
|
325
|
+
/** Some listen in the bubble phase */
|
|
326
|
+
bubble: boolean;
|
|
327
|
+
/** The distinct dispatcher functions */
|
|
328
|
+
handlers: ListenerHandler[];
|
|
160
329
|
}
|
|
161
330
|
/**
|
|
162
331
|
* Event listeners of an element, its ancestors, its document and window,
|
|
@@ -172,11 +341,112 @@ export interface ListenersResult {
|
|
|
172
341
|
/** The inspected element, e.g. `button#save` */
|
|
173
342
|
element: string;
|
|
174
343
|
listeners: ElementListener[];
|
|
344
|
+
/** Framework root listeners, one entry per node (missing with `all`) */
|
|
345
|
+
collapsed?: CollapsedListeners[];
|
|
346
|
+
/** The iframe element whose document holds the element, e.g. `iframe#checkout` */
|
|
347
|
+
frame?: string;
|
|
348
|
+
/** jQuery handlers not resolved (over 50 per call): their dispatcher is listed instead */
|
|
349
|
+
jqueryHandlersSkipped?: number;
|
|
350
|
+
/** React `on…` props not resolved (over 50 per call) */
|
|
351
|
+
reactHandlersSkipped?: number;
|
|
352
|
+
/** Event types with listeners close to the requested ones, when none matched (`Click` → `click`) */
|
|
353
|
+
typeSuggestions?: string[];
|
|
175
354
|
/** Elements the selector matched */
|
|
176
355
|
matchCount?: number;
|
|
177
356
|
/** Set when several elements matched and no --index was given */
|
|
178
357
|
warning?: string;
|
|
179
358
|
}
|
|
359
|
+
/** A point in CSS pixels. */
|
|
360
|
+
export interface LayoutPoint {
|
|
361
|
+
x: number;
|
|
362
|
+
y: number;
|
|
363
|
+
}
|
|
364
|
+
/** A width and height in CSS pixels. */
|
|
365
|
+
export interface LayoutSize {
|
|
366
|
+
width: number;
|
|
367
|
+
height: number;
|
|
368
|
+
}
|
|
369
|
+
/** Position and size of an element's border box in CSS pixels. */
|
|
370
|
+
export type LayoutBox = LayoutPoint & LayoutSize;
|
|
371
|
+
/** Computed styles that decide whether and how an element shows. */
|
|
372
|
+
export interface LayoutComputedStyle {
|
|
373
|
+
display: string;
|
|
374
|
+
visibility: string;
|
|
375
|
+
position: string;
|
|
376
|
+
opacity: string;
|
|
377
|
+
zIndex: string;
|
|
378
|
+
}
|
|
379
|
+
/** Where one element is on the page and whether a user can see it. */
|
|
380
|
+
export interface ElementLayout {
|
|
381
|
+
/** Index among the selector's matches (or in the cached query) */
|
|
382
|
+
index: number;
|
|
383
|
+
tag: string;
|
|
384
|
+
/** Short description, e.g. `button#save.primary` */
|
|
385
|
+
element: string;
|
|
386
|
+
/** Text preview */
|
|
387
|
+
text?: string;
|
|
388
|
+
/** Enclosing iframe(s) and shadow root, e.g. `iframe#pay > shadow root of <x-card>` */
|
|
389
|
+
context?: string;
|
|
390
|
+
/** Border box relative to the top-level document (page coordinates) */
|
|
391
|
+
bounds: LayoutBox;
|
|
392
|
+
/** Top-left corner relative to the top-level viewport */
|
|
393
|
+
viewport: LayoutPoint;
|
|
394
|
+
inViewport: ViewportPosition;
|
|
395
|
+
/** Share of the element in view, for `partly` */
|
|
396
|
+
percentVisible?: number;
|
|
397
|
+
/** Why it is `hidden`, e.g. `display: none` */
|
|
398
|
+
hiddenReason?: string;
|
|
399
|
+
/**
|
|
400
|
+
* Page scroll (`window.scrollBy`) that shows all of it, when the page can
|
|
401
|
+
* scroll there: for a `partly` visible element the smallest such scroll (the
|
|
402
|
+
* part cut off at the edge; the start of one larger than the viewport), for
|
|
403
|
+
* one out of view the scroll centring it (as `dom scroll <selector>` does)
|
|
404
|
+
*/
|
|
405
|
+
scrollBy?: LayoutPoint;
|
|
406
|
+
/** Ancestor or iframe cutting it off (scroll that container instead of the page) */
|
|
407
|
+
clippedBy?: string;
|
|
408
|
+
/** Why page scroll cannot bring it fully into view: it is fixed, or beyond the page's scroll range */
|
|
409
|
+
offScreenReason?: string;
|
|
410
|
+
/** Topmost element at the center of its visible part, when that is another element */
|
|
411
|
+
coveredBy?: string;
|
|
412
|
+
/**
|
|
413
|
+
* The covering element paints nothing at that point (no background, image,
|
|
414
|
+
* shadow or text of its own): the element still shows, but clicks land on
|
|
415
|
+
* the cover
|
|
416
|
+
*/
|
|
417
|
+
coverTransparent?: true;
|
|
418
|
+
/**
|
|
419
|
+
* Why it cannot be seen although it is rendered: `opacity: 0` on it or an
|
|
420
|
+
* ancestor, or a `clip-path`/`clip` that cuts it away entirely, e.g.
|
|
421
|
+
* `opacity: 0 on div#menu` (`inViewport` still says where it is)
|
|
422
|
+
*/
|
|
423
|
+
invisible?: string;
|
|
424
|
+
/** Inside an `inert` element: shown, but a user cannot interact with it */
|
|
425
|
+
inert?: true;
|
|
426
|
+
computed: LayoutComputedStyle;
|
|
427
|
+
}
|
|
428
|
+
/** Viewport, scroll position and document size of the top-level page. */
|
|
429
|
+
export interface PageLayout {
|
|
430
|
+
/** Layout viewport without scrollbars (as `dom scroll` reports it) */
|
|
431
|
+
viewport: LayoutSize;
|
|
432
|
+
scroll: LayoutPoint;
|
|
433
|
+
document: LayoutSize;
|
|
434
|
+
/** `prefers-color-scheme` the page sees (the system's unless `--color-scheme` was given at start) */
|
|
435
|
+
colorScheme?: 'light' | 'dark';
|
|
436
|
+
}
|
|
437
|
+
/** Layout of the elements a selector (or cached index) refers to. */
|
|
438
|
+
export interface LayoutResult {
|
|
439
|
+
/** Always true: failures are reported as errors */
|
|
440
|
+
success: true;
|
|
441
|
+
/** Selector the elements were found with (for an index: the cached query's) */
|
|
442
|
+
selector: string;
|
|
443
|
+
/** Elements the selector matched (1 for an index) */
|
|
444
|
+
count: number;
|
|
445
|
+
page: PageLayout;
|
|
446
|
+
elements: ElementLayout[];
|
|
447
|
+
/** Matches left out of `elements` (beyond the limit) */
|
|
448
|
+
omitted?: number;
|
|
449
|
+
}
|
|
180
450
|
/**
|
|
181
451
|
* Raw form data returned from the page-context form-discovery script.
|
|
182
452
|
*/
|
|
@@ -186,6 +456,8 @@ export interface RawFormData {
|
|
|
186
456
|
frameForms?: Array<{
|
|
187
457
|
url: string;
|
|
188
458
|
}>;
|
|
459
|
+
/** The page's `document.readyState` when the forms were read */
|
|
460
|
+
readyState?: string;
|
|
189
461
|
}
|
|
190
462
|
export interface RawForm {
|
|
191
463
|
index: number;
|
|
@@ -194,6 +466,10 @@ export interface RawForm {
|
|
|
194
466
|
method: string;
|
|
195
467
|
step: FormStep | null;
|
|
196
468
|
relevanceScore: number;
|
|
469
|
+
/** Not rendered (or visibility-hidden), or all its fields are */
|
|
470
|
+
hidden?: boolean;
|
|
471
|
+
/** Shown inside an open dialog (`dialog[open]`, `aria-modal`, a dialog role) */
|
|
472
|
+
inDialog?: boolean;
|
|
197
473
|
inIframe: boolean;
|
|
198
474
|
iframeUrl?: string;
|
|
199
475
|
crossOrigin?: boolean;
|
|
@@ -209,7 +485,10 @@ export interface RawField {
|
|
|
209
485
|
label: string;
|
|
210
486
|
name: string | null;
|
|
211
487
|
placeholder?: string;
|
|
488
|
+
/** `required`, aria-required, or a label marked with an asterisk */
|
|
212
489
|
required: boolean;
|
|
490
|
+
/** Name of the radio/checkbox group (legend, radiogroup label or name) */
|
|
491
|
+
groupLabel?: string;
|
|
213
492
|
disabled: boolean;
|
|
214
493
|
readOnly: boolean;
|
|
215
494
|
hidden: boolean;
|
|
@@ -231,6 +510,11 @@ export interface RawButton {
|
|
|
231
510
|
label: string;
|
|
232
511
|
type: string;
|
|
233
512
|
disabled: boolean;
|
|
234
|
-
|
|
513
|
+
/** A submit button by markup: `<input type=submit>` or `type="submit"` written out */
|
|
514
|
+
explicitSubmit: boolean;
|
|
515
|
+
/** A `<button>` without a type in a form: submits it, like Enter does */
|
|
516
|
+
formDefault: boolean;
|
|
517
|
+
/** Has a class like `primary`, `btn-primary` or `submit` */
|
|
518
|
+
primaryClass: boolean;
|
|
235
519
|
}
|
|
236
520
|
//# sourceMappingURL=domTypes.d.ts.map
|