vendor/github.com/go-rod/rod/lib/proto/runtime.go
1508 lines · 60198 bytes
1// This file is generated by "./lib/proto/generate"
2
3package proto
4
5import (
6 "github.com/ysmood/gson"
7)
8
9/*
10
11Runtime
12
13Runtime domain exposes JavaScript runtime by means of remote evaluation and mirror objects.
14Evaluation results are returned as mirror object that expose object type, string representation
15and unique identifier that can be used for further object reference. Original objects are
16maintained in memory unless they are either explicitly released or are released along with the
17other objects in their object group.
18
19*/
20
21// RuntimeScriptID Unique script identifier.
22type RuntimeScriptID string
23
24// RuntimeSerializationOptionsSerialization enum.
25type RuntimeSerializationOptionsSerialization string
26
27const (
28 // RuntimeSerializationOptionsSerializationDeep enum const.
29 RuntimeSerializationOptionsSerializationDeep RuntimeSerializationOptionsSerialization = "deep"
30
31 // RuntimeSerializationOptionsSerializationJSON enum const.
32 RuntimeSerializationOptionsSerializationJSON RuntimeSerializationOptionsSerialization = "json"
33
34 // RuntimeSerializationOptionsSerializationIDOnly enum const.
35 RuntimeSerializationOptionsSerializationIDOnly RuntimeSerializationOptionsSerialization = "idOnly"
36)
37
38// RuntimeSerializationOptions Represents options for serialization. Overrides `generatePreview` and `returnByValue`.
39type RuntimeSerializationOptions struct {
40 // Serialization ...
41 Serialization RuntimeSerializationOptionsSerialization `json:"serialization"`
42
43 // MaxDepth (optional) Deep serialization depth. Default is full depth. Respected only in `deep` serialization mode.
44 MaxDepth *int `json:"maxDepth,omitempty"`
45
46 // AdditionalParameters (optional) Embedder-specific parameters. For example if connected to V8 in Chrome these control DOM
47 // serialization via `maxNodeDepth: integer` and `includeShadowTree: "none" | "open" | "all"`.
48 // Values can be only of type string or integer.
49 AdditionalParameters map[string]gson.JSON `json:"additionalParameters,omitempty"`
50}
51
52// RuntimeDeepSerializedValueType enum.
53type RuntimeDeepSerializedValueType string
54
55const (
56 // RuntimeDeepSerializedValueTypeUndefined enum const.
57 RuntimeDeepSerializedValueTypeUndefined RuntimeDeepSerializedValueType = "undefined"
58
59 // RuntimeDeepSerializedValueTypeNull enum const.
60 RuntimeDeepSerializedValueTypeNull RuntimeDeepSerializedValueType = "null"
61
62 // RuntimeDeepSerializedValueTypeString enum const.
63 RuntimeDeepSerializedValueTypeString RuntimeDeepSerializedValueType = "string"
64
65 // RuntimeDeepSerializedValueTypeNumber enum const.
66 RuntimeDeepSerializedValueTypeNumber RuntimeDeepSerializedValueType = "number"
67
68 // RuntimeDeepSerializedValueTypeBoolean enum const.
69 RuntimeDeepSerializedValueTypeBoolean RuntimeDeepSerializedValueType = "boolean"
70
71 // RuntimeDeepSerializedValueTypeBigint enum const.
72 RuntimeDeepSerializedValueTypeBigint RuntimeDeepSerializedValueType = "bigint"
73
74 // RuntimeDeepSerializedValueTypeRegexp enum const.
75 RuntimeDeepSerializedValueTypeRegexp RuntimeDeepSerializedValueType = "regexp"
76
77 // RuntimeDeepSerializedValueTypeDate enum const.
78 RuntimeDeepSerializedValueTypeDate RuntimeDeepSerializedValueType = "date"
79
80 // RuntimeDeepSerializedValueTypeSymbol enum const.
81 RuntimeDeepSerializedValueTypeSymbol RuntimeDeepSerializedValueType = "symbol"
82
83 // RuntimeDeepSerializedValueTypeArray enum const.
84 RuntimeDeepSerializedValueTypeArray RuntimeDeepSerializedValueType = "array"
85
86 // RuntimeDeepSerializedValueTypeObject enum const.
87 RuntimeDeepSerializedValueTypeObject RuntimeDeepSerializedValueType = "object"
88
89 // RuntimeDeepSerializedValueTypeFunction enum const.
90 RuntimeDeepSerializedValueTypeFunction RuntimeDeepSerializedValueType = "function"
91
92 // RuntimeDeepSerializedValueTypeMap enum const.
93 RuntimeDeepSerializedValueTypeMap RuntimeDeepSerializedValueType = "map"
94
95 // RuntimeDeepSerializedValueTypeSet enum const.
96 RuntimeDeepSerializedValueTypeSet RuntimeDeepSerializedValueType = "set"
97
98 // RuntimeDeepSerializedValueTypeWeakmap enum const.
99 RuntimeDeepSerializedValueTypeWeakmap RuntimeDeepSerializedValueType = "weakmap"
100
101 // RuntimeDeepSerializedValueTypeWeakset enum const.
102 RuntimeDeepSerializedValueTypeWeakset RuntimeDeepSerializedValueType = "weakset"
103
104 // RuntimeDeepSerializedValueTypeError enum const.
105 RuntimeDeepSerializedValueTypeError RuntimeDeepSerializedValueType = "error"
106
107 // RuntimeDeepSerializedValueTypeProxy enum const.
108 RuntimeDeepSerializedValueTypeProxy RuntimeDeepSerializedValueType = "proxy"
109
110 // RuntimeDeepSerializedValueTypePromise enum const.
111 RuntimeDeepSerializedValueTypePromise RuntimeDeepSerializedValueType = "promise"
112
113 // RuntimeDeepSerializedValueTypeTypedarray enum const.
114 RuntimeDeepSerializedValueTypeTypedarray RuntimeDeepSerializedValueType = "typedarray"
115
116 // RuntimeDeepSerializedValueTypeArraybuffer enum const.
117 RuntimeDeepSerializedValueTypeArraybuffer RuntimeDeepSerializedValueType = "arraybuffer"
118
119 // RuntimeDeepSerializedValueTypeNode enum const.
120 RuntimeDeepSerializedValueTypeNode RuntimeDeepSerializedValueType = "node"
121
122 // RuntimeDeepSerializedValueTypeWindow enum const.
123 RuntimeDeepSerializedValueTypeWindow RuntimeDeepSerializedValueType = "window"
124
125 // RuntimeDeepSerializedValueTypeGenerator enum const.
126 RuntimeDeepSerializedValueTypeGenerator RuntimeDeepSerializedValueType = "generator"
127)
128
129// RuntimeDeepSerializedValue Represents deep serialized value.
130type RuntimeDeepSerializedValue struct {
131 // Type ...
132 Type RuntimeDeepSerializedValueType `json:"type"`
133
134 // Value (optional) ...
135 Value gson.JSON `json:"value,omitempty"`
136
137 // ObjectID (optional) ...
138 ObjectID string `json:"objectId,omitempty"`
139
140 // WeakLocalObjectReference (optional) Set if value reference met more then once during serialization. In such
141 // case, value is provided only to one of the serialized values. Unique
142 // per value in the scope of one CDP call.
143 WeakLocalObjectReference *int `json:"weakLocalObjectReference,omitempty"`
144}
145
146// RuntimeRemoteObjectID Unique object identifier.
147type RuntimeRemoteObjectID string
148
149// RuntimeUnserializableValue Primitive value which cannot be JSON-stringified. Includes values `-0`, `NaN`, `Infinity`,
150// `-Infinity`, and bigint literals.
151type RuntimeUnserializableValue string
152
153// RuntimeRemoteObjectType enum.
154type RuntimeRemoteObjectType string
155
156const (
157 // RuntimeRemoteObjectTypeObject enum const.
158 RuntimeRemoteObjectTypeObject RuntimeRemoteObjectType = "object"
159
160 // RuntimeRemoteObjectTypeFunction enum const.
161 RuntimeRemoteObjectTypeFunction RuntimeRemoteObjectType = "function"
162
163 // RuntimeRemoteObjectTypeUndefined enum const.
164 RuntimeRemoteObjectTypeUndefined RuntimeRemoteObjectType = "undefined"
165
166 // RuntimeRemoteObjectTypeString enum const.
167 RuntimeRemoteObjectTypeString RuntimeRemoteObjectType = "string"
168
169 // RuntimeRemoteObjectTypeNumber enum const.
170 RuntimeRemoteObjectTypeNumber RuntimeRemoteObjectType = "number"
171
172 // RuntimeRemoteObjectTypeBoolean enum const.
173 RuntimeRemoteObjectTypeBoolean RuntimeRemoteObjectType = "boolean"
174
175 // RuntimeRemoteObjectTypeSymbol enum const.
176 RuntimeRemoteObjectTypeSymbol RuntimeRemoteObjectType = "symbol"
177
178 // RuntimeRemoteObjectTypeBigint enum const.
179 RuntimeRemoteObjectTypeBigint RuntimeRemoteObjectType = "bigint"
180)
181
182// RuntimeRemoteObjectSubtype enum.
183type RuntimeRemoteObjectSubtype string
184
185const (
186 // RuntimeRemoteObjectSubtypeArray enum const.
187 RuntimeRemoteObjectSubtypeArray RuntimeRemoteObjectSubtype = "array"
188
189 // RuntimeRemoteObjectSubtypeNull enum const.
190 RuntimeRemoteObjectSubtypeNull RuntimeRemoteObjectSubtype = "null"
191
192 // RuntimeRemoteObjectSubtypeNode enum const.
193 RuntimeRemoteObjectSubtypeNode RuntimeRemoteObjectSubtype = "node"
194
195 // RuntimeRemoteObjectSubtypeRegexp enum const.
196 RuntimeRemoteObjectSubtypeRegexp RuntimeRemoteObjectSubtype = "regexp"
197
198 // RuntimeRemoteObjectSubtypeDate enum const.
199 RuntimeRemoteObjectSubtypeDate RuntimeRemoteObjectSubtype = "date"
200
201 // RuntimeRemoteObjectSubtypeMap enum const.
202 RuntimeRemoteObjectSubtypeMap RuntimeRemoteObjectSubtype = "map"
203
204 // RuntimeRemoteObjectSubtypeSet enum const.
205 RuntimeRemoteObjectSubtypeSet RuntimeRemoteObjectSubtype = "set"
206
207 // RuntimeRemoteObjectSubtypeWeakmap enum const.
208 RuntimeRemoteObjectSubtypeWeakmap RuntimeRemoteObjectSubtype = "weakmap"
209
210 // RuntimeRemoteObjectSubtypeWeakset enum const.
211 RuntimeRemoteObjectSubtypeWeakset RuntimeRemoteObjectSubtype = "weakset"
212
213 // RuntimeRemoteObjectSubtypeIterator enum const.
214 RuntimeRemoteObjectSubtypeIterator RuntimeRemoteObjectSubtype = "iterator"
215
216 // RuntimeRemoteObjectSubtypeGenerator enum const.
217 RuntimeRemoteObjectSubtypeGenerator RuntimeRemoteObjectSubtype = "generator"
218
219 // RuntimeRemoteObjectSubtypeError enum const.
220 RuntimeRemoteObjectSubtypeError RuntimeRemoteObjectSubtype = "error"
221
222 // RuntimeRemoteObjectSubtypeProxy enum const.
223 RuntimeRemoteObjectSubtypeProxy RuntimeRemoteObjectSubtype = "proxy"
224
225 // RuntimeRemoteObjectSubtypePromise enum const.
226 RuntimeRemoteObjectSubtypePromise RuntimeRemoteObjectSubtype = "promise"
227
228 // RuntimeRemoteObjectSubtypeTypedarray enum const.
229 RuntimeRemoteObjectSubtypeTypedarray RuntimeRemoteObjectSubtype = "typedarray"
230
231 // RuntimeRemoteObjectSubtypeArraybuffer enum const.
232 RuntimeRemoteObjectSubtypeArraybuffer RuntimeRemoteObjectSubtype = "arraybuffer"
233
234 // RuntimeRemoteObjectSubtypeDataview enum const.
235 RuntimeRemoteObjectSubtypeDataview RuntimeRemoteObjectSubtype = "dataview"
236
237 // RuntimeRemoteObjectSubtypeWebassemblymemory enum const.
238 RuntimeRemoteObjectSubtypeWebassemblymemory RuntimeRemoteObjectSubtype = "webassemblymemory"
239
240 // RuntimeRemoteObjectSubtypeWasmvalue enum const.
241 RuntimeRemoteObjectSubtypeWasmvalue RuntimeRemoteObjectSubtype = "wasmvalue"
242)
243
244// RuntimeRemoteObject Mirror object referencing original JavaScript object.
245type RuntimeRemoteObject struct {
246 // Type Object type.
247 Type RuntimeRemoteObjectType `json:"type"`
248
249 // Subtype (optional) Object subtype hint. Specified for `object` type values only.
250 // NOTE: If you change anything here, make sure to also update
251 // `subtype` in `ObjectPreview` and `PropertyPreview` below.
252 Subtype RuntimeRemoteObjectSubtype `json:"subtype,omitempty"`
253
254 // ClassName (optional) Object class (constructor) name. Specified for `object` type values only.
255 ClassName string `json:"className,omitempty"`
256
257 // Value (optional) Remote object value in case of primitive values or JSON values (if it was requested).
258 Value gson.JSON `json:"value,omitempty"`
259
260 // UnserializableValue (optional) Primitive value which can not be JSON-stringified does not have `value`, but gets this
261 // property.
262 UnserializableValue RuntimeUnserializableValue `json:"unserializableValue,omitempty"`
263
264 // Description (optional) String representation of the object.
265 Description string `json:"description,omitempty"`
266
267 // DeepSerializedValue (experimental) (optional) Deep serialized value.
268 DeepSerializedValue *RuntimeDeepSerializedValue `json:"deepSerializedValue,omitempty"`
269
270 // ObjectID (optional) Unique object identifier (for non-primitive values).
271 ObjectID RuntimeRemoteObjectID `json:"objectId,omitempty"`
272
273 // Preview (experimental) (optional) Preview containing abbreviated property values. Specified for `object` type values only.
274 Preview *RuntimeObjectPreview `json:"preview,omitempty"`
275
276 // CustomPreview (experimental) (optional) ...
277 CustomPreview *RuntimeCustomPreview `json:"customPreview,omitempty"`
278}
279
280// RuntimeCustomPreview (experimental) ...
281type RuntimeCustomPreview struct {
282 // Header The JSON-stringified result of formatter.header(object, config) call.
283 // It contains json ML array that represents RemoteObject.
284 Header string `json:"header"`
285
286 // BodyGetterID (optional) If formatter returns true as a result of formatter.hasBody call then bodyGetterId will
287 // contain RemoteObjectId for the function that returns result of formatter.body(object, config) call.
288 // The result value is json ML array.
289 BodyGetterID RuntimeRemoteObjectID `json:"bodyGetterId,omitempty"`
290}
291
292// RuntimeObjectPreviewType enum.
293type RuntimeObjectPreviewType string
294
295const (
296 // RuntimeObjectPreviewTypeObject enum const.
297 RuntimeObjectPreviewTypeObject RuntimeObjectPreviewType = "object"
298
299 // RuntimeObjectPreviewTypeFunction enum const.
300 RuntimeObjectPreviewTypeFunction RuntimeObjectPreviewType = "function"
301
302 // RuntimeObjectPreviewTypeUndefined enum const.
303 RuntimeObjectPreviewTypeUndefined RuntimeObjectPreviewType = "undefined"
304
305 // RuntimeObjectPreviewTypeString enum const.
306 RuntimeObjectPreviewTypeString RuntimeObjectPreviewType = "string"
307
308 // RuntimeObjectPreviewTypeNumber enum const.
309 RuntimeObjectPreviewTypeNumber RuntimeObjectPreviewType = "number"
310
311 // RuntimeObjectPreviewTypeBoolean enum const.
312 RuntimeObjectPreviewTypeBoolean RuntimeObjectPreviewType = "boolean"
313
314 // RuntimeObjectPreviewTypeSymbol enum const.
315 RuntimeObjectPreviewTypeSymbol RuntimeObjectPreviewType = "symbol"
316
317 // RuntimeObjectPreviewTypeBigint enum const.
318 RuntimeObjectPreviewTypeBigint RuntimeObjectPreviewType = "bigint"
319)
320
321// RuntimeObjectPreviewSubtype enum.
322type RuntimeObjectPreviewSubtype string
323
324const (
325 // RuntimeObjectPreviewSubtypeArray enum const.
326 RuntimeObjectPreviewSubtypeArray RuntimeObjectPreviewSubtype = "array"
327
328 // RuntimeObjectPreviewSubtypeNull enum const.
329 RuntimeObjectPreviewSubtypeNull RuntimeObjectPreviewSubtype = "null"
330
331 // RuntimeObjectPreviewSubtypeNode enum const.
332 RuntimeObjectPreviewSubtypeNode RuntimeObjectPreviewSubtype = "node"
333
334 // RuntimeObjectPreviewSubtypeRegexp enum const.
335 RuntimeObjectPreviewSubtypeRegexp RuntimeObjectPreviewSubtype = "regexp"
336
337 // RuntimeObjectPreviewSubtypeDate enum const.
338 RuntimeObjectPreviewSubtypeDate RuntimeObjectPreviewSubtype = "date"
339
340 // RuntimeObjectPreviewSubtypeMap enum const.
341 RuntimeObjectPreviewSubtypeMap RuntimeObjectPreviewSubtype = "map"
342
343 // RuntimeObjectPreviewSubtypeSet enum const.
344 RuntimeObjectPreviewSubtypeSet RuntimeObjectPreviewSubtype = "set"
345
346 // RuntimeObjectPreviewSubtypeWeakmap enum const.
347 RuntimeObjectPreviewSubtypeWeakmap RuntimeObjectPreviewSubtype = "weakmap"
348
349 // RuntimeObjectPreviewSubtypeWeakset enum const.
350 RuntimeObjectPreviewSubtypeWeakset RuntimeObjectPreviewSubtype = "weakset"
351
352 // RuntimeObjectPreviewSubtypeIterator enum const.
353 RuntimeObjectPreviewSubtypeIterator RuntimeObjectPreviewSubtype = "iterator"
354
355 // RuntimeObjectPreviewSubtypeGenerator enum const.
356 RuntimeObjectPreviewSubtypeGenerator RuntimeObjectPreviewSubtype = "generator"
357
358 // RuntimeObjectPreviewSubtypeError enum const.
359 RuntimeObjectPreviewSubtypeError RuntimeObjectPreviewSubtype = "error"
360
361 // RuntimeObjectPreviewSubtypeProxy enum const.
362 RuntimeObjectPreviewSubtypeProxy RuntimeObjectPreviewSubtype = "proxy"
363
364 // RuntimeObjectPreviewSubtypePromise enum const.
365 RuntimeObjectPreviewSubtypePromise RuntimeObjectPreviewSubtype = "promise"
366
367 // RuntimeObjectPreviewSubtypeTypedarray enum const.
368 RuntimeObjectPreviewSubtypeTypedarray RuntimeObjectPreviewSubtype = "typedarray"
369
370 // RuntimeObjectPreviewSubtypeArraybuffer enum const.
371 RuntimeObjectPreviewSubtypeArraybuffer RuntimeObjectPreviewSubtype = "arraybuffer"
372
373 // RuntimeObjectPreviewSubtypeDataview enum const.
374 RuntimeObjectPreviewSubtypeDataview RuntimeObjectPreviewSubtype = "dataview"
375
376 // RuntimeObjectPreviewSubtypeWebassemblymemory enum const.
377 RuntimeObjectPreviewSubtypeWebassemblymemory RuntimeObjectPreviewSubtype = "webassemblymemory"
378
379 // RuntimeObjectPreviewSubtypeWasmvalue enum const.
380 RuntimeObjectPreviewSubtypeWasmvalue RuntimeObjectPreviewSubtype = "wasmvalue"
381)
382
383// RuntimeObjectPreview (experimental) Object containing abbreviated remote object value.
384type RuntimeObjectPreview struct {
385 // Type Object type.
386 Type RuntimeObjectPreviewType `json:"type"`
387
388 // Subtype (optional) Object subtype hint. Specified for `object` type values only.
389 Subtype RuntimeObjectPreviewSubtype `json:"subtype,omitempty"`
390
391 // Description (optional) String representation of the object.
392 Description string `json:"description,omitempty"`
393
394 // Overflow True iff some of the properties or entries of the original object did not fit.
395 Overflow bool `json:"overflow"`
396
397 // Properties List of the properties.
398 Properties []*RuntimePropertyPreview `json:"properties"`
399
400 // Entries (optional) List of the entries. Specified for `map` and `set` subtype values only.
401 Entries []*RuntimeEntryPreview `json:"entries,omitempty"`
402}
403
404// RuntimePropertyPreviewType enum.
405type RuntimePropertyPreviewType string
406
407const (
408 // RuntimePropertyPreviewTypeObject enum const.
409 RuntimePropertyPreviewTypeObject RuntimePropertyPreviewType = "object"
410
411 // RuntimePropertyPreviewTypeFunction enum const.
412 RuntimePropertyPreviewTypeFunction RuntimePropertyPreviewType = "function"
413
414 // RuntimePropertyPreviewTypeUndefined enum const.
415 RuntimePropertyPreviewTypeUndefined RuntimePropertyPreviewType = "undefined"
416
417 // RuntimePropertyPreviewTypeString enum const.
418 RuntimePropertyPreviewTypeString RuntimePropertyPreviewType = "string"
419
420 // RuntimePropertyPreviewTypeNumber enum const.
421 RuntimePropertyPreviewTypeNumber RuntimePropertyPreviewType = "number"
422
423 // RuntimePropertyPreviewTypeBoolean enum const.
424 RuntimePropertyPreviewTypeBoolean RuntimePropertyPreviewType = "boolean"
425
426 // RuntimePropertyPreviewTypeSymbol enum const.
427 RuntimePropertyPreviewTypeSymbol RuntimePropertyPreviewType = "symbol"
428
429 // RuntimePropertyPreviewTypeAccessor enum const.
430 RuntimePropertyPreviewTypeAccessor RuntimePropertyPreviewType = "accessor"
431
432 // RuntimePropertyPreviewTypeBigint enum const.
433 RuntimePropertyPreviewTypeBigint RuntimePropertyPreviewType = "bigint"
434)
435
436// RuntimePropertyPreviewSubtype enum.
437type RuntimePropertyPreviewSubtype string
438
439const (
440 // RuntimePropertyPreviewSubtypeArray enum const.
441 RuntimePropertyPreviewSubtypeArray RuntimePropertyPreviewSubtype = "array"
442
443 // RuntimePropertyPreviewSubtypeNull enum const.
444 RuntimePropertyPreviewSubtypeNull RuntimePropertyPreviewSubtype = "null"
445
446 // RuntimePropertyPreviewSubtypeNode enum const.
447 RuntimePropertyPreviewSubtypeNode RuntimePropertyPreviewSubtype = "node"
448
449 // RuntimePropertyPreviewSubtypeRegexp enum const.
450 RuntimePropertyPreviewSubtypeRegexp RuntimePropertyPreviewSubtype = "regexp"
451
452 // RuntimePropertyPreviewSubtypeDate enum const.
453 RuntimePropertyPreviewSubtypeDate RuntimePropertyPreviewSubtype = "date"
454
455 // RuntimePropertyPreviewSubtypeMap enum const.
456 RuntimePropertyPreviewSubtypeMap RuntimePropertyPreviewSubtype = "map"
457
458 // RuntimePropertyPreviewSubtypeSet enum const.
459 RuntimePropertyPreviewSubtypeSet RuntimePropertyPreviewSubtype = "set"
460
461 // RuntimePropertyPreviewSubtypeWeakmap enum const.
462 RuntimePropertyPreviewSubtypeWeakmap RuntimePropertyPreviewSubtype = "weakmap"
463
464 // RuntimePropertyPreviewSubtypeWeakset enum const.
465 RuntimePropertyPreviewSubtypeWeakset RuntimePropertyPreviewSubtype = "weakset"
466
467 // RuntimePropertyPreviewSubtypeIterator enum const.
468 RuntimePropertyPreviewSubtypeIterator RuntimePropertyPreviewSubtype = "iterator"
469
470 // RuntimePropertyPreviewSubtypeGenerator enum const.
471 RuntimePropertyPreviewSubtypeGenerator RuntimePropertyPreviewSubtype = "generator"
472
473 // RuntimePropertyPreviewSubtypeError enum const.
474 RuntimePropertyPreviewSubtypeError RuntimePropertyPreviewSubtype = "error"
475
476 // RuntimePropertyPreviewSubtypeProxy enum const.
477 RuntimePropertyPreviewSubtypeProxy RuntimePropertyPreviewSubtype = "proxy"
478
479 // RuntimePropertyPreviewSubtypePromise enum const.
480 RuntimePropertyPreviewSubtypePromise RuntimePropertyPreviewSubtype = "promise"
481
482 // RuntimePropertyPreviewSubtypeTypedarray enum const.
483 RuntimePropertyPreviewSubtypeTypedarray RuntimePropertyPreviewSubtype = "typedarray"
484
485 // RuntimePropertyPreviewSubtypeArraybuffer enum const.
486 RuntimePropertyPreviewSubtypeArraybuffer RuntimePropertyPreviewSubtype = "arraybuffer"
487
488 // RuntimePropertyPreviewSubtypeDataview enum const.
489 RuntimePropertyPreviewSubtypeDataview RuntimePropertyPreviewSubtype = "dataview"
490
491 // RuntimePropertyPreviewSubtypeWebassemblymemory enum const.
492 RuntimePropertyPreviewSubtypeWebassemblymemory RuntimePropertyPreviewSubtype = "webassemblymemory"
493
494 // RuntimePropertyPreviewSubtypeWasmvalue enum const.
495 RuntimePropertyPreviewSubtypeWasmvalue RuntimePropertyPreviewSubtype = "wasmvalue"
496)
497
498// RuntimePropertyPreview (experimental) ...
499type RuntimePropertyPreview struct {
500 // Name Property name.
501 Name string `json:"name"`
502
503 // Type Object type. Accessor means that the property itself is an accessor property.
504 Type RuntimePropertyPreviewType `json:"type"`
505
506 // Value (optional) User-friendly property value string.
507 Value string `json:"value,omitempty"`
508
509 // ValuePreview (optional) Nested value preview.
510 ValuePreview *RuntimeObjectPreview `json:"valuePreview,omitempty"`
511
512 // Subtype (optional) Object subtype hint. Specified for `object` type values only.
513 Subtype RuntimePropertyPreviewSubtype `json:"subtype,omitempty"`
514}
515
516// RuntimeEntryPreview (experimental) ...
517type RuntimeEntryPreview struct {
518 // Key (optional) Preview of the key. Specified for map-like collection entries.
519 Key *RuntimeObjectPreview `json:"key,omitempty"`
520
521 // Value Preview of the value.
522 Value *RuntimeObjectPreview `json:"value"`
523}
524
525// RuntimePropertyDescriptor Object property descriptor.
526type RuntimePropertyDescriptor struct {
527 // Name Property name or symbol description.
528 Name string `json:"name"`
529
530 // Value (optional) The value associated with the property.
531 Value *RuntimeRemoteObject `json:"value,omitempty"`
532
533 // Writable (optional) True if the value associated with the property may be changed (data descriptors only).
534 Writable bool `json:"writable,omitempty"`
535
536 // Get (optional) A function which serves as a getter for the property, or `undefined` if there is no getter
537 // (accessor descriptors only).
538 Get *RuntimeRemoteObject `json:"get,omitempty"`
539
540 // Set (optional) A function which serves as a setter for the property, or `undefined` if there is no setter
541 // (accessor descriptors only).
542 Set *RuntimeRemoteObject `json:"set,omitempty"`
543
544 // Configurable True if the type of this property descriptor may be changed and if the property may be
545 // deleted from the corresponding object.
546 Configurable bool `json:"configurable"`
547
548 // Enumerable True if this property shows up during enumeration of the properties on the corresponding
549 // object.
550 Enumerable bool `json:"enumerable"`
551
552 // WasThrown (optional) True if the result was thrown during the evaluation.
553 WasThrown bool `json:"wasThrown,omitempty"`
554
555 // IsOwn (optional) True if the property is owned for the object.
556 IsOwn bool `json:"isOwn,omitempty"`
557
558 // Symbol (optional) Property symbol object, if the property is of the `symbol` type.
559 Symbol *RuntimeRemoteObject `json:"symbol,omitempty"`
560}
561
562// RuntimeInternalPropertyDescriptor Object internal property descriptor. This property isn't normally visible in JavaScript code.
563type RuntimeInternalPropertyDescriptor struct {
564 // Name Conventional property name.
565 Name string `json:"name"`
566
567 // Value (optional) The value associated with the property.
568 Value *RuntimeRemoteObject `json:"value,omitempty"`
569}
570
571// RuntimePrivatePropertyDescriptor (experimental) Object private field descriptor.
572type RuntimePrivatePropertyDescriptor struct {
573 // Name Private property name.
574 Name string `json:"name"`
575
576 // Value (optional) The value associated with the private property.
577 Value *RuntimeRemoteObject `json:"value,omitempty"`
578
579 // Get (optional) A function which serves as a getter for the private property,
580 // or `undefined` if there is no getter (accessor descriptors only).
581 Get *RuntimeRemoteObject `json:"get,omitempty"`
582
583 // Set (optional) A function which serves as a setter for the private property,
584 // or `undefined` if there is no setter (accessor descriptors only).
585 Set *RuntimeRemoteObject `json:"set,omitempty"`
586}
587
588// RuntimeCallArgument Represents function call argument. Either remote object id `objectId`, primitive `value`,
589// unserializable primitive value or neither of (for undefined) them should be specified.
590type RuntimeCallArgument struct {
591 // Value (optional) Primitive value or serializable javascript object.
592 Value gson.JSON `json:"value,omitempty"`
593
594 // UnserializableValue (optional) Primitive value which can not be JSON-stringified.
595 UnserializableValue RuntimeUnserializableValue `json:"unserializableValue,omitempty"`
596
597 // ObjectID (optional) Remote object handle.
598 ObjectID RuntimeRemoteObjectID `json:"objectId,omitempty"`
599}
600
601// RuntimeExecutionContextID Id of an execution context.
602type RuntimeExecutionContextID int
603
604// RuntimeExecutionContextDescription Description of an isolated world.
605type RuntimeExecutionContextDescription struct {
606 // ID Unique id of the execution context. It can be used to specify in which execution context
607 // script evaluation should be performed.
608 ID RuntimeExecutionContextID `json:"id"`
609
610 // Origin Execution context origin.
611 Origin string `json:"origin"`
612
613 // Name Human readable name describing given context.
614 Name string `json:"name"`
615
616 // UniqueID (experimental) A system-unique execution context identifier. Unlike the id, this is unique across
617 // multiple processes, so can be reliably used to identify specific context while backend
618 // performs a cross-process navigation.
619 UniqueID string `json:"uniqueId"`
620
621 // AuxData (optional) Embedder-specific auxiliary data likely matching {isDefault: boolean, type: 'default'|'isolated'|'worker', frameId: string}
622 AuxData map[string]gson.JSON `json:"auxData,omitempty"`
623}
624
625// RuntimeExceptionDetails Detailed information about exception (or error) that was thrown during script compilation or
626// execution.
627type RuntimeExceptionDetails struct {
628 // ExceptionID Exception id.
629 ExceptionID int `json:"exceptionId"`
630
631 // Text Exception text, which should be used together with exception object when available.
632 Text string `json:"text"`
633
634 // LineNumber Line number of the exception location (0-based).
635 LineNumber int `json:"lineNumber"`
636
637 // ColumnNumber Column number of the exception location (0-based).
638 ColumnNumber int `json:"columnNumber"`
639
640 // ScriptID (optional) Script ID of the exception location.
641 ScriptID RuntimeScriptID `json:"scriptId,omitempty"`
642
643 // URL (optional) URL of the exception location, to be used when the script was not reported.
644 URL string `json:"url,omitempty"`
645
646 // StackTrace (optional) JavaScript stack trace if available.
647 StackTrace *RuntimeStackTrace `json:"stackTrace,omitempty"`
648
649 // Exception (optional) Exception object if available.
650 Exception *RuntimeRemoteObject `json:"exception,omitempty"`
651
652 // ExecutionContextID (optional) Identifier of the context where exception happened.
653 ExecutionContextID RuntimeExecutionContextID `json:"executionContextId,omitempty"`
654
655 // ExceptionMetaData (experimental) (optional) Dictionary with entries of meta data that the client associated
656 // with this exception, such as information about associated network
657 // requests, etc.
658 ExceptionMetaData map[string]gson.JSON `json:"exceptionMetaData,omitempty"`
659}
660
661// RuntimeTimestamp Number of milliseconds since epoch.
662type RuntimeTimestamp float64
663
664// RuntimeTimeDelta Number of milliseconds.
665type RuntimeTimeDelta float64
666
667// RuntimeCallFrame Stack entry for runtime errors and assertions.
668type RuntimeCallFrame struct {
669 // FunctionName JavaScript function name.
670 FunctionName string `json:"functionName"`
671
672 // ScriptID JavaScript script id.
673 ScriptID RuntimeScriptID `json:"scriptId"`
674
675 // URL JavaScript script name or url.
676 URL string `json:"url"`
677
678 // LineNumber JavaScript script line number (0-based).
679 LineNumber int `json:"lineNumber"`
680
681 // ColumnNumber JavaScript script column number (0-based).
682 ColumnNumber int `json:"columnNumber"`
683}
684
685// RuntimeStackTrace Call frames for assertions or error messages.
686type RuntimeStackTrace struct {
687 // Description (optional) String label of this stack trace. For async traces this may be a name of the function that
688 // initiated the async call.
689 Description string `json:"description,omitempty"`
690
691 // CallFrames JavaScript function name.
692 CallFrames []*RuntimeCallFrame `json:"callFrames"`
693
694 // Parent (optional) Asynchronous JavaScript stack trace that preceded this stack, if available.
695 Parent *RuntimeStackTrace `json:"parent,omitempty"`
696
697 // ParentID (experimental) (optional) Asynchronous JavaScript stack trace that preceded this stack, if available.
698 ParentID *RuntimeStackTraceID `json:"parentId,omitempty"`
699}
700
701// RuntimeUniqueDebuggerID (experimental) Unique identifier of current debugger.
702type RuntimeUniqueDebuggerID string
703
704// RuntimeStackTraceID (experimental) If `debuggerId` is set stack trace comes from another debugger and can be resolved there. This
705// allows to track cross-debugger calls. See `Runtime.StackTrace` and `Debugger.paused` for usages.
706type RuntimeStackTraceID struct {
707 // ID ...
708 ID string `json:"id"`
709
710 // DebuggerID (optional) ...
711 DebuggerID RuntimeUniqueDebuggerID `json:"debuggerId,omitempty"`
712}
713
714// RuntimeAwaitPromise Add handler to promise with given promise object id.
715type RuntimeAwaitPromise struct {
716 // PromiseObjectID Identifier of the promise.
717 PromiseObjectID RuntimeRemoteObjectID `json:"promiseObjectId"`
718
719 // ReturnByValue (optional) Whether the result is expected to be a JSON object that should be sent by value.
720 ReturnByValue bool `json:"returnByValue,omitempty"`
721
722 // GeneratePreview (optional) Whether preview should be generated for the result.
723 GeneratePreview bool `json:"generatePreview,omitempty"`
724}
725
726// ProtoReq name.
727func (m RuntimeAwaitPromise) ProtoReq() string { return "Runtime.awaitPromise" }
728
729// Call the request.
730func (m RuntimeAwaitPromise) Call(c Client) (*RuntimeAwaitPromiseResult, error) {
731 var res RuntimeAwaitPromiseResult
732 return &res, call(m.ProtoReq(), m, &res, c)
733}
734
735// RuntimeAwaitPromiseResult ...
736type RuntimeAwaitPromiseResult struct {
737 // Result Promise result. Will contain rejected value if promise was rejected.
738 Result *RuntimeRemoteObject `json:"result"`
739
740 // ExceptionDetails (optional) Exception details if stack strace is available.
741 ExceptionDetails *RuntimeExceptionDetails `json:"exceptionDetails,omitempty"`
742}
743
744// RuntimeCallFunctionOn Calls function with given declaration on the given object. Object group of the result is
745// inherited from the target object.
746type RuntimeCallFunctionOn struct {
747 // FunctionDeclaration Declaration of the function to call.
748 FunctionDeclaration string `json:"functionDeclaration"`
749
750 // ObjectID (optional) Identifier of the object to call function on. Either objectId or executionContextId should
751 // be specified.
752 ObjectID RuntimeRemoteObjectID `json:"objectId,omitempty"`
753
754 // Arguments (optional) Call arguments. All call arguments must belong to the same JavaScript world as the target
755 // object.
756 Arguments []*RuntimeCallArgument `json:"arguments,omitempty"`
757
758 // Silent (optional) In silent mode exceptions thrown during evaluation are not reported and do not pause
759 // execution. Overrides `setPauseOnException` state.
760 Silent bool `json:"silent,omitempty"`
761
762 // ReturnByValue (optional) Whether the result is expected to be a JSON object which should be sent by value.
763 // Can be overridden by `serializationOptions`.
764 ReturnByValue bool `json:"returnByValue,omitempty"`
765
766 // GeneratePreview (experimental) (optional) Whether preview should be generated for the result.
767 GeneratePreview bool `json:"generatePreview,omitempty"`
768
769 // UserGesture (optional) Whether execution should be treated as initiated by user in the UI.
770 UserGesture bool `json:"userGesture,omitempty"`
771
772 // AwaitPromise (optional) Whether execution should `await` for resulting value and return once awaited promise is
773 // resolved.
774 AwaitPromise bool `json:"awaitPromise,omitempty"`
775
776 // ExecutionContextID (optional) Specifies execution context which global object will be used to call function on. Either
777 // executionContextId or objectId should be specified.
778 ExecutionContextID RuntimeExecutionContextID `json:"executionContextId,omitempty"`
779
780 // ObjectGroup (optional) Symbolic group name that can be used to release multiple objects. If objectGroup is not
781 // specified and objectId is, objectGroup will be inherited from object.
782 ObjectGroup string `json:"objectGroup,omitempty"`
783
784 // ThrowOnSideEffect (experimental) (optional) Whether to throw an exception if side effect cannot be ruled out during evaluation.
785 ThrowOnSideEffect bool `json:"throwOnSideEffect,omitempty"`
786
787 // UniqueContextID (experimental) (optional) An alternative way to specify the execution context to call function on.
788 // Compared to contextId that may be reused across processes, this is guaranteed to be
789 // system-unique, so it can be used to prevent accidental function call
790 // in context different than intended (e.g. as a result of navigation across process
791 // boundaries).
792 // This is mutually exclusive with `executionContextId`.
793 UniqueContextID string `json:"uniqueContextId,omitempty"`
794
795 // SerializationOptions (experimental) (optional) Specifies the result serialization. If provided, overrides
796 // `generatePreview` and `returnByValue`.
797 SerializationOptions *RuntimeSerializationOptions `json:"serializationOptions,omitempty"`
798}
799
800// ProtoReq name.
801func (m RuntimeCallFunctionOn) ProtoReq() string { return "Runtime.callFunctionOn" }
802
803// Call the request.
804func (m RuntimeCallFunctionOn) Call(c Client) (*RuntimeCallFunctionOnResult, error) {
805 var res RuntimeCallFunctionOnResult
806 return &res, call(m.ProtoReq(), m, &res, c)
807}
808
809// RuntimeCallFunctionOnResult ...
810type RuntimeCallFunctionOnResult struct {
811 // Result Call result.
812 Result *RuntimeRemoteObject `json:"result"`
813
814 // ExceptionDetails (optional) Exception details.
815 ExceptionDetails *RuntimeExceptionDetails `json:"exceptionDetails,omitempty"`
816}
817
818// RuntimeCompileScript Compiles expression.
819type RuntimeCompileScript struct {
820 // Expression to compile.
821 Expression string `json:"expression"`
822
823 // SourceURL Source url to be set for the script.
824 SourceURL string `json:"sourceURL"`
825
826 // PersistScript Specifies whether the compiled script should be persisted.
827 PersistScript bool `json:"persistScript"`
828
829 // ExecutionContextID (optional) Specifies in which execution context to perform script run. If the parameter is omitted the
830 // evaluation will be performed in the context of the inspected page.
831 ExecutionContextID RuntimeExecutionContextID `json:"executionContextId,omitempty"`
832}
833
834// ProtoReq name.
835func (m RuntimeCompileScript) ProtoReq() string { return "Runtime.compileScript" }
836
837// Call the request.
838func (m RuntimeCompileScript) Call(c Client) (*RuntimeCompileScriptResult, error) {
839 var res RuntimeCompileScriptResult
840 return &res, call(m.ProtoReq(), m, &res, c)
841}
842
843// RuntimeCompileScriptResult ...
844type RuntimeCompileScriptResult struct {
845 // ScriptID (optional) Id of the script.
846 ScriptID RuntimeScriptID `json:"scriptId,omitempty"`
847
848 // ExceptionDetails (optional) Exception details.
849 ExceptionDetails *RuntimeExceptionDetails `json:"exceptionDetails,omitempty"`
850}
851
852// RuntimeDisable Disables reporting of execution contexts creation.
853type RuntimeDisable struct{}
854
855// ProtoReq name.
856func (m RuntimeDisable) ProtoReq() string { return "Runtime.disable" }
857
858// Call sends the request.
859func (m RuntimeDisable) Call(c Client) error {
860 return call(m.ProtoReq(), m, nil, c)
861}
862
863// RuntimeDiscardConsoleEntries Discards collected exceptions and console API calls.
864type RuntimeDiscardConsoleEntries struct{}
865
866// ProtoReq name.
867func (m RuntimeDiscardConsoleEntries) ProtoReq() string { return "Runtime.discardConsoleEntries" }
868
869// Call sends the request.
870func (m RuntimeDiscardConsoleEntries) Call(c Client) error {
871 return call(m.ProtoReq(), m, nil, c)
872}
873
874// RuntimeEnable Enables reporting of execution contexts creation by means of `executionContextCreated` event.
875// When the reporting gets enabled the event will be sent immediately for each existing execution
876// context.
877type RuntimeEnable struct{}
878
879// ProtoReq name.
880func (m RuntimeEnable) ProtoReq() string { return "Runtime.enable" }
881
882// Call sends the request.
883func (m RuntimeEnable) Call(c Client) error {
884 return call(m.ProtoReq(), m, nil, c)
885}
886
887// RuntimeEvaluate Evaluates expression on global object.
888type RuntimeEvaluate struct {
889 // Expression to evaluate.
890 Expression string `json:"expression"`
891
892 // ObjectGroup (optional) Symbolic group name that can be used to release multiple objects.
893 ObjectGroup string `json:"objectGroup,omitempty"`
894
895 // IncludeCommandLineAPI (optional) Determines whether Command Line API should be available during the evaluation.
896 IncludeCommandLineAPI bool `json:"includeCommandLineAPI,omitempty"`
897
898 // Silent (optional) In silent mode exceptions thrown during evaluation are not reported and do not pause
899 // execution. Overrides `setPauseOnException` state.
900 Silent bool `json:"silent,omitempty"`
901
902 // ContextID (optional) Specifies in which execution context to perform evaluation. If the parameter is omitted the
903 // evaluation will be performed in the context of the inspected page.
904 // This is mutually exclusive with `uniqueContextId`, which offers an
905 // alternative way to identify the execution context that is more reliable
906 // in a multi-process environment.
907 ContextID RuntimeExecutionContextID `json:"contextId,omitempty"`
908
909 // ReturnByValue (optional) Whether the result is expected to be a JSON object that should be sent by value.
910 ReturnByValue bool `json:"returnByValue,omitempty"`
911
912 // GeneratePreview (experimental) (optional) Whether preview should be generated for the result.
913 GeneratePreview bool `json:"generatePreview,omitempty"`
914
915 // UserGesture (optional) Whether execution should be treated as initiated by user in the UI.
916 UserGesture bool `json:"userGesture,omitempty"`
917
918 // AwaitPromise (optional) Whether execution should `await` for resulting value and return once awaited promise is
919 // resolved.
920 AwaitPromise bool `json:"awaitPromise,omitempty"`
921
922 // ThrowOnSideEffect (experimental) (optional) Whether to throw an exception if side effect cannot be ruled out during evaluation.
923 // This implies `disableBreaks` below.
924 ThrowOnSideEffect bool `json:"throwOnSideEffect,omitempty"`
925
926 // Timeout (experimental) (optional) Terminate execution after timing out (number of milliseconds).
927 Timeout RuntimeTimeDelta `json:"timeout,omitempty"`
928
929 // DisableBreaks (experimental) (optional) Disable breakpoints during execution.
930 DisableBreaks bool `json:"disableBreaks,omitempty"`
931
932 // ReplMode (experimental) (optional) Setting this flag to true enables `let` re-declaration and top-level `await`.
933 // Note that `let` variables can only be re-declared if they originate from
934 // `replMode` themselves.
935 ReplMode bool `json:"replMode,omitempty"`
936
937 // AllowUnsafeEvalBlockedByCSP (experimental) (optional) The Content Security Policy (CSP) for the target might block 'unsafe-eval'
938 // which includes eval(), Function(), setTimeout() and setInterval()
939 // when called with non-callable arguments. This flag bypasses CSP for this
940 // evaluation and allows unsafe-eval. Defaults to true.
941 AllowUnsafeEvalBlockedByCSP bool `json:"allowUnsafeEvalBlockedByCSP,omitempty"`
942
943 // UniqueContextID (experimental) (optional) An alternative way to specify the execution context to evaluate in.
944 // Compared to contextId that may be reused across processes, this is guaranteed to be
945 // system-unique, so it can be used to prevent accidental evaluation of the expression
946 // in context different than intended (e.g. as a result of navigation across process
947 // boundaries).
948 // This is mutually exclusive with `contextId`.
949 UniqueContextID string `json:"uniqueContextId,omitempty"`
950
951 // SerializationOptions (experimental) (optional) Specifies the result serialization. If provided, overrides
952 // `generatePreview` and `returnByValue`.
953 SerializationOptions *RuntimeSerializationOptions `json:"serializationOptions,omitempty"`
954}
955
956// ProtoReq name.
957func (m RuntimeEvaluate) ProtoReq() string { return "Runtime.evaluate" }
958
959// Call the request.
960func (m RuntimeEvaluate) Call(c Client) (*RuntimeEvaluateResult, error) {
961 var res RuntimeEvaluateResult
962 return &res, call(m.ProtoReq(), m, &res, c)
963}
964
965// RuntimeEvaluateResult ...
966type RuntimeEvaluateResult struct {
967 // Result Evaluation result.
968 Result *RuntimeRemoteObject `json:"result"`
969
970 // ExceptionDetails (optional) Exception details.
971 ExceptionDetails *RuntimeExceptionDetails `json:"exceptionDetails,omitempty"`
972}
973
974// RuntimeGetIsolateID (experimental) Returns the isolate id.
975type RuntimeGetIsolateID struct{}
976
977// ProtoReq name.
978func (m RuntimeGetIsolateID) ProtoReq() string { return "Runtime.getIsolateId" }
979
980// Call the request.
981func (m RuntimeGetIsolateID) Call(c Client) (*RuntimeGetIsolateIDResult, error) {
982 var res RuntimeGetIsolateIDResult
983 return &res, call(m.ProtoReq(), m, &res, c)
984}
985
986// RuntimeGetIsolateIDResult (experimental) ...
987type RuntimeGetIsolateIDResult struct {
988 // ID The isolate id.
989 ID string `json:"id"`
990}
991
992// RuntimeGetHeapUsage (experimental) Returns the JavaScript heap usage.
993// It is the total usage of the corresponding isolate not scoped to a particular Runtime.
994type RuntimeGetHeapUsage struct{}
995
996// ProtoReq name.
997func (m RuntimeGetHeapUsage) ProtoReq() string { return "Runtime.getHeapUsage" }
998
999// Call the request.
1000func (m RuntimeGetHeapUsage) Call(c Client) (*RuntimeGetHeapUsageResult, error) {
1001 var res RuntimeGetHeapUsageResult
1002 return &res, call(m.ProtoReq(), m, &res, c)
1003}
1004
1005// RuntimeGetHeapUsageResult (experimental) ...
1006type RuntimeGetHeapUsageResult struct {
1007 // UsedSize Used heap size in bytes.
1008 UsedSize float64 `json:"usedSize"`
1009
1010 // TotalSize Allocated heap size in bytes.
1011 TotalSize float64 `json:"totalSize"`
1012}
1013
1014// RuntimeGetProperties Returns properties of a given object. Object group of the result is inherited from the target
1015// object.
1016type RuntimeGetProperties struct {
1017 // ObjectID Identifier of the object to return properties for.
1018 ObjectID RuntimeRemoteObjectID `json:"objectId"`
1019
1020 // OwnProperties (optional) If true, returns properties belonging only to the element itself, not to its prototype
1021 // chain.
1022 OwnProperties bool `json:"ownProperties,omitempty"`
1023
1024 // AccessorPropertiesOnly (experimental) (optional) If true, returns accessor properties (with getter/setter) only; internal properties are not
1025 // returned either.
1026 AccessorPropertiesOnly bool `json:"accessorPropertiesOnly,omitempty"`
1027
1028 // GeneratePreview (experimental) (optional) Whether preview should be generated for the results.
1029 GeneratePreview bool `json:"generatePreview,omitempty"`
1030
1031 // NonIndexedPropertiesOnly (experimental) (optional) If true, returns non-indexed properties only.
1032 NonIndexedPropertiesOnly bool `json:"nonIndexedPropertiesOnly,omitempty"`
1033}
1034
1035// ProtoReq name.
1036func (m RuntimeGetProperties) ProtoReq() string { return "Runtime.getProperties" }
1037
1038// Call the request.
1039func (m RuntimeGetProperties) Call(c Client) (*RuntimeGetPropertiesResult, error) {
1040 var res RuntimeGetPropertiesResult
1041 return &res, call(m.ProtoReq(), m, &res, c)
1042}
1043
1044// RuntimeGetPropertiesResult ...
1045type RuntimeGetPropertiesResult struct {
1046 // Result Object properties.
1047 Result []*RuntimePropertyDescriptor `json:"result"`
1048
1049 // InternalProperties (optional) Internal object properties (only of the element itself).
1050 InternalProperties []*RuntimeInternalPropertyDescriptor `json:"internalProperties,omitempty"`
1051
1052 // PrivateProperties (experimental) (optional) Object private properties.
1053 PrivateProperties []*RuntimePrivatePropertyDescriptor `json:"privateProperties,omitempty"`
1054
1055 // ExceptionDetails (optional) Exception details.
1056 ExceptionDetails *RuntimeExceptionDetails `json:"exceptionDetails,omitempty"`
1057}
1058
1059// RuntimeGlobalLexicalScopeNames Returns all let, const and class variables from global scope.
1060type RuntimeGlobalLexicalScopeNames struct {
1061 // ExecutionContextID (optional) Specifies in which execution context to lookup global scope variables.
1062 ExecutionContextID RuntimeExecutionContextID `json:"executionContextId,omitempty"`
1063}
1064
1065// ProtoReq name.
1066func (m RuntimeGlobalLexicalScopeNames) ProtoReq() string { return "Runtime.globalLexicalScopeNames" }
1067
1068// Call the request.
1069func (m RuntimeGlobalLexicalScopeNames) Call(c Client) (*RuntimeGlobalLexicalScopeNamesResult, error) {
1070 var res RuntimeGlobalLexicalScopeNamesResult
1071 return &res, call(m.ProtoReq(), m, &res, c)
1072}
1073
1074// RuntimeGlobalLexicalScopeNamesResult ...
1075type RuntimeGlobalLexicalScopeNamesResult struct {
1076 // Names ...
1077 Names []string `json:"names"`
1078}
1079
1080// RuntimeQueryObjects ...
1081type RuntimeQueryObjects struct {
1082 // PrototypeObjectID Identifier of the prototype to return objects for.
1083 PrototypeObjectID RuntimeRemoteObjectID `json:"prototypeObjectId"`
1084
1085 // ObjectGroup (optional) Symbolic group name that can be used to release the results.
1086 ObjectGroup string `json:"objectGroup,omitempty"`
1087}
1088
1089// ProtoReq name.
1090func (m RuntimeQueryObjects) ProtoReq() string { return "Runtime.queryObjects" }
1091
1092// Call the request.
1093func (m RuntimeQueryObjects) Call(c Client) (*RuntimeQueryObjectsResult, error) {
1094 var res RuntimeQueryObjectsResult
1095 return &res, call(m.ProtoReq(), m, &res, c)
1096}
1097
1098// RuntimeQueryObjectsResult ...
1099type RuntimeQueryObjectsResult struct {
1100 // Objects Array with objects.
1101 Objects *RuntimeRemoteObject `json:"objects"`
1102}
1103
1104// RuntimeReleaseObject Releases remote object with given id.
1105type RuntimeReleaseObject struct {
1106 // ObjectID Identifier of the object to release.
1107 ObjectID RuntimeRemoteObjectID `json:"objectId"`
1108}
1109
1110// ProtoReq name.
1111func (m RuntimeReleaseObject) ProtoReq() string { return "Runtime.releaseObject" }
1112
1113// Call sends the request.
1114func (m RuntimeReleaseObject) Call(c Client) error {
1115 return call(m.ProtoReq(), m, nil, c)
1116}
1117
1118// RuntimeReleaseObjectGroup Releases all remote objects that belong to a given group.
1119type RuntimeReleaseObjectGroup struct {
1120 // ObjectGroup Symbolic object group name.
1121 ObjectGroup string `json:"objectGroup"`
1122}
1123
1124// ProtoReq name.
1125func (m RuntimeReleaseObjectGroup) ProtoReq() string { return "Runtime.releaseObjectGroup" }
1126
1127// Call sends the request.
1128func (m RuntimeReleaseObjectGroup) Call(c Client) error {
1129 return call(m.ProtoReq(), m, nil, c)
1130}
1131
1132// RuntimeRunIfWaitingForDebugger Tells inspected instance to run if it was waiting for debugger to attach.
1133type RuntimeRunIfWaitingForDebugger struct{}
1134
1135// ProtoReq name.
1136func (m RuntimeRunIfWaitingForDebugger) ProtoReq() string { return "Runtime.runIfWaitingForDebugger" }
1137
1138// Call sends the request.
1139func (m RuntimeRunIfWaitingForDebugger) Call(c Client) error {
1140 return call(m.ProtoReq(), m, nil, c)
1141}
1142
1143// RuntimeRunScript Runs script with given id in a given context.
1144type RuntimeRunScript struct {
1145 // ScriptID Id of the script to run.
1146 ScriptID RuntimeScriptID `json:"scriptId"`
1147
1148 // ExecutionContextID (optional) Specifies in which execution context to perform script run. If the parameter is omitted the
1149 // evaluation will be performed in the context of the inspected page.
1150 ExecutionContextID RuntimeExecutionContextID `json:"executionContextId,omitempty"`
1151
1152 // ObjectGroup (optional) Symbolic group name that can be used to release multiple objects.
1153 ObjectGroup string `json:"objectGroup,omitempty"`
1154
1155 // Silent (optional) In silent mode exceptions thrown during evaluation are not reported and do not pause
1156 // execution. Overrides `setPauseOnException` state.
1157 Silent bool `json:"silent,omitempty"`
1158
1159 // IncludeCommandLineAPI (optional) Determines whether Command Line API should be available during the evaluation.
1160 IncludeCommandLineAPI bool `json:"includeCommandLineAPI,omitempty"`
1161
1162 // ReturnByValue (optional) Whether the result is expected to be a JSON object which should be sent by value.
1163 ReturnByValue bool `json:"returnByValue,omitempty"`
1164
1165 // GeneratePreview (optional) Whether preview should be generated for the result.
1166 GeneratePreview bool `json:"generatePreview,omitempty"`
1167
1168 // AwaitPromise (optional) Whether execution should `await` for resulting value and return once awaited promise is
1169 // resolved.
1170 AwaitPromise bool `json:"awaitPromise,omitempty"`
1171}
1172
1173// ProtoReq name.
1174func (m RuntimeRunScript) ProtoReq() string { return "Runtime.runScript" }
1175
1176// Call the request.
1177func (m RuntimeRunScript) Call(c Client) (*RuntimeRunScriptResult, error) {
1178 var res RuntimeRunScriptResult
1179 return &res, call(m.ProtoReq(), m, &res, c)
1180}
1181
1182// RuntimeRunScriptResult ...
1183type RuntimeRunScriptResult struct {
1184 // Result Run result.
1185 Result *RuntimeRemoteObject `json:"result"`
1186
1187 // ExceptionDetails (optional) Exception details.
1188 ExceptionDetails *RuntimeExceptionDetails `json:"exceptionDetails,omitempty"`
1189}
1190
1191// RuntimeSetAsyncCallStackDepth Enables or disables async call stacks tracking.
1192type RuntimeSetAsyncCallStackDepth struct {
1193 // MaxDepth Maximum depth of async call stacks. Setting to `0` will effectively disable collecting async
1194 // call stacks (default).
1195 MaxDepth int `json:"maxDepth"`
1196}
1197
1198// ProtoReq name.
1199func (m RuntimeSetAsyncCallStackDepth) ProtoReq() string { return "Runtime.setAsyncCallStackDepth" }
1200
1201// Call sends the request.
1202func (m RuntimeSetAsyncCallStackDepth) Call(c Client) error {
1203 return call(m.ProtoReq(), m, nil, c)
1204}
1205
1206// RuntimeSetCustomObjectFormatterEnabled (experimental) ...
1207type RuntimeSetCustomObjectFormatterEnabled struct {
1208 // Enabled ...
1209 Enabled bool `json:"enabled"`
1210}
1211
1212// ProtoReq name.
1213func (m RuntimeSetCustomObjectFormatterEnabled) ProtoReq() string {
1214 return "Runtime.setCustomObjectFormatterEnabled"
1215}
1216
1217// Call sends the request.
1218func (m RuntimeSetCustomObjectFormatterEnabled) Call(c Client) error {
1219 return call(m.ProtoReq(), m, nil, c)
1220}
1221
1222// RuntimeSetMaxCallStackSizeToCapture (experimental) ...
1223type RuntimeSetMaxCallStackSizeToCapture struct {
1224 // Size ...
1225 Size int `json:"size"`
1226}
1227
1228// ProtoReq name.
1229func (m RuntimeSetMaxCallStackSizeToCapture) ProtoReq() string {
1230 return "Runtime.setMaxCallStackSizeToCapture"
1231}
1232
1233// Call sends the request.
1234func (m RuntimeSetMaxCallStackSizeToCapture) Call(c Client) error {
1235 return call(m.ProtoReq(), m, nil, c)
1236}
1237
1238// RuntimeTerminateExecution (experimental) Terminate current or next JavaScript execution.
1239// Will cancel the termination when the outer-most script execution ends.
1240type RuntimeTerminateExecution struct{}
1241
1242// ProtoReq name.
1243func (m RuntimeTerminateExecution) ProtoReq() string { return "Runtime.terminateExecution" }
1244
1245// Call sends the request.
1246func (m RuntimeTerminateExecution) Call(c Client) error {
1247 return call(m.ProtoReq(), m, nil, c)
1248}
1249
1250// RuntimeAddBinding If executionContextId is empty, adds binding with the given name on the
1251// global objects of all inspected contexts, including those created later,
1252// bindings survive reloads.
1253// Binding function takes exactly one argument, this argument should be string,
1254// in case of any other input, function throws an exception.
1255// Each binding function call produces Runtime.bindingCalled notification.
1256type RuntimeAddBinding struct {
1257 // Name ...
1258 Name string `json:"name"`
1259
1260 // ExecutionContextID (deprecated) (experimental) (optional) If specified, the binding would only be exposed to the specified
1261 // execution context. If omitted and `executionContextName` is not set,
1262 // the binding is exposed to all execution contexts of the target.
1263 // This parameter is mutually exclusive with `executionContextName`.
1264 // Deprecated in favor of `executionContextName` due to an unclear use case
1265 // and bugs in implementation (crbug.com/1169639). `executionContextId` will be
1266 // removed in the future.
1267 ExecutionContextID RuntimeExecutionContextID `json:"executionContextId,omitempty"`
1268
1269 // ExecutionContextName (optional) If specified, the binding is exposed to the executionContext with
1270 // matching name, even for contexts created after the binding is added.
1271 // See also `ExecutionContext.name` and `worldName` parameter to
1272 // `Page.addScriptToEvaluateOnNewDocument`.
1273 // This parameter is mutually exclusive with `executionContextId`.
1274 ExecutionContextName string `json:"executionContextName,omitempty"`
1275}
1276
1277// ProtoReq name.
1278func (m RuntimeAddBinding) ProtoReq() string { return "Runtime.addBinding" }
1279
1280// Call sends the request.
1281func (m RuntimeAddBinding) Call(c Client) error {
1282 return call(m.ProtoReq(), m, nil, c)
1283}
1284
1285// RuntimeRemoveBinding This method does not remove binding function from global object but
1286// unsubscribes current runtime agent from Runtime.bindingCalled notifications.
1287type RuntimeRemoveBinding struct {
1288 // Name ...
1289 Name string `json:"name"`
1290}
1291
1292// ProtoReq name.
1293func (m RuntimeRemoveBinding) ProtoReq() string { return "Runtime.removeBinding" }
1294
1295// Call sends the request.
1296func (m RuntimeRemoveBinding) Call(c Client) error {
1297 return call(m.ProtoReq(), m, nil, c)
1298}
1299
1300// RuntimeGetExceptionDetails (experimental) This method tries to lookup and populate exception details for a
1301// JavaScript Error object.
1302// Note that the stackTrace portion of the resulting exceptionDetails will
1303// only be populated if the Runtime domain was enabled at the time when the
1304// Error was thrown.
1305type RuntimeGetExceptionDetails struct {
1306 // ErrorObjectID The error object for which to resolve the exception details.
1307 ErrorObjectID RuntimeRemoteObjectID `json:"errorObjectId"`
1308}
1309
1310// ProtoReq name.
1311func (m RuntimeGetExceptionDetails) ProtoReq() string { return "Runtime.getExceptionDetails" }
1312
1313// Call the request.
1314func (m RuntimeGetExceptionDetails) Call(c Client) (*RuntimeGetExceptionDetailsResult, error) {
1315 var res RuntimeGetExceptionDetailsResult
1316 return &res, call(m.ProtoReq(), m, &res, c)
1317}
1318
1319// RuntimeGetExceptionDetailsResult (experimental) ...
1320type RuntimeGetExceptionDetailsResult struct {
1321 // ExceptionDetails (optional) ...
1322 ExceptionDetails *RuntimeExceptionDetails `json:"exceptionDetails,omitempty"`
1323}
1324
1325// RuntimeBindingCalled (experimental) Notification is issued every time when binding is called.
1326type RuntimeBindingCalled struct {
1327 // Name ...
1328 Name string `json:"name"`
1329
1330 // Payload ...
1331 Payload string `json:"payload"`
1332
1333 // ExecutionContextID Identifier of the context where the call was made.
1334 ExecutionContextID RuntimeExecutionContextID `json:"executionContextId"`
1335}
1336
1337// ProtoEvent name.
1338func (evt RuntimeBindingCalled) ProtoEvent() string {
1339 return "Runtime.bindingCalled"
1340}
1341
1342// RuntimeConsoleAPICalledType enum.
1343type RuntimeConsoleAPICalledType string
1344
1345const (
1346 // RuntimeConsoleAPICalledTypeLog enum const.
1347 RuntimeConsoleAPICalledTypeLog RuntimeConsoleAPICalledType = "log"
1348
1349 // RuntimeConsoleAPICalledTypeDebug enum const.
1350 RuntimeConsoleAPICalledTypeDebug RuntimeConsoleAPICalledType = "debug"
1351
1352 // RuntimeConsoleAPICalledTypeInfo enum const.
1353 RuntimeConsoleAPICalledTypeInfo RuntimeConsoleAPICalledType = "info"
1354
1355 // RuntimeConsoleAPICalledTypeError enum const.
1356 RuntimeConsoleAPICalledTypeError RuntimeConsoleAPICalledType = "error"
1357
1358 // RuntimeConsoleAPICalledTypeWarning enum const.
1359 RuntimeConsoleAPICalledTypeWarning RuntimeConsoleAPICalledType = "warning"
1360
1361 // RuntimeConsoleAPICalledTypeDir enum const.
1362 RuntimeConsoleAPICalledTypeDir RuntimeConsoleAPICalledType = "dir"
1363
1364 // RuntimeConsoleAPICalledTypeDirxml enum const.
1365 RuntimeConsoleAPICalledTypeDirxml RuntimeConsoleAPICalledType = "dirxml"
1366
1367 // RuntimeConsoleAPICalledTypeTable enum const.
1368 RuntimeConsoleAPICalledTypeTable RuntimeConsoleAPICalledType = "table"
1369
1370 // RuntimeConsoleAPICalledTypeTrace enum const.
1371 RuntimeConsoleAPICalledTypeTrace RuntimeConsoleAPICalledType = "trace"
1372
1373 // RuntimeConsoleAPICalledTypeClear enum const.
1374 RuntimeConsoleAPICalledTypeClear RuntimeConsoleAPICalledType = "clear"
1375
1376 // RuntimeConsoleAPICalledTypeStartGroup enum const.
1377 RuntimeConsoleAPICalledTypeStartGroup RuntimeConsoleAPICalledType = "startGroup"
1378
1379 // RuntimeConsoleAPICalledTypeStartGroupCollapsed enum const.
1380 RuntimeConsoleAPICalledTypeStartGroupCollapsed RuntimeConsoleAPICalledType = "startGroupCollapsed"
1381
1382 // RuntimeConsoleAPICalledTypeEndGroup enum const.
1383 RuntimeConsoleAPICalledTypeEndGroup RuntimeConsoleAPICalledType = "endGroup"
1384
1385 // RuntimeConsoleAPICalledTypeAssert enum const.
1386 RuntimeConsoleAPICalledTypeAssert RuntimeConsoleAPICalledType = "assert"
1387
1388 // RuntimeConsoleAPICalledTypeProfile enum const.
1389 RuntimeConsoleAPICalledTypeProfile RuntimeConsoleAPICalledType = "profile"
1390
1391 // RuntimeConsoleAPICalledTypeProfileEnd enum const.
1392 RuntimeConsoleAPICalledTypeProfileEnd RuntimeConsoleAPICalledType = "profileEnd"
1393
1394 // RuntimeConsoleAPICalledTypeCount enum const.
1395 RuntimeConsoleAPICalledTypeCount RuntimeConsoleAPICalledType = "count"
1396
1397 // RuntimeConsoleAPICalledTypeTimeEnd enum const.
1398 RuntimeConsoleAPICalledTypeTimeEnd RuntimeConsoleAPICalledType = "timeEnd"
1399)
1400
1401// RuntimeConsoleAPICalled Issued when console API was called.
1402type RuntimeConsoleAPICalled struct {
1403 // Type of the call.
1404 Type RuntimeConsoleAPICalledType `json:"type"`
1405
1406 // Args Call arguments.
1407 Args []*RuntimeRemoteObject `json:"args"`
1408
1409 // ExecutionContextID Identifier of the context where the call was made.
1410 ExecutionContextID RuntimeExecutionContextID `json:"executionContextId"`
1411
1412 // Timestamp Call timestamp.
1413 Timestamp RuntimeTimestamp `json:"timestamp"`
1414
1415 // StackTrace (optional) Stack trace captured when the call was made. The async stack chain is automatically reported for
1416 // the following call types: `assert`, `error`, `trace`, `warning`. For other types the async call
1417 // chain can be retrieved using `Debugger.getStackTrace` and `stackTrace.parentId` field.
1418 StackTrace *RuntimeStackTrace `json:"stackTrace,omitempty"`
1419
1420 // Context (experimental) (optional) Console context descriptor for calls on non-default console context (not console.*):
1421 // 'anonymous#unique-logger-id' for call on unnamed context, 'name#unique-logger-id' for call
1422 // on named context.
1423 Context string `json:"context,omitempty"`
1424}
1425
1426// ProtoEvent name.
1427func (evt RuntimeConsoleAPICalled) ProtoEvent() string {
1428 return "Runtime.consoleAPICalled"
1429}
1430
1431// RuntimeExceptionRevoked Issued when unhandled exception was revoked.
1432type RuntimeExceptionRevoked struct {
1433 // Reason describing why exception was revoked.
1434 Reason string `json:"reason"`
1435
1436 // ExceptionID The id of revoked exception, as reported in `exceptionThrown`.
1437 ExceptionID int `json:"exceptionId"`
1438}
1439
1440// ProtoEvent name.
1441func (evt RuntimeExceptionRevoked) ProtoEvent() string {
1442 return "Runtime.exceptionRevoked"
1443}
1444
1445// RuntimeExceptionThrown Issued when exception was thrown and unhandled.
1446type RuntimeExceptionThrown struct {
1447 // Timestamp of the exception.
1448 Timestamp RuntimeTimestamp `json:"timestamp"`
1449
1450 // ExceptionDetails ...
1451 ExceptionDetails *RuntimeExceptionDetails `json:"exceptionDetails"`
1452}
1453
1454// ProtoEvent name.
1455func (evt RuntimeExceptionThrown) ProtoEvent() string {
1456 return "Runtime.exceptionThrown"
1457}
1458
1459// RuntimeExecutionContextCreated Issued when new execution context is created.
1460type RuntimeExecutionContextCreated struct {
1461 // Context A newly created execution context.
1462 Context *RuntimeExecutionContextDescription `json:"context"`
1463}
1464
1465// ProtoEvent name.
1466func (evt RuntimeExecutionContextCreated) ProtoEvent() string {
1467 return "Runtime.executionContextCreated"
1468}
1469
1470// RuntimeExecutionContextDestroyed Issued when execution context is destroyed.
1471type RuntimeExecutionContextDestroyed struct {
1472 // ExecutionContextID (deprecated) Id of the destroyed context
1473 ExecutionContextID RuntimeExecutionContextID `json:"executionContextId"`
1474
1475 // ExecutionContextUniqueID (experimental) Unique Id of the destroyed context
1476 ExecutionContextUniqueID string `json:"executionContextUniqueId"`
1477}
1478
1479// ProtoEvent name.
1480func (evt RuntimeExecutionContextDestroyed) ProtoEvent() string {
1481 return "Runtime.executionContextDestroyed"
1482}
1483
1484// RuntimeExecutionContextsCleared Issued when all executionContexts were cleared in browser.
1485type RuntimeExecutionContextsCleared struct{}
1486
1487// ProtoEvent name.
1488func (evt RuntimeExecutionContextsCleared) ProtoEvent() string {
1489 return "Runtime.executionContextsCleared"
1490}
1491
1492// RuntimeInspectRequested Issued when object should be inspected (for example, as a result of inspect() command line API
1493// call).
1494type RuntimeInspectRequested struct {
1495 // Object ...
1496 Object *RuntimeRemoteObject `json:"object"`
1497
1498 // Hints ...
1499 Hints map[string]gson.JSON `json:"hints"`
1500
1501 // ExecutionContextID (experimental) (optional) Identifier of the context where the call was made.
1502 ExecutionContextID RuntimeExecutionContextID `json:"executionContextId,omitempty"`
1503}
1504
1505// ProtoEvent name.
1506func (evt RuntimeInspectRequested) ProtoEvent() string {
1507 return "Runtime.inspectRequested"
1508}