browser-debugger-cli 0.8.0 → 0.9.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 +4 -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 +27 -5
- 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 +152 -113
- 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/query.d.ts +44 -17
- package/dist/commands/dom/helpers/query.js +244 -97
- package/dist/commands/dom/helpers/runElementCommand.d.ts +10 -2
- package/dist/commands/dom/helpers/runElementCommand.js +97 -30
- package/dist/commands/dom/helpers/screenshot.d.ts +4 -1
- package/dist/commands/dom/helpers/screenshot.js +164 -49
- package/dist/commands/dom/index.d.ts +3 -1
- package/dist/commands/dom/index.js +16 -6
- 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 +13 -3
- 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 +6 -13
- package/dist/commands/dom/semanticUtils.js +15 -19
- 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 +4 -11
- package/dist/commands/optionBehaviors.js +112 -21
- package/dist/commands/page.d.ts +2 -1
- package/dist/commands/page.js +41 -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/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 +40 -5
- package/dist/commands/shared/startHelpers.js +12 -3
- package/dist/commands/shared/validation.d.ts +3 -2
- package/dist/commands/shared/validation.js +4 -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 +2 -1
- package/dist/daemon/launcher.js +5 -6
- package/dist/daemon/server/SocketServer.js +1 -2
- package/dist/daemon/session/Session.d.ts +13 -0
- package/dist/daemon/session/Session.js +57 -8
- package/dist/daemon/session/chromeConnection.d.ts +9 -0
- package/dist/daemon/session/chromeConnection.js +45 -8
- package/dist/daemon/session/commandRegistry.js +52 -62
- package/dist/daemon/session/interactions.d.ts +35 -9
- package/dist/daemon/session/interactions.js +36 -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 +5393 -1600
- package/dist/errors/messages.d.ts +387 -24
- package/dist/errors/messages.js +761 -67
- package/dist/index.js +3976 -1558
- package/dist/ipc/client.d.ts +12 -1
- package/dist/ipc/client.js +22 -3
- package/dist/ipc/protocol/commands.d.ts +89 -4
- package/dist/ipc/protocol/commands.js +2 -0
- package/dist/ipc/protocol/domTypes.d.ts +258 -7
- 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 +106 -0
- package/dist/runtime/dom/actionEffects.js +256 -0
- package/dist/runtime/dom/actionEffectsScripts.d.ts +52 -0
- package/dist/runtime/dom/actionEffectsScripts.js +234 -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 +77 -0
- package/dist/runtime/dom/elementInfo.js +191 -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 +174 -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 +10 -0
- package/dist/runtime/dom/formFillHelpers/fill.js +125 -10
- 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 +1 -1
- package/dist/runtime/dom/frameSelection.js +2 -2
- package/dist/runtime/dom/frames.d.ts +25 -2
- package/dist/runtime/dom/frames.js +202 -63
- package/dist/runtime/dom/layout.d.ts +67 -0
- package/dist/runtime/dom/layout.js +333 -0
- package/dist/runtime/dom/listenerPageScripts.d.ts +66 -0
- package/dist/runtime/dom/listenerPageScripts.js +279 -0
- package/dist/runtime/dom/listenerSummary.d.ts +132 -11
- package/dist/runtime/dom/listenerSummary.js +344 -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 +58 -2
- package/dist/runtime/dom/reactEventHelpers.js +212 -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 +51 -0
- package/dist/runtime/page/emulation.js +80 -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 +8 -3
- package/dist/telemetry/a11y.js +92 -28
- 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 +80 -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.js +2 -1
- package/dist/ui/formatters/dom.d.ts +26 -14
- package/dist/ui/formatters/dom.js +65 -52
- package/dist/ui/formatters/form.js +29 -18
- 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.js +13 -0
- 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 +10 -0
- package/dist/ui/formatting.js +28 -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 +388 -14
- package/dist/ui/messages/commands.js +664 -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/preview.js +5 -4
- package/dist/ui/messages/session.d.ts +16 -21
- package/dist/ui/messages/session.js +28 -26
- package/dist/ui/messages/sessionCommand.d.ts +43 -0
- package/dist/ui/messages/sessionCommand.js +52 -0
- package/dist/utils/async.d.ts +8 -0
- package/dist/utils/async.js +19 -0
- package/dist/utils/http.d.ts +22 -1
- package/dist/utils/http.js +28 -9
- package/dist/utils/selectorFilters.d.ts +36 -8
- package/dist/utils/selectorFilters.js +267 -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
|
@@ -4,7 +4,11 @@
|
|
|
4
4
|
* User-facing messages for command-specific operations like stopping sessions,
|
|
5
5
|
* cleaning up stale files, and validating command arguments.
|
|
6
6
|
*/
|
|
7
|
-
import type { DomFrame } from '../../ipc/protocol/commands.js';
|
|
7
|
+
import type { DomFrame, PageLoadingState, PendingRequestInfo } from '../../ipc/protocol/commands.js';
|
|
8
|
+
import type { ElementLayout, FillValueMismatch, LayoutSize, NewMessage, PageLayout, PageNavigation } from '../../ipc/protocol/domTypes.js';
|
|
9
|
+
import type { DelegationNote } from '../../runtime/dom/listenerSummary.js';
|
|
10
|
+
import type { WaitCondition, WaitSnapshot } from '../../runtime/dom/waitCondition.js';
|
|
11
|
+
import type { DocumentRequestState, ViewportPosition } from '../../types.js';
|
|
8
12
|
/**
|
|
9
13
|
* Chrome closed by `bdg stop` (gracefully, so the profile is saved).
|
|
10
14
|
*
|
|
@@ -26,13 +30,205 @@ export declare function orphanedDaemonsCleanedMessage(count: number): string;
|
|
|
26
30
|
* @returns Warning text
|
|
27
31
|
*/
|
|
28
32
|
export declare function domClickFallbackWarning(reason: string | null | undefined): string;
|
|
33
|
+
/** Reason of a `bdg dom form` blocker for a required field left empty */
|
|
34
|
+
export declare const REQUIRED_FIELD_EMPTY_REASON = "Required field is empty";
|
|
35
|
+
/**
|
|
36
|
+
* Part of the `bdg dom form` summary naming the required fields left empty.
|
|
37
|
+
*
|
|
38
|
+
* @param labels - Labels of the empty required fields
|
|
39
|
+
* @returns e.g. "2 required fields empty: Last Name, Zip"
|
|
40
|
+
*/
|
|
41
|
+
export declare function requiredFieldsEmptyMessage(labels: string[]): string;
|
|
42
|
+
/**
|
|
43
|
+
* Readiness at the end of the `bdg dom form` summary.
|
|
44
|
+
*
|
|
45
|
+
* @param summary - Whether the form is ready, how many fields are filled and
|
|
46
|
+
* required, and the labels of the empty ones
|
|
47
|
+
* @returns e.g. "READY to submit", "NOT ready (no fields filled)"
|
|
48
|
+
*/
|
|
49
|
+
export declare function formReadinessMessage(summary: {
|
|
50
|
+
readyToSubmit: boolean;
|
|
51
|
+
filledFields: number;
|
|
52
|
+
requiredTotal: number;
|
|
53
|
+
emptyFieldLabels: string[];
|
|
54
|
+
}): string;
|
|
55
|
+
/** Why an action's status line is not a clean success when nothing changed */
|
|
56
|
+
export declare const NO_VISIBLE_EFFECT = "no visible effect observed: no DOM change, requests or navigation within 300 ms";
|
|
57
|
+
/**
|
|
58
|
+
* Status line of a DOM action: a check mark only for a clean success.
|
|
59
|
+
*
|
|
60
|
+
* @param done - What was done, e.g. "Element Clicked"
|
|
61
|
+
* @param warned - Whether the action has warnings (shown right below)
|
|
62
|
+
* @param noEffect - Whether the action had no visible effect
|
|
63
|
+
* @returns e.g. "✓ Element Clicked", "⚠ Element Clicked (with warnings)" or
|
|
64
|
+
* "⚠ Element Clicked (no visible effect observed: no DOM change, requests or navigation within 300 ms)"
|
|
65
|
+
*/
|
|
66
|
+
export declare function actionStatusLine(done: string, warned: boolean, noEffect?: boolean): string;
|
|
67
|
+
/**
|
|
68
|
+
* How an action changed the page's location, for its `Page:` row.
|
|
69
|
+
*
|
|
70
|
+
* @param navigation - Navigation the action caused
|
|
71
|
+
* @returns e.g. "navigated to https://example.com/secure (200)" or
|
|
72
|
+
* "URL changed to https://example.com/#/active (same document)"
|
|
73
|
+
*/
|
|
74
|
+
export declare function pageNavigationText(navigation: PageNavigation): string;
|
|
75
|
+
/**
|
|
76
|
+
* A message an action made appear, for its `New text:` rows.
|
|
77
|
+
*
|
|
78
|
+
* @param message - New message
|
|
79
|
+
* @returns e.g. `"Your password is invalid!" (div#flash.flash.error)`
|
|
80
|
+
*/
|
|
81
|
+
export declare function newMessageText(message: NewMessage): string;
|
|
82
|
+
/**
|
|
83
|
+
* Warning shown when a filled field's value read back is not the one given:
|
|
84
|
+
* cut to its maxlength, a password of another length (values never shown),
|
|
85
|
+
* or another value (naming the field the value went to, when one has it).
|
|
86
|
+
*
|
|
87
|
+
* @param mismatch - Value given and value found (masked for passwords)
|
|
88
|
+
* @returns Warning text
|
|
89
|
+
*/
|
|
90
|
+
export declare function valueMismatchWarning(mismatch: FillValueMismatch): string;
|
|
91
|
+
/**
|
|
92
|
+
* Warning shown when a mouse press was dispatched but the target never
|
|
93
|
+
* received it (e.g. a browser dialog or bubble captured the input).
|
|
94
|
+
*/
|
|
95
|
+
export declare const CLICK_NOT_RECEIVED_WARNING = "The click may not have reached the element: the page saw no mouse press (the browser may be showing a dialog or bubble that captures input)";
|
|
29
96
|
/**
|
|
30
97
|
* Note under a shortened list of matches.
|
|
31
98
|
*
|
|
32
99
|
* @param hidden - Matches not listed
|
|
33
|
-
* @
|
|
100
|
+
* @param jsonLimit - How many JSON output lists, when it leaves some out too
|
|
101
|
+
* @returns e.g. "... and 1174 more (use --json for all)",
|
|
102
|
+
* "... and 8980 more (--json lists the first 100)"
|
|
103
|
+
*/
|
|
104
|
+
export declare function moreMatchesNote(hidden: number, jsonLimit?: number): string;
|
|
105
|
+
/**
|
|
106
|
+
* Note under a list of a11y query matches cut by `--limit`.
|
|
107
|
+
*
|
|
108
|
+
* @param omitted - Matches not listed
|
|
109
|
+
* @returns e.g. "... and 213 more (--limit 0 lists all; their indices work too)"
|
|
110
|
+
*/
|
|
111
|
+
export declare function a11yMoreMatchesNote(omitted: number): string;
|
|
112
|
+
/**
|
|
113
|
+
* Note under a shortened list of requests an action triggered when JSON
|
|
114
|
+
* output left some out too (they are only in the network telemetry then).
|
|
115
|
+
*
|
|
116
|
+
* @param hidden - Requests not listed
|
|
117
|
+
* @returns e.g. "... and 50 more (see bdg network list)"
|
|
34
118
|
*/
|
|
35
|
-
export declare function
|
|
119
|
+
export declare function moreRequestsNote(hidden: number): string;
|
|
120
|
+
/**
|
|
121
|
+
* Title of the list of requests that started while an action ran (they are
|
|
122
|
+
* attributed by time, so a page poller's requests are listed too: the title
|
|
123
|
+
* doesn't claim the action caused them).
|
|
124
|
+
*
|
|
125
|
+
* @param total - Requests in all
|
|
126
|
+
* @returns e.g. "Requests during the action (18):"
|
|
127
|
+
*/
|
|
128
|
+
export declare function triggeredRequestsTitle(total: number): string;
|
|
129
|
+
/**
|
|
130
|
+
* Line counting the static assets an action loaded instead of listing them.
|
|
131
|
+
*
|
|
132
|
+
* @param count - Asset requests
|
|
133
|
+
* @param types - Short type names, e.g. ["css", "js", "images"]
|
|
134
|
+
* @returns e.g. "+ 97 assets (css, js, fonts, images)"
|
|
135
|
+
*/
|
|
136
|
+
export declare function assetRequestsNote(count: number, types: string[]): string;
|
|
137
|
+
/**
|
|
138
|
+
* Pieces of the reasons `bdg dom layout` gives for hidden and invisible
|
|
139
|
+
* elements. The page-side measurement builds the reasons from them, e.g.
|
|
140
|
+
* `clipped by div#acc: zero height`, `opacity: 0 on div#menu`.
|
|
141
|
+
*/
|
|
142
|
+
export declare const LAYOUT_REASONS: {
|
|
143
|
+
/** Hidden: an `<option>` of a closed `<select>` has no box */
|
|
144
|
+
readonly option: "not rendered (an <option> is shown by its <select>)";
|
|
145
|
+
/** Hidden: start of the reason for a clipping container with no area, followed by it */
|
|
146
|
+
readonly clippedBy: "clipped by ";
|
|
147
|
+
/** Which size of that container is zero */
|
|
148
|
+
readonly zeroHeight: "zero height";
|
|
149
|
+
readonly zeroWidth: "zero width";
|
|
150
|
+
/** Invisible: fully transparent */
|
|
151
|
+
readonly transparent: "opacity: 0";
|
|
152
|
+
/** Joins an invisible reason to the ancestor causing it */
|
|
153
|
+
readonly on: " on ";
|
|
154
|
+
};
|
|
155
|
+
/**
|
|
156
|
+
* Off-screen reason for an element out of view on a page whose scrolling is
|
|
157
|
+
* locked, naming the visible dialog that likely locked it when there is one.
|
|
158
|
+
*
|
|
159
|
+
* @param lock - What locks it, e.g. `overflow: hidden on body`
|
|
160
|
+
* @param dialog - Visible dialog on the page, e.g. `div#consent` (null: none)
|
|
161
|
+
* @returns e.g. `page scrolling is locked (overflow: hidden on body), likely by dialog div#consent`,
|
|
162
|
+
* or `page scrolling is locked (overflow: hidden on body)`
|
|
163
|
+
*/
|
|
164
|
+
export declare function scrollLockedReason(lock: string, dialog?: string | null): string;
|
|
165
|
+
/**
|
|
166
|
+
* Location hint for an element outside the viewport or hidden.
|
|
167
|
+
*
|
|
168
|
+
* @param position - Where the element is
|
|
169
|
+
* @param clippedBy - Ancestor or iframe cutting it off, if any
|
|
170
|
+
* @returns e.g. "below fold", "out of view in ul#list"; undefined for
|
|
171
|
+
* elements (partly) in view
|
|
172
|
+
*/
|
|
173
|
+
export declare function viewportPositionHint(position: ViewportPosition, clippedBy?: string): string | undefined;
|
|
174
|
+
/** What {@link layoutPositionLabel} reads of an element */
|
|
175
|
+
type LabelledLayout = Pick<ElementLayout, 'inViewport' | 'percentVisible' | 'hiddenReason' | 'scrollBy' | 'clippedBy' | 'offScreenReason' | 'bounds'>;
|
|
176
|
+
/**
|
|
177
|
+
* Where an element is relative to the viewport, for `bdg dom layout`.
|
|
178
|
+
*
|
|
179
|
+
* @param element - Element layout
|
|
180
|
+
* @param viewport - Viewport size, when known
|
|
181
|
+
* @returns e.g. "visible", "partly visible (40%); scroll down 302px to see all of it",
|
|
182
|
+
* "below fold (scroll down 760px to centre it)",
|
|
183
|
+
* "out of view in ul#list (below)", "hidden (display: none)",
|
|
184
|
+
* "left of viewport (off-screen: beyond the page's scroll range)",
|
|
185
|
+
* "below fold; page scrolling is locked (overflow: hidden on body), likely by dialog div#consent"
|
|
186
|
+
*/
|
|
187
|
+
export declare function layoutPositionLabel(element: LabelledLayout, viewport?: LayoutSize): string;
|
|
188
|
+
/**
|
|
189
|
+
* The `prefers-color-scheme` media feature the page sees, labelled as the
|
|
190
|
+
* preference it is (the page may still render its own theme), and where it
|
|
191
|
+
* comes from.
|
|
192
|
+
*
|
|
193
|
+
* @param scheme - Light or dark
|
|
194
|
+
* @param emulated - Set with `--color-scheme` (otherwise the system setting)
|
|
195
|
+
* @returns e.g. `prefers-color-scheme: dark (from the system setting)`
|
|
196
|
+
*/
|
|
197
|
+
export declare function colorSchemeLabel(scheme: string, emulated: boolean): string;
|
|
198
|
+
/**
|
|
199
|
+
* First line of `bdg status` for a running session.
|
|
200
|
+
*
|
|
201
|
+
* @param page - URL and title of the page, when the session reported them
|
|
202
|
+
* @returns e.g. `Session active: https://example.com/ — Example Domain`
|
|
203
|
+
*/
|
|
204
|
+
export declare function sessionActiveLine(page?: {
|
|
205
|
+
url: string;
|
|
206
|
+
title: string;
|
|
207
|
+
}): string;
|
|
208
|
+
/**
|
|
209
|
+
* Page dimensions line of `bdg dom layout`.
|
|
210
|
+
*
|
|
211
|
+
* @param page - Viewport, scroll position, document size and the color scheme the page is told to prefer
|
|
212
|
+
* @returns e.g. "Page: viewport 1280×720, scrolled to 0,0, document 1280×2400, prefers-color-scheme: dark"
|
|
213
|
+
*/
|
|
214
|
+
export declare function pageLayoutLine(page: PageLayout): string;
|
|
215
|
+
/**
|
|
216
|
+
* Headline of `bdg dom layout`.
|
|
217
|
+
*
|
|
218
|
+
* @param count - Elements matched
|
|
219
|
+
* @param listed - Elements reported (fewer with --index)
|
|
220
|
+
* @param selector - Selector they matched
|
|
221
|
+
* @returns e.g. '3 elements match "button" (page x,y and size in CSS px):',
|
|
222
|
+
* '1 of 3 elements matching "button" (...)'
|
|
223
|
+
*/
|
|
224
|
+
export declare function layoutHeadline(count: number, listed: number, selector: string): string;
|
|
225
|
+
/**
|
|
226
|
+
* Headline of `bdg dom layout` for a cached index.
|
|
227
|
+
*
|
|
228
|
+
* @param target - The index and the list it refers to, in words
|
|
229
|
+
* @returns e.g. `Element at index 0 of the last dom query "h3" (page x,y and size in CSS px):`
|
|
230
|
+
*/
|
|
231
|
+
export declare function indexLayoutHeadline(target: string): string;
|
|
36
232
|
/**
|
|
37
233
|
* Warning when a selector matched several elements and no --index was given.
|
|
38
234
|
*
|
|
@@ -41,14 +237,55 @@ export declare function moreMatchesNote(hidden: number): string;
|
|
|
41
237
|
* @returns Warning text
|
|
42
238
|
*/
|
|
43
239
|
export declare function multipleMatchesWarning(count: number, action: string): string;
|
|
240
|
+
/** Listeners found, by where they are attached */
|
|
241
|
+
export interface ListenerCounts {
|
|
242
|
+
target: number;
|
|
243
|
+
ancestor: number;
|
|
244
|
+
/** On the document and the window */
|
|
245
|
+
global: number;
|
|
246
|
+
}
|
|
44
247
|
/**
|
|
45
|
-
* Headline of `bdg dom listeners
|
|
248
|
+
* Headline of `bdg dom listeners`, saying where the counted listeners are:
|
|
249
|
+
* the list covers the element, its ancestors, its document and window.
|
|
46
250
|
*
|
|
47
251
|
* @param element - Inspected element, e.g. "button#save"
|
|
48
|
-
* @param
|
|
49
|
-
* @
|
|
252
|
+
* @param counts - Listeners found, by placement
|
|
253
|
+
* @param context - Index of the element and the iframe it is in, if any
|
|
254
|
+
* @returns e.g. "Event listeners for button#save (156: 3 on the element, 120 on ancestors, 33 on document and window)"
|
|
50
255
|
*/
|
|
51
|
-
export declare function listenersHeadline(element: string,
|
|
256
|
+
export declare function listenersHeadline(element: string, counts: ListenerCounts, context?: {
|
|
257
|
+
index?: number | undefined;
|
|
258
|
+
frame?: string | undefined;
|
|
259
|
+
}): string;
|
|
260
|
+
/** Heading of the collapsed framework root listeners */
|
|
261
|
+
export declare const COLLAPSED_LISTENERS_HEADING = "Framework roots (one line per node; --all lists each listener):";
|
|
262
|
+
/**
|
|
263
|
+
* One collapsed framework root.
|
|
264
|
+
*
|
|
265
|
+
* @param root - Framework label, event types, phases and dispatcher names
|
|
266
|
+
* @returns e.g. "React root: 90 event types, capture and bubble (dispatchEvent, …)"
|
|
267
|
+
*/
|
|
268
|
+
export declare function collapsedListenersSummary(root: {
|
|
269
|
+
framework?: string | undefined;
|
|
270
|
+
types: string[];
|
|
271
|
+
capture: boolean;
|
|
272
|
+
bubble: boolean;
|
|
273
|
+
handlers: string[];
|
|
274
|
+
}): string;
|
|
275
|
+
/**
|
|
276
|
+
* jQuery handlers left unresolved because there were too many.
|
|
277
|
+
*
|
|
278
|
+
* @param count - Handlers not resolved
|
|
279
|
+
* @returns One-line note
|
|
280
|
+
*/
|
|
281
|
+
export declare function jqueryHandlersSkippedNote(count: number): string;
|
|
282
|
+
/**
|
|
283
|
+
* Event types a mistyped `--type` probably meant.
|
|
284
|
+
*
|
|
285
|
+
* @param types - Suggested types
|
|
286
|
+
* @returns e.g. "Did you mean: --type click?"
|
|
287
|
+
*/
|
|
288
|
+
export declare function eventTypeSuggestion(types: string[]): string;
|
|
52
289
|
/**
|
|
53
290
|
* `bdg dom listeners` found nothing.
|
|
54
291
|
*
|
|
@@ -60,12 +297,19 @@ export declare function noListenersMessage(element: string, types?: string[]): s
|
|
|
60
297
|
/** What `bdg dom listeners` covers, shown when it found nothing */
|
|
61
298
|
export declare const NO_LISTENERS_HINT = "Inline on\u2026 attributes and on\u2026 properties are included, and so are handlers frameworks delegate to ancestors (React, jQuery)";
|
|
62
299
|
/**
|
|
63
|
-
* Note for event types
|
|
300
|
+
* Note for interaction event types the element has no listener of its own for.
|
|
301
|
+
*
|
|
302
|
+
* @param note - How the types reach their handlers
|
|
303
|
+
* @returns One-line note, or undefined when the listed handlers say it all
|
|
304
|
+
*/
|
|
305
|
+
export declare function delegationNote(note: DelegationNote): string | undefined;
|
|
306
|
+
/**
|
|
307
|
+
* React prop handlers left unresolved because there were too many.
|
|
64
308
|
*
|
|
65
|
-
* @param
|
|
309
|
+
* @param count - Handlers not resolved
|
|
66
310
|
* @returns One-line note
|
|
67
311
|
*/
|
|
68
|
-
export declare function
|
|
312
|
+
export declare function reactHandlersSkippedNote(count: number): string;
|
|
69
313
|
/**
|
|
70
314
|
* A JavaScript dialog bdg accepted, as one line.
|
|
71
315
|
*
|
|
@@ -91,18 +335,26 @@ export declare const PAGE_ACTION_DONE: {
|
|
|
91
335
|
readonly forward: "Went forward";
|
|
92
336
|
};
|
|
93
337
|
/** Help text of the `bdg page` history commands */
|
|
338
|
+
/** Description of `bdg page info` */
|
|
339
|
+
export declare const PAGE_INFO_DESCRIPTION = "Show the URL and title of the session page";
|
|
94
340
|
export declare const PAGE_ACTION_DESCRIPTIONS: {
|
|
95
341
|
readonly reload: "Reload the page";
|
|
96
342
|
readonly back: "Go back one page (like the browser button)";
|
|
97
343
|
readonly forward: "Go forward one page (like the browser button)";
|
|
98
344
|
};
|
|
99
345
|
/**
|
|
100
|
-
* `bdg page navigate`
|
|
346
|
+
* `bdg page navigate|reload|back|forward` when the document answered with an
|
|
347
|
+
* error status, or the page then loaded another document that answered
|
|
348
|
+
* differently (a 404 page whose script loads the app).
|
|
101
349
|
*
|
|
102
|
-
* @param status - HTTP status
|
|
103
|
-
* @
|
|
350
|
+
* @param status - HTTP status of the navigation's document
|
|
351
|
+
* @param later - The last document the page loaded afterwards, if any
|
|
352
|
+
* @returns Warning, or undefined when there is nothing to report
|
|
104
353
|
*/
|
|
105
|
-
export declare function
|
|
354
|
+
export declare function documentStatusWarning(status: number, later?: {
|
|
355
|
+
status: number;
|
|
356
|
+
url: string;
|
|
357
|
+
}): string | undefined;
|
|
106
358
|
/**
|
|
107
359
|
* `bdg page navigate` to a URL that loaded no page.
|
|
108
360
|
*
|
|
@@ -116,6 +368,60 @@ export declare function notAPageWarning(): string;
|
|
|
116
368
|
* @returns Warning
|
|
117
369
|
*/
|
|
118
370
|
export declare function stillLoadingWarning(ms: number): string;
|
|
371
|
+
/**
|
|
372
|
+
* Requests still running, the longest-running first, in words.
|
|
373
|
+
*
|
|
374
|
+
* @param pending - The requests to name
|
|
375
|
+
* @param count - All requests still running
|
|
376
|
+
* @returns e.g. `GET …/app.js (pending 30s) and 2 more`
|
|
377
|
+
*/
|
|
378
|
+
export declare function pendingRequestsText(pending: PendingRequestInfo[], count: number): string;
|
|
379
|
+
/**
|
|
380
|
+
* How far a page request got, in words.
|
|
381
|
+
*
|
|
382
|
+
* @param request - The page request
|
|
383
|
+
* @returns e.g. `POST …/authenticate pending for 30s`, `POST …/authenticate returned 503 Service Unavailable`,
|
|
384
|
+
* `POST …/authenticate failed (net::ERR_CONNECTION_REFUSED)`
|
|
385
|
+
*/
|
|
386
|
+
export declare function documentRequestText(request: DocumentRequestState): string;
|
|
387
|
+
/**
|
|
388
|
+
* Start and `bdg page` when the document has not finished loading within
|
|
389
|
+
* the readiness wait: its readyState and the requests it is waiting on.
|
|
390
|
+
*
|
|
391
|
+
* @param state - Loading state of the page
|
|
392
|
+
* @returns Warning, e.g. `The page is still loading (document.readyState: loading); waiting on: GET …/jquery-ui.js (pending 30s)`
|
|
393
|
+
*/
|
|
394
|
+
export declare function pageLoadingWarning(state: PageLoadingState): string;
|
|
395
|
+
/**
|
|
396
|
+
* Help of `dom click`/`submit`: they wait for the network only, so results a
|
|
397
|
+
* page shows later (timers, spinners, animations) are waited for with `dom wait`.
|
|
398
|
+
*/
|
|
399
|
+
export declare const CLICK_RESULT_WAIT_HELP: string;
|
|
400
|
+
/** Examples in the help of `bdg dom wait` */
|
|
401
|
+
export declare const WAIT_HELP_EXAMPLES: string;
|
|
402
|
+
/**
|
|
403
|
+
* The elements `bdg dom wait` waits for.
|
|
404
|
+
*
|
|
405
|
+
* @param condition - What is waited for
|
|
406
|
+
* @returns e.g. `#finish with text "hello world"`
|
|
407
|
+
*/
|
|
408
|
+
export declare function waitTargetLabel(condition: WaitCondition): string;
|
|
409
|
+
/**
|
|
410
|
+
* One-line result of `bdg dom wait`.
|
|
411
|
+
*
|
|
412
|
+
* @param condition - What was waited for
|
|
413
|
+
* @param elapsedMs - How long it took
|
|
414
|
+
* @returns e.g. `✓ div#finish visible after 5.1s`
|
|
415
|
+
*/
|
|
416
|
+
export declare function waitMetMessage(condition: WaitCondition, elapsedMs: number): string;
|
|
417
|
+
/**
|
|
418
|
+
* What the page showed, for a `bdg dom wait` that timed out.
|
|
419
|
+
*
|
|
420
|
+
* @param snapshot - Last thing the page reported
|
|
421
|
+
* @param condition - What was waited for
|
|
422
|
+
* @returns e.g. `2 matches, none visible` or `document.readyState: loading`
|
|
423
|
+
*/
|
|
424
|
+
export declare function waitSnapshotSummary(snapshot: WaitSnapshot, condition: WaitCondition): string;
|
|
119
425
|
/**
|
|
120
426
|
* One line describing an iframe: index, URL, name/id, and how it is isolated.
|
|
121
427
|
*
|
|
@@ -123,12 +429,65 @@ export declare function stillLoadingWarning(ms: number): string;
|
|
|
123
429
|
* @returns e.g. `[1] https://pay.example/ #checkout cross-origin, out-of-process`
|
|
124
430
|
*/
|
|
125
431
|
export declare function frameLabel(frame: DomFrame): string;
|
|
432
|
+
/**
|
|
433
|
+
* A frame URL for human output: shortened, and named when empty.
|
|
434
|
+
*
|
|
435
|
+
* @param url - Frame URL
|
|
436
|
+
* @returns e.g. `https://pay.example/checkout?…`, or `(no URL)`
|
|
437
|
+
*/
|
|
438
|
+
export declare function frameUrlLabel(url: string): string;
|
|
126
439
|
/**
|
|
127
440
|
* `bdg dom frames` on a page without iframes.
|
|
128
441
|
*
|
|
129
442
|
* @returns Message
|
|
130
443
|
*/
|
|
131
444
|
export declare function noFramesMessage(): string;
|
|
445
|
+
/**
|
|
446
|
+
* `bdg dom frames` while the page is still loading: its iframes may not
|
|
447
|
+
* exist yet.
|
|
448
|
+
*
|
|
449
|
+
* @param empty - No iframe was found
|
|
450
|
+
* @returns e.g. `No iframes yet; the page is still loading, so the list may be incomplete (bdg dom wait --load)`
|
|
451
|
+
*/
|
|
452
|
+
export declare function framesStillLoadingNote(empty: boolean): string;
|
|
453
|
+
/**
|
|
454
|
+
* Text of an element in `bdg dom get` output.
|
|
455
|
+
*
|
|
456
|
+
* @param text - Collapsed text, ending in `...` when it was cut
|
|
457
|
+
* @returns e.g. `Text: Welcome to ... (cut at 500 characters; --full shows all of it)`
|
|
458
|
+
*/
|
|
459
|
+
export declare function elementTextLine(text: string): string;
|
|
460
|
+
/**
|
|
461
|
+
* What an element without text holds, in `bdg dom get` output.
|
|
462
|
+
*
|
|
463
|
+
* @param children - First child elements, e.g. `iframe#app`
|
|
464
|
+
* @param count - Number of child elements
|
|
465
|
+
* @returns e.g. `No text; holds 1 element: iframe (see its HTML with --raw)`
|
|
466
|
+
*/
|
|
467
|
+
export declare function emptyElementLine(children: string[], count: number): string;
|
|
468
|
+
/**
|
|
469
|
+
* Note on an element screenshot that captured more than the element's border
|
|
470
|
+
* box, because content (floats, positioned children) overflows it.
|
|
471
|
+
*
|
|
472
|
+
* @param box - Border box
|
|
473
|
+
* @param captured - Area captured
|
|
474
|
+
* @returns e.g. `grown from 940×37 to 940×285 to include content overflowing the element`
|
|
475
|
+
*/
|
|
476
|
+
export declare function screenshotGrownNote(box: {
|
|
477
|
+
width: number;
|
|
478
|
+
height: number;
|
|
479
|
+
}, captured: {
|
|
480
|
+
width: number;
|
|
481
|
+
height: number;
|
|
482
|
+
}): string;
|
|
483
|
+
/**
|
|
484
|
+
* Next commands after `bdg dom query`, by index so they reach matches in
|
|
485
|
+
* shadow roots and iframes too.
|
|
486
|
+
*
|
|
487
|
+
* @param index - Match to use in the examples
|
|
488
|
+
* @returns One line
|
|
489
|
+
*/
|
|
490
|
+
export declare function queryNextSteps(index: number): string;
|
|
132
491
|
/**
|
|
133
492
|
* Header of `bdg dom eval --frame` output naming the frame the script ran in.
|
|
134
493
|
*
|
|
@@ -161,6 +520,13 @@ export declare function sessionOutputRemovedMessage(): string;
|
|
|
161
520
|
* @returns Formatted success message
|
|
162
521
|
*/
|
|
163
522
|
export declare function sessionDirectoryCleanMessage(): string;
|
|
523
|
+
/**
|
|
524
|
+
* `bdg cleanup --purge` deleted a named session's directory.
|
|
525
|
+
*
|
|
526
|
+
* @param dir - Deleted directory
|
|
527
|
+
* @returns Message
|
|
528
|
+
*/
|
|
529
|
+
export declare function sessionDirectoryPurgedMessage(dir: string): string;
|
|
164
530
|
/**
|
|
165
531
|
* Generate no session files found message.
|
|
166
532
|
*
|
|
@@ -174,6 +540,13 @@ export declare function noSessionFilesMessage(): string;
|
|
|
174
540
|
* @returns Formatted error message
|
|
175
541
|
*/
|
|
176
542
|
export declare function sessionStillActiveError(pid: number): string;
|
|
543
|
+
/**
|
|
544
|
+
* How to clean up a session that is still running.
|
|
545
|
+
*
|
|
546
|
+
* @param session - Name of a named session, or null for the default session
|
|
547
|
+
* @returns Suggestion lines
|
|
548
|
+
*/
|
|
549
|
+
export declare function sessionStillActiveSuggestion(session: string | null): string;
|
|
177
550
|
/**
|
|
178
551
|
* Generate help message when no URL is provided to start command.
|
|
179
552
|
*
|
|
@@ -189,4 +562,5 @@ export declare function sessionStillActiveError(pid: number): string;
|
|
|
189
562
|
* @returns Multi-line help message with examples
|
|
190
563
|
* */
|
|
191
564
|
export declare function startCommandHelpMessage(): string;
|
|
565
|
+
export {};
|
|
192
566
|
//# sourceMappingURL=commands.d.ts.map
|