1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 | export interface Command {
|
16 | id: JsUint;
|
17 | }
|
18 | export type CommandData = BrowserCommand | BrowsingContextCommand | InputCommand | NetworkCommand | ScriptCommand | SessionCommand;
|
19 | export interface EmptyParams extends Extensible {
|
20 | }
|
21 | export type Extensible = Record<string, any>;
|
22 | export type JsInt = number;
|
23 | export type JsUint = number;
|
24 | export type SessionCommand = SessionEnd | SessionNew | SessionStatus | SessionSubscribe | SessionUnsubscribe;
|
25 | export interface SessionCapabilitiesRequest {
|
26 | alwaysMatch?: SessionCapabilityRequest;
|
27 | firstMatch?: SessionCapabilityRequest[];
|
28 | }
|
29 | export interface SessionCapabilityRequest extends Extensible {
|
30 | acceptInsecureCerts?: boolean;
|
31 | browserName?: string;
|
32 | browserVersion?: string;
|
33 | platformName?: string;
|
34 | proxy?: {
|
35 | proxyType?: 'pac' | 'direct' | 'autodetect' | 'system' | 'manual';
|
36 | proxyAutoconfigUrl?: string;
|
37 | ftpProxy?: string;
|
38 | httpProxy?: string;
|
39 | noProxy?: string[];
|
40 | sslProxy?: string;
|
41 | socksProxy?: string;
|
42 | socksVersion?: number;
|
43 | };
|
44 | }
|
45 | export interface SessionSubscriptionRequest {
|
46 | events: string[];
|
47 | contexts?: BrowsingContextBrowsingContext[];
|
48 | }
|
49 | export interface SessionStatus extends Command {
|
50 | method: 'session.status';
|
51 | params: EmptyParams;
|
52 | }
|
53 | export interface SessionNew extends Command {
|
54 | method: 'session.new';
|
55 | params: SessionNewParameters;
|
56 | }
|
57 | export interface SessionNewParameters {
|
58 | capabilities: SessionCapabilitiesRequest;
|
59 | }
|
60 | export interface SessionEnd extends Command {
|
61 | method: 'session.end';
|
62 | params: EmptyParams;
|
63 | }
|
64 | export interface SessionSubscribe extends Command {
|
65 | method: 'session.subscribe';
|
66 | params: SessionSubscriptionRequest;
|
67 | }
|
68 | export interface SessionUnsubscribe extends Command {
|
69 | method: 'session.unsubscribe';
|
70 | params: SessionSubscriptionRequest;
|
71 | }
|
72 | export interface BrowserCommand extends BrowserClose {
|
73 | }
|
74 | export interface BrowserClose extends Command {
|
75 | method: 'browser.close';
|
76 | params: EmptyParams;
|
77 | }
|
78 | export type BrowsingContextCommand = BrowsingContextActivate | BrowsingContextCaptureScreenshot | BrowsingContextClose | BrowsingContextCreate | BrowsingContextGetTree | BrowsingContextHandleUserPrompt | BrowsingContextLocateNodes | BrowsingContextNavigate | BrowsingContextPrint | BrowsingContextReload | BrowsingContextSetViewport | BrowsingContextTraverseHistory;
|
79 | export type BrowsingContextBrowsingContext = string;
|
80 | export type BrowsingContextLocator = BrowsingContextCssLocator | BrowsingContextInnerTextLocator | BrowsingContextXPathLocator;
|
81 | export interface BrowsingContextCssLocator {
|
82 | type: 'css';
|
83 | value: string;
|
84 | }
|
85 | export interface BrowsingContextInnerTextLocator {
|
86 | type: 'innerText';
|
87 | value: string;
|
88 | ignoreCase?: boolean;
|
89 | matchType?: 'full' | 'partial';
|
90 | maxDepth?: JsUint;
|
91 | }
|
92 | export interface BrowsingContextXPathLocator {
|
93 | type: 'xpath';
|
94 | value: string;
|
95 | }
|
96 | export type BrowsingContextNavigation = string;
|
97 | export type BrowsingContextReadinessState = 'none' | 'interactive' | 'complete';
|
98 | export interface BrowsingContextActivate extends Command {
|
99 | method: 'browsingContext.activate';
|
100 | params: BrowsingContextActivateParameters;
|
101 | }
|
102 | export interface BrowsingContextActivateParameters {
|
103 | context: BrowsingContextBrowsingContext;
|
104 | }
|
105 | export interface BrowsingContextCaptureScreenshot extends Command {
|
106 | method: 'browsingContext.captureScreenshot';
|
107 | params: BrowsingContextCaptureScreenshotParameters;
|
108 | }
|
109 | export interface BrowsingContextCaptureScreenshotParameters {
|
110 | context: BrowsingContextBrowsingContext;
|
111 | |
112 |
|
113 |
|
114 | origin?: 'viewport' | 'document';
|
115 | format?: BrowsingContextImageFormat;
|
116 | clip?: BrowsingContextClipRectangle;
|
117 | }
|
118 | export interface BrowsingContextImageFormat {
|
119 | type: string;
|
120 | quality?: number;
|
121 | }
|
122 | export type BrowsingContextClipRectangle = BrowsingContextBoxClipRectangle | BrowsingContextElementClipRectangle;
|
123 | export interface BrowsingContextElementClipRectangle {
|
124 | type: 'element';
|
125 | element: ScriptSharedReference;
|
126 | }
|
127 | export interface BrowsingContextBoxClipRectangle {
|
128 | type: 'box';
|
129 | x: number;
|
130 | y: number;
|
131 | width: number;
|
132 | height: number;
|
133 | }
|
134 | export interface BrowsingContextClose extends Command {
|
135 | method: 'browsingContext.close';
|
136 | params: BrowsingContextCloseParameters;
|
137 | }
|
138 | export interface BrowsingContextCloseParameters {
|
139 | context: BrowsingContextBrowsingContext;
|
140 | promptUnload?: boolean;
|
141 | }
|
142 | export interface BrowsingContextCreate extends Command {
|
143 | method: 'browsingContext.create';
|
144 | params: BrowsingContextCreateParameters;
|
145 | }
|
146 | export type BrowsingContextCreateType = 'tab' | 'window';
|
147 | export interface BrowsingContextCreateParameters {
|
148 | type: BrowsingContextCreateType;
|
149 | referenceContext?: BrowsingContextBrowsingContext;
|
150 | background?: boolean;
|
151 | }
|
152 | export interface BrowsingContextGetTree extends Command {
|
153 | method: 'browsingContext.getTree';
|
154 | params: BrowsingContextGetTreeParameters;
|
155 | }
|
156 | export interface BrowsingContextGetTreeParameters {
|
157 | maxDepth?: JsUint;
|
158 | root?: BrowsingContextBrowsingContext;
|
159 | }
|
160 | export interface BrowsingContextHandleUserPrompt extends Command {
|
161 | method: 'browsingContext.handleUserPrompt';
|
162 | params: BrowsingContextHandleUserPromptParameters;
|
163 | }
|
164 | export interface BrowsingContextHandleUserPromptParameters {
|
165 | context: BrowsingContextBrowsingContext;
|
166 | accept?: boolean;
|
167 | userText?: string;
|
168 | }
|
169 | export interface BrowsingContextLocateNodes extends Command {
|
170 | method: 'browsingContext.locateNodes';
|
171 | params: BrowsingContextLocateNodesParameters;
|
172 | }
|
173 | export interface BrowsingContextLocateNodesParameters {
|
174 | context: BrowsingContextBrowsingContext;
|
175 | locator: BrowsingContextLocator;
|
176 | maxNodeCount?: JsUint;
|
177 | ownership?: ScriptResultOwnership;
|
178 | sandbox?: string;
|
179 | serializationOptions?: ScriptSerializationOptions;
|
180 | startNodes?: ScriptSharedReference[];
|
181 | }
|
182 | export interface BrowsingContextNavigate extends Command {
|
183 | method: 'browsingContext.navigate';
|
184 | params: BrowsingContextNavigateParameters;
|
185 | }
|
186 | export interface BrowsingContextNavigateParameters {
|
187 | context: BrowsingContextBrowsingContext;
|
188 | url: string;
|
189 | wait?: BrowsingContextReadinessState;
|
190 | }
|
191 | export interface BrowsingContextPrint extends Command {
|
192 | method: 'browsingContext.print';
|
193 | params: BrowsingContextPrintParameters;
|
194 | }
|
195 | export interface BrowsingContextPrintParameters {
|
196 | context: BrowsingContextBrowsingContext;
|
197 | background?: boolean;
|
198 | margin?: BrowsingContextPrintMarginParameters;
|
199 | |
200 |
|
201 |
|
202 | orientation?: 'portrait' | 'landscape';
|
203 | page?: BrowsingContextPrintPageParameters;
|
204 | pageRanges?: (JsUint | string)[];
|
205 | |
206 |
|
207 |
|
208 | scale?: number;
|
209 | |
210 |
|
211 |
|
212 | shrinkToFit?: boolean;
|
213 | }
|
214 | export interface BrowsingContextPrintMarginParameters {
|
215 | |
216 |
|
217 |
|
218 | bottom?: number;
|
219 | |
220 |
|
221 |
|
222 | left?: number;
|
223 | |
224 |
|
225 |
|
226 | right?: number;
|
227 | |
228 |
|
229 |
|
230 | top?: number;
|
231 | }
|
232 | export interface BrowsingContextPrintPageParameters {
|
233 | |
234 |
|
235 |
|
236 | height?: number;
|
237 | |
238 |
|
239 |
|
240 | width?: number;
|
241 | }
|
242 | export interface BrowsingContextReload extends Command {
|
243 | method: 'browsingContext.reload';
|
244 | params: BrowsingContextReloadParameters;
|
245 | }
|
246 | export interface BrowsingContextReloadParameters {
|
247 | context: BrowsingContextBrowsingContext;
|
248 | ignoreCache?: boolean;
|
249 | wait?: BrowsingContextReadinessState;
|
250 | }
|
251 | export interface BrowsingContextSetViewport extends Command {
|
252 | method: 'browsingContext.setViewport';
|
253 | params: BrowsingContextSetViewportParameters;
|
254 | }
|
255 | export interface BrowsingContextSetViewportParameters {
|
256 | context: BrowsingContextBrowsingContext;
|
257 | viewport?: BrowsingContextViewport | null;
|
258 | devicePixelRatio?: number | null;
|
259 | }
|
260 | export interface BrowsingContextViewport {
|
261 | width: JsUint;
|
262 | height: JsUint;
|
263 | }
|
264 | export interface BrowsingContextTraverseHistory extends Command {
|
265 | method: 'browsingContext.traverseHistory';
|
266 | params: BrowsingContextTraverseHistoryParameters;
|
267 | }
|
268 | export interface BrowsingContextTraverseHistoryParameters {
|
269 | context: BrowsingContextBrowsingContext;
|
270 | delta: JsInt;
|
271 | }
|
272 | export type NetworkCommand = NetworkAddIntercept | NetworkContinueRequest | NetworkContinueResponse | NetworkContinueWithAuth | NetworkFailRequest | NetworkProvideResponse | NetworkRemoveIntercept;
|
273 | export interface NetworkAuthCredentials {
|
274 | type: 'password';
|
275 | username: string;
|
276 | password: string;
|
277 | }
|
278 | export type NetworkBytesValue = NetworkStringValue | NetworkBase64Value;
|
279 | export interface NetworkStringValue {
|
280 | type: 'string';
|
281 | value: string;
|
282 | }
|
283 | export interface NetworkBase64Value {
|
284 | type: 'base64';
|
285 | value: string;
|
286 | }
|
287 | export interface NetworkCookie {
|
288 | name: string;
|
289 | value: NetworkBytesValue;
|
290 | domain: string;
|
291 | path: string;
|
292 | size: JsUint;
|
293 | httpOnly: boolean;
|
294 | secure: boolean;
|
295 | sameSite: 'strict' | 'lax' | 'none';
|
296 | expiry?: JsUint;
|
297 | }
|
298 | export interface NetworkCookieHeader {
|
299 | name: string;
|
300 | value: NetworkBytesValue;
|
301 | }
|
302 | export interface NetworkHeader {
|
303 | name: string;
|
304 | value: NetworkBytesValue;
|
305 | }
|
306 | export type NetworkIntercept = string;
|
307 | export type NetworkRequest = string;
|
308 | export interface NetworkSetCookieHeader {
|
309 | name: string;
|
310 | value: NetworkBytesValue;
|
311 | domain?: string;
|
312 | httpOnly?: boolean;
|
313 | expiry?: string;
|
314 | maxAge?: JsInt;
|
315 | path?: string;
|
316 | sameSite?: 'strict' | 'lax' | 'none';
|
317 | secure?: boolean;
|
318 | }
|
319 | export type NetworkUrlPattern = NetworkUrlPatternPattern | NetworkUrlPatternString;
|
320 | export interface NetworkUrlPatternPattern {
|
321 | type: 'pattern';
|
322 | protocol?: string;
|
323 | hostname?: string;
|
324 | port?: string;
|
325 | pathname?: string;
|
326 | search?: string;
|
327 | }
|
328 | export interface NetworkUrlPatternString {
|
329 | type: 'string';
|
330 | pattern: string;
|
331 | }
|
332 | export interface NetworkAddIntercept extends Command {
|
333 | method: 'network.addIntercept';
|
334 | params: NetworkAddInterceptParameters;
|
335 | }
|
336 | export interface NetworkAddInterceptParameters {
|
337 | phases: NetworkInterceptPhase[];
|
338 | urlPatterns?: NetworkUrlPattern[];
|
339 | }
|
340 | export type NetworkInterceptPhase = 'beforeRequestSent' | 'responseStarted' | 'authRequired';
|
341 | export interface NetworkContinueRequest extends Command {
|
342 | method: 'network.continueRequest';
|
343 | params: NetworkContinueRequestParameters;
|
344 | }
|
345 | export interface NetworkContinueRequestParameters {
|
346 | request: NetworkRequest;
|
347 | body?: NetworkBytesValue;
|
348 | cookies?: NetworkCookieHeader[];
|
349 | headers?: NetworkHeader[];
|
350 | method?: string;
|
351 | url?: string;
|
352 | }
|
353 | export interface NetworkContinueResponse extends Command {
|
354 | method: 'network.continueResponse';
|
355 | params: NetworkContinueResponseParameters;
|
356 | }
|
357 | export interface NetworkContinueResponseParameters {
|
358 | request: NetworkRequest;
|
359 | cookies?: NetworkSetCookieHeader[];
|
360 | credentials?: NetworkAuthCredentials;
|
361 | headers?: NetworkHeader[];
|
362 | reasonPhrase?: string;
|
363 | statusCode?: JsUint;
|
364 | }
|
365 | export interface NetworkContinueWithAuth extends Command {
|
366 | method: 'network.continueWithAuth';
|
367 | params: NetworkContinueWithAuthParameters;
|
368 | }
|
369 | export interface NetworkContinueWithAuthParameters extends NetworkContinueWithAuthCredentials {
|
370 | request: NetworkRequest;
|
371 | }
|
372 | export interface NetworkContinueWithAuthCredentials {
|
373 | action: 'provideCredentials';
|
374 | credentials: NetworkAuthCredentials;
|
375 | }
|
376 | export interface NetworkContinueWithAuthNoCredentials {
|
377 | action: 'default' | 'cancel';
|
378 | }
|
379 | export interface NetworkFailRequest extends Command {
|
380 | method: 'network.failRequest';
|
381 | params: NetworkFailRequestParameters;
|
382 | }
|
383 | export interface NetworkFailRequestParameters {
|
384 | request: NetworkRequest;
|
385 | }
|
386 | export interface NetworkProvideResponse extends Command {
|
387 | method: 'network.provideResponse';
|
388 | params: NetworkProvideResponseParameters;
|
389 | }
|
390 | export interface NetworkProvideResponseParameters {
|
391 | request: NetworkRequest;
|
392 | body?: NetworkBytesValue;
|
393 | cookies?: NetworkSetCookieHeader[];
|
394 | headers?: NetworkHeader[];
|
395 | reasonPhrase?: string;
|
396 | statusCode?: JsUint;
|
397 | }
|
398 | export interface NetworkRemoveIntercept extends Command {
|
399 | method: 'network.removeIntercept';
|
400 | params: NetworkRemoveInterceptParameters;
|
401 | }
|
402 | export interface NetworkRemoveInterceptParameters {
|
403 | intercept: NetworkIntercept;
|
404 | }
|
405 | export type ScriptCommand = ScriptAddPreloadScript | ScriptCallFunction | ScriptDisown | ScriptEvaluate | ScriptGetRealms | ScriptRemovePreloadScript;
|
406 | export type ScriptChannel = string;
|
407 | export interface ScriptChannelValue {
|
408 | type: 'channel';
|
409 | value: ScriptChannelProperties;
|
410 | }
|
411 | export interface ScriptChannelProperties {
|
412 | channel: ScriptChannel;
|
413 | serializationOptions?: ScriptSerializationOptions;
|
414 | ownership?: ScriptResultOwnership;
|
415 | }
|
416 | export type ScriptEvaluateResult = ScriptEvaluateResultSuccess | ScriptEvaluateResultException;
|
417 | export interface ScriptEvaluateResultSuccess {
|
418 | type: 'success';
|
419 | result: ScriptRemoteValue;
|
420 | realm: ScriptRealm;
|
421 | }
|
422 | export interface ScriptEvaluateResultException {
|
423 | type: 'exception';
|
424 | exceptionDetails: ScriptExceptionDetails;
|
425 | realm: ScriptRealm;
|
426 | }
|
427 | export interface ScriptExceptionDetails {
|
428 | columnNumber: JsUint;
|
429 | exception: ScriptRemoteValue;
|
430 | lineNumber: JsUint;
|
431 | stackTrace: ScriptStackTrace;
|
432 | text: string;
|
433 | }
|
434 | export type ScriptHandle = string;
|
435 | export type ScriptInternalId = string;
|
436 | export type ScriptLocalValue = ScriptRemoteReference | ScriptPrimitiveProtocolValue | ScriptChannelValue | ScriptArrayLocalValue | ScriptDateLocalValue | ScriptMapLocalValue | ScriptObjectLocalValue | ScriptRegExpLocalValue | ScriptSetLocalValue;
|
437 | export type ScriptListLocalValue = (ScriptLocalValue)[];
|
438 | export interface ScriptArrayLocalValue {
|
439 | type: 'array';
|
440 | value: ScriptListLocalValue;
|
441 | }
|
442 | export interface ScriptDateLocalValue {
|
443 | type: 'date';
|
444 | value: string;
|
445 | }
|
446 | export type ScriptMappingLocalValue = (ScriptLocalValue | ScriptLocalValue)[];
|
447 | export interface ScriptMapLocalValue {
|
448 | type: 'map';
|
449 | value: ScriptMappingLocalValue;
|
450 | }
|
451 | export interface ScriptObjectLocalValue {
|
452 | type: 'object';
|
453 | value: ScriptMappingLocalValue;
|
454 | }
|
455 | export interface ScriptRegExpValue {
|
456 | pattern: string;
|
457 | flags?: string;
|
458 | }
|
459 | export interface ScriptRegExpLocalValue {
|
460 | type: 'regexp';
|
461 | value: ScriptRegExpValue;
|
462 | }
|
463 | export interface ScriptSetLocalValue {
|
464 | type: 'set';
|
465 | value: ScriptListLocalValue;
|
466 | }
|
467 | export type ScriptPreloadScript = string;
|
468 | export type ScriptRealm = string;
|
469 | export type ScriptPrimitiveProtocolValue = ScriptUndefinedValue | ScriptNullValue | ScriptStringValue | ScriptNumberValue | ScriptBooleanValue | ScriptBigIntValue;
|
470 | export interface ScriptUndefinedValue {
|
471 | type: 'undefined';
|
472 | }
|
473 | export interface ScriptNullValue {
|
474 | type: null;
|
475 | }
|
476 | export interface ScriptStringValue {
|
477 | type: 'string';
|
478 | value: string;
|
479 | }
|
480 | export type ScriptSpecialNumber = 'NaN' | '-0' | 'Infinity' | '-Infinity';
|
481 | export interface ScriptNumberValue {
|
482 | type: 'number';
|
483 | value: Number | ScriptSpecialNumber;
|
484 | }
|
485 | export interface ScriptBooleanValue {
|
486 | type: 'boolean';
|
487 | value: boolean;
|
488 | }
|
489 | export interface ScriptBigIntValue {
|
490 | type: 'bigint';
|
491 | value: string;
|
492 | }
|
493 | export type ScriptRealmType = 'window' | 'dedicated-worker' | 'shared-worker' | 'service-worker' | 'worker' | 'paint-worklet' | 'audio-worklet' | 'worklet';
|
494 | export type ScriptRemoteReference = ScriptSharedReference | ScriptRemoteObjectReference;
|
495 | export interface ScriptSharedReference extends Extensible {
|
496 | sharedId: ScriptSharedId;
|
497 | handle?: ScriptHandle;
|
498 | }
|
499 | export interface ScriptRemoteObjectReference extends Extensible {
|
500 | handle: ScriptHandle;
|
501 | sharedId?: ScriptSharedId;
|
502 | }
|
503 | export type ScriptRemoteValue = ScriptPrimitiveProtocolValue | ScriptSymbolRemoteValue | ScriptArrayRemoteValue | ScriptObjectRemoteValue | ScriptFunctionRemoteValue | ScriptRegExpRemoteValue | ScriptDateRemoteValue | ScriptMapRemoteValue | ScriptSetRemoteValue | ScriptWeakMapRemoteValue | ScriptWeakSetRemoteValue | ScriptIteratorRemoteValue | ScriptGeneratorRemoteValue | ScriptErrorRemoteValue | ScriptProxyRemoteValue | ScriptPromiseRemoteValue | ScriptTypedArrayRemoteValue | ScriptArrayBufferRemoteValue | ScriptNodeListRemoteValue | ScriptHtmlCollectionRemoteValue | ScriptNodeRemoteValue | ScriptWindowProxyRemoteValue;
|
504 | export type ScriptListRemoteValue = (ScriptRemoteValue)[];
|
505 | export type ScriptMappingRemoteValue = (ScriptRemoteValue | ScriptRemoteValue)[];
|
506 | export interface ScriptSymbolRemoteValue {
|
507 | type: 'symbol';
|
508 | handle?: ScriptHandle;
|
509 | internalId?: ScriptInternalId;
|
510 | }
|
511 | export interface ScriptArrayRemoteValue {
|
512 | type: 'array';
|
513 | handle?: ScriptHandle;
|
514 | internalId?: ScriptInternalId;
|
515 | value?: ScriptListRemoteValue;
|
516 | }
|
517 | export interface ScriptObjectRemoteValue {
|
518 | type: 'object';
|
519 | handle?: ScriptHandle;
|
520 | internalId?: ScriptInternalId;
|
521 | value?: ScriptMappingRemoteValue;
|
522 | }
|
523 | export interface ScriptFunctionRemoteValue {
|
524 | type: 'function';
|
525 | handle?: ScriptHandle;
|
526 | internalId?: ScriptInternalId;
|
527 | }
|
528 | export interface ScriptRegExpRemoteValue extends ScriptRegExpLocalValue {
|
529 | handle?: ScriptHandle;
|
530 | internalId?: ScriptInternalId;
|
531 | }
|
532 | export interface ScriptDateRemoteValue extends ScriptDateLocalValue {
|
533 | handle?: ScriptHandle;
|
534 | internalId?: ScriptInternalId;
|
535 | }
|
536 | export interface ScriptMapRemoteValue {
|
537 | type: 'map';
|
538 | handle?: ScriptHandle;
|
539 | internalId?: ScriptInternalId;
|
540 | value?: ScriptMappingRemoteValue;
|
541 | }
|
542 | export interface ScriptSetRemoteValue {
|
543 | type: 'set';
|
544 | handle?: ScriptHandle;
|
545 | internalId?: ScriptInternalId;
|
546 | value?: ScriptListRemoteValue;
|
547 | }
|
548 | export interface ScriptWeakMapRemoteValue {
|
549 | type: 'weakmap';
|
550 | handle?: ScriptHandle;
|
551 | internalId?: ScriptInternalId;
|
552 | }
|
553 | export interface ScriptWeakSetRemoteValue {
|
554 | type: 'weakset';
|
555 | handle?: ScriptHandle;
|
556 | internalId?: ScriptInternalId;
|
557 | }
|
558 | export interface ScriptIteratorRemoteValue {
|
559 | type: 'iterator';
|
560 | handle?: ScriptHandle;
|
561 | internalId?: ScriptInternalId;
|
562 | }
|
563 | export interface ScriptGeneratorRemoteValue {
|
564 | type: 'generator';
|
565 | handle?: ScriptHandle;
|
566 | internalId?: ScriptInternalId;
|
567 | }
|
568 | export interface ScriptErrorRemoteValue {
|
569 | type: 'error';
|
570 | handle?: ScriptHandle;
|
571 | internalId?: ScriptInternalId;
|
572 | }
|
573 | export interface ScriptProxyRemoteValue {
|
574 | type: 'proxy';
|
575 | handle?: ScriptHandle;
|
576 | internalId?: ScriptInternalId;
|
577 | }
|
578 | export interface ScriptPromiseRemoteValue {
|
579 | type: 'promise';
|
580 | handle?: ScriptHandle;
|
581 | internalId?: ScriptInternalId;
|
582 | }
|
583 | export interface ScriptTypedArrayRemoteValue {
|
584 | type: 'typedarray';
|
585 | handle?: ScriptHandle;
|
586 | internalId?: ScriptInternalId;
|
587 | }
|
588 | export interface ScriptArrayBufferRemoteValue {
|
589 | type: 'arraybuffer';
|
590 | handle?: ScriptHandle;
|
591 | internalId?: ScriptInternalId;
|
592 | }
|
593 | export interface ScriptNodeListRemoteValue {
|
594 | type: 'nodelist';
|
595 | handle?: ScriptHandle;
|
596 | internalId?: ScriptInternalId;
|
597 | value?: ScriptListRemoteValue;
|
598 | }
|
599 | export interface ScriptHtmlCollectionRemoteValue {
|
600 | type: 'htmlcollection';
|
601 | handle?: ScriptHandle;
|
602 | internalId?: ScriptInternalId;
|
603 | value?: ScriptListRemoteValue;
|
604 | }
|
605 | export interface ScriptNodeRemoteValue {
|
606 | type: 'node';
|
607 | sharedId?: ScriptSharedId;
|
608 | handle?: ScriptHandle;
|
609 | internalId?: ScriptInternalId;
|
610 | value?: ScriptNodeProperties;
|
611 | }
|
612 | export interface ScriptNodeProperties {
|
613 | nodeType: JsUint;
|
614 | childNodeCount: JsUint;
|
615 | attributes?: Record<string, string>;
|
616 | children?: ScriptNodeRemoteValue[];
|
617 | localName?: string;
|
618 | mode?: 'open' | 'closed';
|
619 | namespaceUri?: string;
|
620 | nodeValue?: string;
|
621 | shadowRoot?: ScriptNodeRemoteValue | null;
|
622 | }
|
623 | export interface ScriptWindowProxyRemoteValue {
|
624 | type: 'window';
|
625 | value: ScriptWindowProxyProperties;
|
626 | handle?: ScriptHandle;
|
627 | internalId?: ScriptInternalId;
|
628 | }
|
629 | export interface ScriptWindowProxyProperties {
|
630 | context: BrowsingContextBrowsingContext;
|
631 | }
|
632 | export type ScriptResultOwnership = 'root' | 'none';
|
633 | export interface ScriptSerializationOptions {
|
634 | maxDomDepth?: JsUint | null;
|
635 | |
636 |
|
637 |
|
638 | maxObjectDepth?: JsUint | null;
|
639 | |
640 |
|
641 |
|
642 | includeShadowTree?: 'none' | 'open' | 'all';
|
643 | }
|
644 | export type ScriptSharedId = string;
|
645 | export interface ScriptStackFrame {
|
646 | columnNumber: JsUint;
|
647 | functionName: string;
|
648 | lineNumber: JsUint;
|
649 | url: string;
|
650 | }
|
651 | export interface ScriptStackTrace {
|
652 | callFrames: ScriptStackFrame[];
|
653 | }
|
654 | export interface ScriptRealmTarget {
|
655 | realm: ScriptRealm;
|
656 | }
|
657 | export interface ScriptContextTarget {
|
658 | context: BrowsingContextBrowsingContext;
|
659 | sandbox?: string;
|
660 | }
|
661 | export type ScriptTarget = ScriptRealmTarget | ScriptContextTarget;
|
662 | export interface ScriptAddPreloadScript extends Command {
|
663 | method: 'script.addPreloadScript';
|
664 | params: ScriptAddPreloadScriptParameters;
|
665 | }
|
666 | export interface ScriptAddPreloadScriptParameters {
|
667 | functionDeclaration: string;
|
668 | arguments?: ScriptChannelValue[];
|
669 | contexts?: BrowsingContextBrowsingContext[];
|
670 | sandbox?: string;
|
671 | }
|
672 | export interface ScriptDisown extends Command {
|
673 | method: 'script.disown';
|
674 | params: ScriptDisownParameters;
|
675 | }
|
676 | export interface ScriptDisownParameters {
|
677 | handles: ScriptHandle[];
|
678 | target: ScriptTarget;
|
679 | }
|
680 | export interface ScriptCallFunction extends Command {
|
681 | method: 'script.callFunction';
|
682 | params: ScriptCallFunctionParameters;
|
683 | }
|
684 | export interface ScriptCallFunctionParameters {
|
685 | functionDeclaration: string;
|
686 | awaitPromise: boolean;
|
687 | target: ScriptTarget;
|
688 | arguments?: ScriptLocalValue[];
|
689 | resultOwnership?: ScriptResultOwnership;
|
690 | serializationOptions?: ScriptSerializationOptions;
|
691 | this?: ScriptLocalValue;
|
692 | userActivation?: boolean;
|
693 | }
|
694 | export interface ScriptEvaluate extends Command {
|
695 | method: 'script.evaluate';
|
696 | params: ScriptEvaluateParameters;
|
697 | }
|
698 | export interface ScriptEvaluateParameters {
|
699 | expression: string;
|
700 | target: ScriptTarget;
|
701 | awaitPromise: boolean;
|
702 | resultOwnership?: ScriptResultOwnership;
|
703 | serializationOptions?: ScriptSerializationOptions;
|
704 | userActivation?: boolean;
|
705 | }
|
706 | export interface ScriptGetRealms extends Command {
|
707 | method: 'script.getRealms';
|
708 | params: ScriptGetRealmsParameters;
|
709 | }
|
710 | export interface ScriptGetRealmsParameters {
|
711 | context?: BrowsingContextBrowsingContext;
|
712 | type?: ScriptRealmType;
|
713 | }
|
714 | export interface ScriptRemovePreloadScript extends Command {
|
715 | method: 'script.removePreloadScript';
|
716 | params: ScriptRemovePreloadScriptParameters;
|
717 | }
|
718 | export interface ScriptRemovePreloadScriptParameters {
|
719 | script: ScriptPreloadScript;
|
720 | }
|
721 | export type InputCommand = InputPerformActions | InputReleaseActions;
|
722 | export interface InputElementOrigin {
|
723 | type: 'element';
|
724 | element: ScriptSharedReference;
|
725 | }
|
726 | export interface InputPerformActions extends Command {
|
727 | method: 'input.performActions';
|
728 | params: InputPerformActionsParameters;
|
729 | }
|
730 | export interface InputPerformActionsParameters {
|
731 | context: BrowsingContextBrowsingContext;
|
732 | actions: InputSourceActions[];
|
733 | }
|
734 | export type InputSourceActions = InputNoneSourceActions | InputKeySourceActions | InputPointerSourceActions | InputWheelSourceActions;
|
735 | export interface InputNoneSourceActions {
|
736 | type: 'none';
|
737 | id: string;
|
738 | actions: InputNoneSourceAction[];
|
739 | }
|
740 | export type InputNoneSourceAction = InputPauseAction;
|
741 | export interface InputKeySourceActions {
|
742 | type: 'key';
|
743 | id: string;
|
744 | actions: InputKeySourceAction[];
|
745 | }
|
746 | export type InputKeySourceAction = InputPauseAction | InputKeyDownAction | InputKeyUpAction;
|
747 | export interface InputPointerSourceActions {
|
748 | type: 'pointer';
|
749 | id: string;
|
750 | parameters?: InputPointerParameters;
|
751 | actions: InputPointerSourceAction[];
|
752 | }
|
753 | export type InputPointerType = 'mouse' | 'pen' | 'touch';
|
754 | export interface InputPointerParameters {
|
755 | |
756 |
|
757 |
|
758 | pointerType?: InputPointerType;
|
759 | }
|
760 | export type InputPointerSourceAction = InputPauseAction | InputPointerDownAction | InputPointerUpAction | InputPointerMoveAction;
|
761 | export interface InputWheelSourceActions {
|
762 | type: 'wheel';
|
763 | id: string;
|
764 | actions: InputWheelSourceAction[];
|
765 | }
|
766 | export type InputWheelSourceAction = InputPauseAction | InputWheelScrollAction;
|
767 | export interface InputPauseAction {
|
768 | type: 'pause';
|
769 | duration?: JsUint;
|
770 | }
|
771 | export interface InputKeyDownAction {
|
772 | type: 'keyDown';
|
773 | value: string;
|
774 | }
|
775 | export interface InputKeyUpAction {
|
776 | type: 'keyUp';
|
777 | value: string;
|
778 | }
|
779 | export interface InputPointerUpAction extends InputPointerCommonProperties {
|
780 | type: 'pointerUp';
|
781 | button: JsUint;
|
782 | }
|
783 | export interface InputPointerDownAction extends InputPointerCommonProperties {
|
784 | type: 'pointerDown';
|
785 | button: JsUint;
|
786 | }
|
787 | export interface InputPointerMoveAction extends InputPointerCommonProperties {
|
788 | type: 'pointerMove';
|
789 | x: JsInt;
|
790 | y: JsInt;
|
791 | duration?: JsUint;
|
792 | origin?: InputOrigin;
|
793 | }
|
794 | export interface InputWheelScrollAction {
|
795 | type: 'scroll';
|
796 | x: JsInt;
|
797 | y: JsInt;
|
798 | deltaX: JsInt;
|
799 | deltaY: JsInt;
|
800 | duration?: JsUint;
|
801 | |
802 |
|
803 |
|
804 | origin?: InputOrigin;
|
805 | }
|
806 | export interface InputPointerCommonProperties {
|
807 | |
808 |
|
809 |
|
810 | width?: JsUint;
|
811 | |
812 |
|
813 |
|
814 | height?: JsUint;
|
815 | pressure?: number;
|
816 | tangentialPressure?: number;
|
817 | |
818 |
|
819 |
|
820 | twist?: number;
|
821 | |
822 |
|
823 |
|
824 | altitudeAngle?: number;
|
825 | azimuthAngle?: number;
|
826 | }
|
827 | export type InputOrigin = 'viewport' | 'pointer' | InputElementOrigin;
|
828 | export interface InputReleaseActions extends Command {
|
829 | method: 'input.releaseActions';
|
830 | params: InputReleaseActionsParameters;
|
831 | }
|
832 | export interface InputReleaseActionsParameters {
|
833 | context: BrowsingContextBrowsingContext;
|
834 | }
|
835 |
|
\ | No newline at end of file |