-
Notifications
You must be signed in to change notification settings - Fork 0
/
runtime.go
1518 lines (1091 loc) · 56 KB
/
runtime.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// This file is generated by "./lib/proto/generate"
package proto
import (
"github.com/ysmood/gson"
)
/*
Runtime
Runtime domain exposes JavaScript runtime by means of remote evaluation and mirror objects.
Evaluation results are returned as mirror object that expose object type, string representation
and unique identifier that can be used for further object reference. Original objects are
maintained in memory unless they are either explicitly released or are released along with the
other objects in their object group.
*/
// RuntimeScriptID Unique script identifier.
type RuntimeScriptID string
// RuntimeWebDriverValueType enum
type RuntimeWebDriverValueType string
const (
// RuntimeWebDriverValueTypeUndefined enum const
RuntimeWebDriverValueTypeUndefined RuntimeWebDriverValueType = "undefined"
// RuntimeWebDriverValueTypeNull enum const
RuntimeWebDriverValueTypeNull RuntimeWebDriverValueType = "null"
// RuntimeWebDriverValueTypeString enum const
RuntimeWebDriverValueTypeString RuntimeWebDriverValueType = "string"
// RuntimeWebDriverValueTypeNumber enum const
RuntimeWebDriverValueTypeNumber RuntimeWebDriverValueType = "number"
// RuntimeWebDriverValueTypeBoolean enum const
RuntimeWebDriverValueTypeBoolean RuntimeWebDriverValueType = "boolean"
// RuntimeWebDriverValueTypeBigint enum const
RuntimeWebDriverValueTypeBigint RuntimeWebDriverValueType = "bigint"
// RuntimeWebDriverValueTypeRegexp enum const
RuntimeWebDriverValueTypeRegexp RuntimeWebDriverValueType = "regexp"
// RuntimeWebDriverValueTypeDate enum const
RuntimeWebDriverValueTypeDate RuntimeWebDriverValueType = "date"
// RuntimeWebDriverValueTypeSymbol enum const
RuntimeWebDriverValueTypeSymbol RuntimeWebDriverValueType = "symbol"
// RuntimeWebDriverValueTypeArray enum const
RuntimeWebDriverValueTypeArray RuntimeWebDriverValueType = "array"
// RuntimeWebDriverValueTypeObject enum const
RuntimeWebDriverValueTypeObject RuntimeWebDriverValueType = "object"
// RuntimeWebDriverValueTypeFunction enum const
RuntimeWebDriverValueTypeFunction RuntimeWebDriverValueType = "function"
// RuntimeWebDriverValueTypeMap enum const
RuntimeWebDriverValueTypeMap RuntimeWebDriverValueType = "map"
// RuntimeWebDriverValueTypeSet enum const
RuntimeWebDriverValueTypeSet RuntimeWebDriverValueType = "set"
// RuntimeWebDriverValueTypeWeakmap enum const
RuntimeWebDriverValueTypeWeakmap RuntimeWebDriverValueType = "weakmap"
// RuntimeWebDriverValueTypeWeakset enum const
RuntimeWebDriverValueTypeWeakset RuntimeWebDriverValueType = "weakset"
// RuntimeWebDriverValueTypeError enum const
RuntimeWebDriverValueTypeError RuntimeWebDriverValueType = "error"
// RuntimeWebDriverValueTypeProxy enum const
RuntimeWebDriverValueTypeProxy RuntimeWebDriverValueType = "proxy"
// RuntimeWebDriverValueTypePromise enum const
RuntimeWebDriverValueTypePromise RuntimeWebDriverValueType = "promise"
// RuntimeWebDriverValueTypeTypedarray enum const
RuntimeWebDriverValueTypeTypedarray RuntimeWebDriverValueType = "typedarray"
// RuntimeWebDriverValueTypeArraybuffer enum const
RuntimeWebDriverValueTypeArraybuffer RuntimeWebDriverValueType = "arraybuffer"
// RuntimeWebDriverValueTypeNode enum const
RuntimeWebDriverValueTypeNode RuntimeWebDriverValueType = "node"
// RuntimeWebDriverValueTypeWindow enum const
RuntimeWebDriverValueTypeWindow RuntimeWebDriverValueType = "window"
)
// RuntimeWebDriverValue Represents the value serialiazed by the WebDriver BiDi specification
// https://w3c.github.io/webdriver-bidi.
type RuntimeWebDriverValue struct {
// Type ...
Type RuntimeWebDriverValueType `json:"type"`
// Value (optional) ...
Value gson.JSON `json:"value,omitempty"`
// ObjectID (optional) ...
ObjectID string `json:"objectId,omitempty"`
}
// RuntimeRemoteObjectID Unique object identifier.
type RuntimeRemoteObjectID string
// RuntimeUnserializableValue Primitive value which cannot be JSON-stringified. Includes values `-0`, `NaN`, `Infinity`,
// `-Infinity`, and bigint literals.
type RuntimeUnserializableValue string
// RuntimeRemoteObjectType enum
type RuntimeRemoteObjectType string
const (
// RuntimeRemoteObjectTypeObject enum const
RuntimeRemoteObjectTypeObject RuntimeRemoteObjectType = "object"
// RuntimeRemoteObjectTypeFunction enum const
RuntimeRemoteObjectTypeFunction RuntimeRemoteObjectType = "function"
// RuntimeRemoteObjectTypeUndefined enum const
RuntimeRemoteObjectTypeUndefined RuntimeRemoteObjectType = "undefined"
// RuntimeRemoteObjectTypeString enum const
RuntimeRemoteObjectTypeString RuntimeRemoteObjectType = "string"
// RuntimeRemoteObjectTypeNumber enum const
RuntimeRemoteObjectTypeNumber RuntimeRemoteObjectType = "number"
// RuntimeRemoteObjectTypeBoolean enum const
RuntimeRemoteObjectTypeBoolean RuntimeRemoteObjectType = "boolean"
// RuntimeRemoteObjectTypeSymbol enum const
RuntimeRemoteObjectTypeSymbol RuntimeRemoteObjectType = "symbol"
// RuntimeRemoteObjectTypeBigint enum const
RuntimeRemoteObjectTypeBigint RuntimeRemoteObjectType = "bigint"
)
// RuntimeRemoteObjectSubtype enum
type RuntimeRemoteObjectSubtype string
const (
// RuntimeRemoteObjectSubtypeArray enum const
RuntimeRemoteObjectSubtypeArray RuntimeRemoteObjectSubtype = "array"
// RuntimeRemoteObjectSubtypeNull enum const
RuntimeRemoteObjectSubtypeNull RuntimeRemoteObjectSubtype = "null"
// RuntimeRemoteObjectSubtypeNode enum const
RuntimeRemoteObjectSubtypeNode RuntimeRemoteObjectSubtype = "node"
// RuntimeRemoteObjectSubtypeRegexp enum const
RuntimeRemoteObjectSubtypeRegexp RuntimeRemoteObjectSubtype = "regexp"
// RuntimeRemoteObjectSubtypeDate enum const
RuntimeRemoteObjectSubtypeDate RuntimeRemoteObjectSubtype = "date"
// RuntimeRemoteObjectSubtypeMap enum const
RuntimeRemoteObjectSubtypeMap RuntimeRemoteObjectSubtype = "map"
// RuntimeRemoteObjectSubtypeSet enum const
RuntimeRemoteObjectSubtypeSet RuntimeRemoteObjectSubtype = "set"
// RuntimeRemoteObjectSubtypeWeakmap enum const
RuntimeRemoteObjectSubtypeWeakmap RuntimeRemoteObjectSubtype = "weakmap"
// RuntimeRemoteObjectSubtypeWeakset enum const
RuntimeRemoteObjectSubtypeWeakset RuntimeRemoteObjectSubtype = "weakset"
// RuntimeRemoteObjectSubtypeIterator enum const
RuntimeRemoteObjectSubtypeIterator RuntimeRemoteObjectSubtype = "iterator"
// RuntimeRemoteObjectSubtypeGenerator enum const
RuntimeRemoteObjectSubtypeGenerator RuntimeRemoteObjectSubtype = "generator"
// RuntimeRemoteObjectSubtypeError enum const
RuntimeRemoteObjectSubtypeError RuntimeRemoteObjectSubtype = "error"
// RuntimeRemoteObjectSubtypeProxy enum const
RuntimeRemoteObjectSubtypeProxy RuntimeRemoteObjectSubtype = "proxy"
// RuntimeRemoteObjectSubtypePromise enum const
RuntimeRemoteObjectSubtypePromise RuntimeRemoteObjectSubtype = "promise"
// RuntimeRemoteObjectSubtypeTypedarray enum const
RuntimeRemoteObjectSubtypeTypedarray RuntimeRemoteObjectSubtype = "typedarray"
// RuntimeRemoteObjectSubtypeArraybuffer enum const
RuntimeRemoteObjectSubtypeArraybuffer RuntimeRemoteObjectSubtype = "arraybuffer"
// RuntimeRemoteObjectSubtypeDataview enum const
RuntimeRemoteObjectSubtypeDataview RuntimeRemoteObjectSubtype = "dataview"
// RuntimeRemoteObjectSubtypeWebassemblymemory enum const
RuntimeRemoteObjectSubtypeWebassemblymemory RuntimeRemoteObjectSubtype = "webassemblymemory"
// RuntimeRemoteObjectSubtypeWasmvalue enum const
RuntimeRemoteObjectSubtypeWasmvalue RuntimeRemoteObjectSubtype = "wasmvalue"
)
// RuntimeRemoteObject Mirror object referencing original JavaScript object.
type RuntimeRemoteObject struct {
// Type Object type.
Type RuntimeRemoteObjectType `json:"type"`
// Subtype (optional) Object subtype hint. Specified for `object` type values only.
// NOTE: If you change anything here, make sure to also update
// `subtype` in `ObjectPreview` and `PropertyPreview` below.
Subtype RuntimeRemoteObjectSubtype `json:"subtype,omitempty"`
// ClassName (optional) Object class (constructor) name. Specified for `object` type values only.
ClassName string `json:"className,omitempty"`
// Value (optional) Remote object value in case of primitive values or JSON values (if it was requested).
Value gson.JSON `json:"value,omitempty"`
// UnserializableValue (optional) Primitive value which can not be JSON-stringified does not have `value`, but gets this
// property.
UnserializableValue RuntimeUnserializableValue `json:"unserializableValue,omitempty"`
// Description (optional) String representation of the object.
Description string `json:"description,omitempty"`
// WebDriverValue (experimental) (optional) WebDriver BiDi representation of the value.
WebDriverValue *RuntimeWebDriverValue `json:"webDriverValue,omitempty"`
// ObjectID (optional) Unique object identifier (for non-primitive values).
ObjectID RuntimeRemoteObjectID `json:"objectId,omitempty"`
// Preview (experimental) (optional) Preview containing abbreviated property values. Specified for `object` type values only.
Preview *RuntimeObjectPreview `json:"preview,omitempty"`
// CustomPreview (experimental) (optional) ...
CustomPreview *RuntimeCustomPreview `json:"customPreview,omitempty"`
}
// RuntimeCustomPreview (experimental) ...
type RuntimeCustomPreview struct {
// Header The JSON-stringified result of formatter.header(object, config) call.
// It contains json ML array that represents RemoteObject.
Header string `json:"header"`
// BodyGetterID (optional) If formatter returns true as a result of formatter.hasBody call then bodyGetterId will
// contain RemoteObjectId for the function that returns result of formatter.body(object, config) call.
// The result value is json ML array.
BodyGetterID RuntimeRemoteObjectID `json:"bodyGetterId,omitempty"`
}
// RuntimeObjectPreviewType enum
type RuntimeObjectPreviewType string
const (
// RuntimeObjectPreviewTypeObject enum const
RuntimeObjectPreviewTypeObject RuntimeObjectPreviewType = "object"
// RuntimeObjectPreviewTypeFunction enum const
RuntimeObjectPreviewTypeFunction RuntimeObjectPreviewType = "function"
// RuntimeObjectPreviewTypeUndefined enum const
RuntimeObjectPreviewTypeUndefined RuntimeObjectPreviewType = "undefined"
// RuntimeObjectPreviewTypeString enum const
RuntimeObjectPreviewTypeString RuntimeObjectPreviewType = "string"
// RuntimeObjectPreviewTypeNumber enum const
RuntimeObjectPreviewTypeNumber RuntimeObjectPreviewType = "number"
// RuntimeObjectPreviewTypeBoolean enum const
RuntimeObjectPreviewTypeBoolean RuntimeObjectPreviewType = "boolean"
// RuntimeObjectPreviewTypeSymbol enum const
RuntimeObjectPreviewTypeSymbol RuntimeObjectPreviewType = "symbol"
// RuntimeObjectPreviewTypeBigint enum const
RuntimeObjectPreviewTypeBigint RuntimeObjectPreviewType = "bigint"
)
// RuntimeObjectPreviewSubtype enum
type RuntimeObjectPreviewSubtype string
const (
// RuntimeObjectPreviewSubtypeArray enum const
RuntimeObjectPreviewSubtypeArray RuntimeObjectPreviewSubtype = "array"
// RuntimeObjectPreviewSubtypeNull enum const
RuntimeObjectPreviewSubtypeNull RuntimeObjectPreviewSubtype = "null"
// RuntimeObjectPreviewSubtypeNode enum const
RuntimeObjectPreviewSubtypeNode RuntimeObjectPreviewSubtype = "node"
// RuntimeObjectPreviewSubtypeRegexp enum const
RuntimeObjectPreviewSubtypeRegexp RuntimeObjectPreviewSubtype = "regexp"
// RuntimeObjectPreviewSubtypeDate enum const
RuntimeObjectPreviewSubtypeDate RuntimeObjectPreviewSubtype = "date"
// RuntimeObjectPreviewSubtypeMap enum const
RuntimeObjectPreviewSubtypeMap RuntimeObjectPreviewSubtype = "map"
// RuntimeObjectPreviewSubtypeSet enum const
RuntimeObjectPreviewSubtypeSet RuntimeObjectPreviewSubtype = "set"
// RuntimeObjectPreviewSubtypeWeakmap enum const
RuntimeObjectPreviewSubtypeWeakmap RuntimeObjectPreviewSubtype = "weakmap"
// RuntimeObjectPreviewSubtypeWeakset enum const
RuntimeObjectPreviewSubtypeWeakset RuntimeObjectPreviewSubtype = "weakset"
// RuntimeObjectPreviewSubtypeIterator enum const
RuntimeObjectPreviewSubtypeIterator RuntimeObjectPreviewSubtype = "iterator"
// RuntimeObjectPreviewSubtypeGenerator enum const
RuntimeObjectPreviewSubtypeGenerator RuntimeObjectPreviewSubtype = "generator"
// RuntimeObjectPreviewSubtypeError enum const
RuntimeObjectPreviewSubtypeError RuntimeObjectPreviewSubtype = "error"
// RuntimeObjectPreviewSubtypeProxy enum const
RuntimeObjectPreviewSubtypeProxy RuntimeObjectPreviewSubtype = "proxy"
// RuntimeObjectPreviewSubtypePromise enum const
RuntimeObjectPreviewSubtypePromise RuntimeObjectPreviewSubtype = "promise"
// RuntimeObjectPreviewSubtypeTypedarray enum const
RuntimeObjectPreviewSubtypeTypedarray RuntimeObjectPreviewSubtype = "typedarray"
// RuntimeObjectPreviewSubtypeArraybuffer enum const
RuntimeObjectPreviewSubtypeArraybuffer RuntimeObjectPreviewSubtype = "arraybuffer"
// RuntimeObjectPreviewSubtypeDataview enum const
RuntimeObjectPreviewSubtypeDataview RuntimeObjectPreviewSubtype = "dataview"
// RuntimeObjectPreviewSubtypeWebassemblymemory enum const
RuntimeObjectPreviewSubtypeWebassemblymemory RuntimeObjectPreviewSubtype = "webassemblymemory"
// RuntimeObjectPreviewSubtypeWasmvalue enum const
RuntimeObjectPreviewSubtypeWasmvalue RuntimeObjectPreviewSubtype = "wasmvalue"
)
// RuntimeObjectPreview (experimental) Object containing abbreviated remote object value.
type RuntimeObjectPreview struct {
// Type Object type.
Type RuntimeObjectPreviewType `json:"type"`
// Subtype (optional) Object subtype hint. Specified for `object` type values only.
Subtype RuntimeObjectPreviewSubtype `json:"subtype,omitempty"`
// Description (optional) String representation of the object.
Description string `json:"description,omitempty"`
// Overflow True iff some of the properties or entries of the original object did not fit.
Overflow bool `json:"overflow"`
// Properties List of the properties.
Properties []*RuntimePropertyPreview `json:"properties"`
// Entries (optional) List of the entries. Specified for `map` and `set` subtype values only.
Entries []*RuntimeEntryPreview `json:"entries,omitempty"`
}
// RuntimePropertyPreviewType enum
type RuntimePropertyPreviewType string
const (
// RuntimePropertyPreviewTypeObject enum const
RuntimePropertyPreviewTypeObject RuntimePropertyPreviewType = "object"
// RuntimePropertyPreviewTypeFunction enum const
RuntimePropertyPreviewTypeFunction RuntimePropertyPreviewType = "function"
// RuntimePropertyPreviewTypeUndefined enum const
RuntimePropertyPreviewTypeUndefined RuntimePropertyPreviewType = "undefined"
// RuntimePropertyPreviewTypeString enum const
RuntimePropertyPreviewTypeString RuntimePropertyPreviewType = "string"
// RuntimePropertyPreviewTypeNumber enum const
RuntimePropertyPreviewTypeNumber RuntimePropertyPreviewType = "number"
// RuntimePropertyPreviewTypeBoolean enum const
RuntimePropertyPreviewTypeBoolean RuntimePropertyPreviewType = "boolean"
// RuntimePropertyPreviewTypeSymbol enum const
RuntimePropertyPreviewTypeSymbol RuntimePropertyPreviewType = "symbol"
// RuntimePropertyPreviewTypeAccessor enum const
RuntimePropertyPreviewTypeAccessor RuntimePropertyPreviewType = "accessor"
// RuntimePropertyPreviewTypeBigint enum const
RuntimePropertyPreviewTypeBigint RuntimePropertyPreviewType = "bigint"
)
// RuntimePropertyPreviewSubtype enum
type RuntimePropertyPreviewSubtype string
const (
// RuntimePropertyPreviewSubtypeArray enum const
RuntimePropertyPreviewSubtypeArray RuntimePropertyPreviewSubtype = "array"
// RuntimePropertyPreviewSubtypeNull enum const
RuntimePropertyPreviewSubtypeNull RuntimePropertyPreviewSubtype = "null"
// RuntimePropertyPreviewSubtypeNode enum const
RuntimePropertyPreviewSubtypeNode RuntimePropertyPreviewSubtype = "node"
// RuntimePropertyPreviewSubtypeRegexp enum const
RuntimePropertyPreviewSubtypeRegexp RuntimePropertyPreviewSubtype = "regexp"
// RuntimePropertyPreviewSubtypeDate enum const
RuntimePropertyPreviewSubtypeDate RuntimePropertyPreviewSubtype = "date"
// RuntimePropertyPreviewSubtypeMap enum const
RuntimePropertyPreviewSubtypeMap RuntimePropertyPreviewSubtype = "map"
// RuntimePropertyPreviewSubtypeSet enum const
RuntimePropertyPreviewSubtypeSet RuntimePropertyPreviewSubtype = "set"
// RuntimePropertyPreviewSubtypeWeakmap enum const
RuntimePropertyPreviewSubtypeWeakmap RuntimePropertyPreviewSubtype = "weakmap"
// RuntimePropertyPreviewSubtypeWeakset enum const
RuntimePropertyPreviewSubtypeWeakset RuntimePropertyPreviewSubtype = "weakset"
// RuntimePropertyPreviewSubtypeIterator enum const
RuntimePropertyPreviewSubtypeIterator RuntimePropertyPreviewSubtype = "iterator"
// RuntimePropertyPreviewSubtypeGenerator enum const
RuntimePropertyPreviewSubtypeGenerator RuntimePropertyPreviewSubtype = "generator"
// RuntimePropertyPreviewSubtypeError enum const
RuntimePropertyPreviewSubtypeError RuntimePropertyPreviewSubtype = "error"
// RuntimePropertyPreviewSubtypeProxy enum const
RuntimePropertyPreviewSubtypeProxy RuntimePropertyPreviewSubtype = "proxy"
// RuntimePropertyPreviewSubtypePromise enum const
RuntimePropertyPreviewSubtypePromise RuntimePropertyPreviewSubtype = "promise"
// RuntimePropertyPreviewSubtypeTypedarray enum const
RuntimePropertyPreviewSubtypeTypedarray RuntimePropertyPreviewSubtype = "typedarray"
// RuntimePropertyPreviewSubtypeArraybuffer enum const
RuntimePropertyPreviewSubtypeArraybuffer RuntimePropertyPreviewSubtype = "arraybuffer"
// RuntimePropertyPreviewSubtypeDataview enum const
RuntimePropertyPreviewSubtypeDataview RuntimePropertyPreviewSubtype = "dataview"
// RuntimePropertyPreviewSubtypeWebassemblymemory enum const
RuntimePropertyPreviewSubtypeWebassemblymemory RuntimePropertyPreviewSubtype = "webassemblymemory"
// RuntimePropertyPreviewSubtypeWasmvalue enum const
RuntimePropertyPreviewSubtypeWasmvalue RuntimePropertyPreviewSubtype = "wasmvalue"
)
// RuntimePropertyPreview (experimental) ...
type RuntimePropertyPreview struct {
// Name Property name.
Name string `json:"name"`
// Type Object type. Accessor means that the property itself is an accessor property.
Type RuntimePropertyPreviewType `json:"type"`
// Value (optional) User-friendly property value string.
Value string `json:"value,omitempty"`
// ValuePreview (optional) Nested value preview.
ValuePreview *RuntimeObjectPreview `json:"valuePreview,omitempty"`
// Subtype (optional) Object subtype hint. Specified for `object` type values only.
Subtype RuntimePropertyPreviewSubtype `json:"subtype,omitempty"`
}
// RuntimeEntryPreview (experimental) ...
type RuntimeEntryPreview struct {
// Key (optional) Preview of the key. Specified for map-like collection entries.
Key *RuntimeObjectPreview `json:"key,omitempty"`
// Value Preview of the value.
Value *RuntimeObjectPreview `json:"value"`
}
// RuntimePropertyDescriptor Object property descriptor.
type RuntimePropertyDescriptor struct {
// Name Property name or symbol description.
Name string `json:"name"`
// Value (optional) The value associated with the property.
Value *RuntimeRemoteObject `json:"value,omitempty"`
// Writable (optional) True if the value associated with the property may be changed (data descriptors only).
Writable bool `json:"writable,omitempty"`
// Get (optional) A function which serves as a getter for the property, or `undefined` if there is no getter
// (accessor descriptors only).
Get *RuntimeRemoteObject `json:"get,omitempty"`
// Set (optional) A function which serves as a setter for the property, or `undefined` if there is no setter
// (accessor descriptors only).
Set *RuntimeRemoteObject `json:"set,omitempty"`
// Configurable True if the type of this property descriptor may be changed and if the property may be
// deleted from the corresponding object.
Configurable bool `json:"configurable"`
// Enumerable True if this property shows up during enumeration of the properties on the corresponding
// object.
Enumerable bool `json:"enumerable"`
// WasThrown (optional) True if the result was thrown during the evaluation.
WasThrown bool `json:"wasThrown,omitempty"`
// IsOwn (optional) True if the property is owned for the object.
IsOwn bool `json:"isOwn,omitempty"`
// Symbol (optional) Property symbol object, if the property is of the `symbol` type.
Symbol *RuntimeRemoteObject `json:"symbol,omitempty"`
}
// RuntimeInternalPropertyDescriptor Object internal property descriptor. This property isn't normally visible in JavaScript code.
type RuntimeInternalPropertyDescriptor struct {
// Name Conventional property name.
Name string `json:"name"`
// Value (optional) The value associated with the property.
Value *RuntimeRemoteObject `json:"value,omitempty"`
}
// RuntimePrivatePropertyDescriptor (experimental) Object private field descriptor.
type RuntimePrivatePropertyDescriptor struct {
// Name Private property name.
Name string `json:"name"`
// Value (optional) The value associated with the private property.
Value *RuntimeRemoteObject `json:"value,omitempty"`
// Get (optional) A function which serves as a getter for the private property,
// or `undefined` if there is no getter (accessor descriptors only).
Get *RuntimeRemoteObject `json:"get,omitempty"`
// Set (optional) A function which serves as a setter for the private property,
// or `undefined` if there is no setter (accessor descriptors only).
Set *RuntimeRemoteObject `json:"set,omitempty"`
}
// RuntimeCallArgument Represents function call argument. Either remote object id `objectId`, primitive `value`,
// unserializable primitive value or neither of (for undefined) them should be specified.
type RuntimeCallArgument struct {
// Value (optional) Primitive value or serializable javascript object.
Value gson.JSON `json:"value,omitempty"`
// UnserializableValue (optional) Primitive value which can not be JSON-stringified.
UnserializableValue RuntimeUnserializableValue `json:"unserializableValue,omitempty"`
// ObjectID (optional) Remote object handle.
ObjectID RuntimeRemoteObjectID `json:"objectId,omitempty"`
}
// RuntimeExecutionContextID Id of an execution context.
type RuntimeExecutionContextID int
// RuntimeExecutionContextDescription Description of an isolated world.
type RuntimeExecutionContextDescription struct {
// ID Unique id of the execution context. It can be used to specify in which execution context
// script evaluation should be performed.
ID RuntimeExecutionContextID `json:"id"`
// Origin Execution context origin.
Origin string `json:"origin"`
// Name Human readable name describing given context.
Name string `json:"name"`
// UniqueID (experimental) A system-unique execution context identifier. Unlike the id, this is unique across
// multiple processes, so can be reliably used to identify specific context while backend
// performs a cross-process navigation.
UniqueID string `json:"uniqueId"`
// AuxData (optional) Embedder-specific auxiliary data.
AuxData map[string]gson.JSON `json:"auxData,omitempty"`
}
// RuntimeExceptionDetails Detailed information about exception (or error) that was thrown during script compilation or
// execution.
type RuntimeExceptionDetails struct {
// ExceptionID Exception id.
ExceptionID int `json:"exceptionId"`
// Text Exception text, which should be used together with exception object when available.
Text string `json:"text"`
// LineNumber Line number of the exception location (0-based).
LineNumber int `json:"lineNumber"`
// ColumnNumber Column number of the exception location (0-based).
ColumnNumber int `json:"columnNumber"`
// ScriptID (optional) Script ID of the exception location.
ScriptID RuntimeScriptID `json:"scriptId,omitempty"`
// URL (optional) URL of the exception location, to be used when the script was not reported.
URL string `json:"url,omitempty"`
// StackTrace (optional) JavaScript stack trace if available.
StackTrace *RuntimeStackTrace `json:"stackTrace,omitempty"`
// Exception (optional) Exception object if available.
Exception *RuntimeRemoteObject `json:"exception,omitempty"`
// ExecutionContextID (optional) Identifier of the context where exception happened.
ExecutionContextID RuntimeExecutionContextID `json:"executionContextId,omitempty"`
// ExceptionMetaData (experimental) (optional) Dictionary with entries of meta data that the client associated
// with this exception, such as information about associated network
// requests, etc.
ExceptionMetaData map[string]gson.JSON `json:"exceptionMetaData,omitempty"`
}
// RuntimeTimestamp Number of milliseconds since epoch.
type RuntimeTimestamp float64
// RuntimeTimeDelta Number of milliseconds.
type RuntimeTimeDelta float64
// RuntimeCallFrame Stack entry for runtime errors and assertions.
type RuntimeCallFrame struct {
// FunctionName JavaScript function name.
FunctionName string `json:"functionName"`
// ScriptID JavaScript script id.
ScriptID RuntimeScriptID `json:"scriptId"`
// URL JavaScript script name or url.
URL string `json:"url"`
// LineNumber JavaScript script line number (0-based).
LineNumber int `json:"lineNumber"`
// ColumnNumber JavaScript script column number (0-based).
ColumnNumber int `json:"columnNumber"`
}
// RuntimeStackTrace Call frames for assertions or error messages.
type RuntimeStackTrace struct {
// Description (optional) String label of this stack trace. For async traces this may be a name of the function that
// initiated the async call.
Description string `json:"description,omitempty"`
// CallFrames JavaScript function name.
CallFrames []*RuntimeCallFrame `json:"callFrames"`
// Parent (optional) Asynchronous JavaScript stack trace that preceded this stack, if available.
Parent *RuntimeStackTrace `json:"parent,omitempty"`
// ParentID (experimental) (optional) Asynchronous JavaScript stack trace that preceded this stack, if available.
ParentID *RuntimeStackTraceID `json:"parentId,omitempty"`
}
// RuntimeUniqueDebuggerID (experimental) Unique identifier of current debugger.
type RuntimeUniqueDebuggerID string
// RuntimeStackTraceID (experimental) If `debuggerId` is set stack trace comes from another debugger and can be resolved there. This
// allows to track cross-debugger calls. See `Runtime.StackTrace` and `Debugger.paused` for usages.
type RuntimeStackTraceID struct {
// ID ...
ID string `json:"id"`
// DebuggerID (optional) ...
DebuggerID RuntimeUniqueDebuggerID `json:"debuggerId,omitempty"`
}
// RuntimeAwaitPromise Add handler to promise with given promise object id.
type RuntimeAwaitPromise struct {
// PromiseObjectID Identifier of the promise.
PromiseObjectID RuntimeRemoteObjectID `json:"promiseObjectId"`
// ReturnByValue (optional) Whether the result is expected to be a JSON object that should be sent by value.
ReturnByValue bool `json:"returnByValue,omitempty"`
// GeneratePreview (optional) Whether preview should be generated for the result.
GeneratePreview bool `json:"generatePreview,omitempty"`
}
// ProtoReq name
func (m RuntimeAwaitPromise) ProtoReq() string { return "Runtime.awaitPromise" }
// Call the request
func (m RuntimeAwaitPromise) Call(c Client) (*RuntimeAwaitPromiseResult, error) {
var res RuntimeAwaitPromiseResult
return &res, call(m.ProtoReq(), m, &res, c)
}
// RuntimeAwaitPromiseResult ...
type RuntimeAwaitPromiseResult struct {
// Result Promise result. Will contain rejected value if promise was rejected.
Result *RuntimeRemoteObject `json:"result"`
// ExceptionDetails (optional) Exception details if stack strace is available.
ExceptionDetails *RuntimeExceptionDetails `json:"exceptionDetails,omitempty"`
}
// RuntimeCallFunctionOn Calls function with given declaration on the given object. Object group of the result is
// inherited from the target object.
type RuntimeCallFunctionOn struct {
// FunctionDeclaration Declaration of the function to call.
FunctionDeclaration string `json:"functionDeclaration"`
// ObjectID (optional) Identifier of the object to call function on. Either objectId or executionContextId should
// be specified.
ObjectID RuntimeRemoteObjectID `json:"objectId,omitempty"`
// Arguments (optional) Call arguments. All call arguments must belong to the same JavaScript world as the target
// object.
Arguments []*RuntimeCallArgument `json:"arguments,omitempty"`
// Silent (optional) In silent mode exceptions thrown during evaluation are not reported and do not pause
// execution. Overrides `setPauseOnException` state.
Silent bool `json:"silent,omitempty"`
// ReturnByValue (optional) Whether the result is expected to be a JSON object which should be sent by value.
ReturnByValue bool `json:"returnByValue,omitempty"`
// GeneratePreview (experimental) (optional) Whether preview should be generated for the result.
GeneratePreview bool `json:"generatePreview,omitempty"`
// UserGesture (optional) Whether execution should be treated as initiated by user in the UI.
UserGesture bool `json:"userGesture,omitempty"`
// AwaitPromise (optional) Whether execution should `await` for resulting value and return once awaited promise is
// resolved.
AwaitPromise bool `json:"awaitPromise,omitempty"`
// ExecutionContextID (optional) Specifies execution context which global object will be used to call function on. Either
// executionContextId or objectId should be specified.
ExecutionContextID RuntimeExecutionContextID `json:"executionContextId,omitempty"`
// ObjectGroup (optional) Symbolic group name that can be used to release multiple objects. If objectGroup is not
// specified and objectId is, objectGroup will be inherited from object.
ObjectGroup string `json:"objectGroup,omitempty"`
// ThrowOnSideEffect (experimental) (optional) Whether to throw an exception if side effect cannot be ruled out during evaluation.
ThrowOnSideEffect bool `json:"throwOnSideEffect,omitempty"`
// GenerateWebDriverValue (experimental) (optional) Whether the result should contain `webDriverValue`, serialized according to
// https://w3c.github.io/webdriver-bidi. This is mutually exclusive with `returnByValue`, but
// resulting `objectId` is still provided.
GenerateWebDriverValue bool `json:"generateWebDriverValue,omitempty"`
}
// ProtoReq name
func (m RuntimeCallFunctionOn) ProtoReq() string { return "Runtime.callFunctionOn" }
// Call the request
func (m RuntimeCallFunctionOn) Call(c Client) (*RuntimeCallFunctionOnResult, error) {
var res RuntimeCallFunctionOnResult
return &res, call(m.ProtoReq(), m, &res, c)
}
// RuntimeCallFunctionOnResult ...
type RuntimeCallFunctionOnResult struct {
// Result Call result.
Result *RuntimeRemoteObject `json:"result"`
// ExceptionDetails (optional) Exception details.
ExceptionDetails *RuntimeExceptionDetails `json:"exceptionDetails,omitempty"`
}
// RuntimeCompileScript Compiles expression.
type RuntimeCompileScript struct {
// Expression Expression to compile.
Expression string `json:"expression"`
// SourceURL Source url to be set for the script.
SourceURL string `json:"sourceURL"`
// PersistScript Specifies whether the compiled script should be persisted.
PersistScript bool `json:"persistScript"`
// ExecutionContextID (optional) Specifies in which execution context to perform script run. If the parameter is omitted the
// evaluation will be performed in the context of the inspected page.
ExecutionContextID RuntimeExecutionContextID `json:"executionContextId,omitempty"`
}
// ProtoReq name
func (m RuntimeCompileScript) ProtoReq() string { return "Runtime.compileScript" }
// Call the request
func (m RuntimeCompileScript) Call(c Client) (*RuntimeCompileScriptResult, error) {
var res RuntimeCompileScriptResult
return &res, call(m.ProtoReq(), m, &res, c)
}
// RuntimeCompileScriptResult ...
type RuntimeCompileScriptResult struct {
// ScriptID (optional) Id of the script.
ScriptID RuntimeScriptID `json:"scriptId,omitempty"`
// ExceptionDetails (optional) Exception details.
ExceptionDetails *RuntimeExceptionDetails `json:"exceptionDetails,omitempty"`
}
// RuntimeDisable Disables reporting of execution contexts creation.
type RuntimeDisable struct {
}
// ProtoReq name
func (m RuntimeDisable) ProtoReq() string { return "Runtime.disable" }
// Call sends the request
func (m RuntimeDisable) Call(c Client) error {
return call(m.ProtoReq(), m, nil, c)
}
// RuntimeDiscardConsoleEntries Discards collected exceptions and console API calls.
type RuntimeDiscardConsoleEntries struct {
}
// ProtoReq name
func (m RuntimeDiscardConsoleEntries) ProtoReq() string { return "Runtime.discardConsoleEntries" }
// Call sends the request
func (m RuntimeDiscardConsoleEntries) Call(c Client) error {
return call(m.ProtoReq(), m, nil, c)
}
// RuntimeEnable Enables reporting of execution contexts creation by means of `executionContextCreated` event.
// When the reporting gets enabled the event will be sent immediately for each existing execution
// context.
type RuntimeEnable struct {
}
// ProtoReq name
func (m RuntimeEnable) ProtoReq() string { return "Runtime.enable" }
// Call sends the request
func (m RuntimeEnable) Call(c Client) error {
return call(m.ProtoReq(), m, nil, c)
}
// RuntimeEvaluate Evaluates expression on global object.
type RuntimeEvaluate struct {
// Expression Expression to evaluate.
Expression string `json:"expression"`
// ObjectGroup (optional) Symbolic group name that can be used to release multiple objects.
ObjectGroup string `json:"objectGroup,omitempty"`
// IncludeCommandLineAPI (optional) Determines whether Command Line API should be available during the evaluation.
IncludeCommandLineAPI bool `json:"includeCommandLineAPI,omitempty"`
// Silent (optional) In silent mode exceptions thrown during evaluation are not reported and do not pause
// execution. Overrides `setPauseOnException` state.
Silent bool `json:"silent,omitempty"`
// ContextID (optional) Specifies in which execution context to perform evaluation. If the parameter is omitted the
// evaluation will be performed in the context of the inspected page.
// This is mutually exclusive with `uniqueContextId`, which offers an
// alternative way to identify the execution context that is more reliable
// in a multi-process environment.
ContextID RuntimeExecutionContextID `json:"contextId,omitempty"`
// ReturnByValue (optional) Whether the result is expected to be a JSON object that should be sent by value.
ReturnByValue bool `json:"returnByValue,omitempty"`
// GeneratePreview (experimental) (optional) Whether preview should be generated for the result.
GeneratePreview bool `json:"generatePreview,omitempty"`
// UserGesture (optional) Whether execution should be treated as initiated by user in the UI.
UserGesture bool `json:"userGesture,omitempty"`
// AwaitPromise (optional) Whether execution should `await` for resulting value and return once awaited promise is
// resolved.
AwaitPromise bool `json:"awaitPromise,omitempty"`
// ThrowOnSideEffect (experimental) (optional) Whether to throw an exception if side effect cannot be ruled out during evaluation.
// This implies `disableBreaks` below.
ThrowOnSideEffect bool `json:"throwOnSideEffect,omitempty"`
// Timeout (experimental) (optional) Terminate execution after timing out (number of milliseconds).
Timeout RuntimeTimeDelta `json:"timeout,omitempty"`
// DisableBreaks (experimental) (optional) Disable breakpoints during execution.
DisableBreaks bool `json:"disableBreaks,omitempty"`
// ReplMode (experimental) (optional) Setting this flag to true enables `let` re-declaration and top-level `await`.
// Note that `let` variables can only be re-declared if they originate from
// `replMode` themselves.
ReplMode bool `json:"replMode,omitempty"`
// AllowUnsafeEvalBlockedByCSP (experimental) (optional) The Content Security Policy (CSP) for the target might block 'unsafe-eval'
// which includes eval(), Function(), setTimeout() and setInterval()
// when called with non-callable arguments. This flag bypasses CSP for this
// evaluation and allows unsafe-eval. Defaults to true.
AllowUnsafeEvalBlockedByCSP bool `json:"allowUnsafeEvalBlockedByCSP,omitempty"`
// UniqueContextID (experimental) (optional) An alternative way to specify the execution context to evaluate in.
// Compared to contextId that may be reused across processes, this is guaranteed to be
// system-unique, so it can be used to prevent accidental evaluation of the expression
// in context different than intended (e.g. as a result of navigation across process
// boundaries).
// This is mutually exclusive with `contextId`.
UniqueContextID string `json:"uniqueContextId,omitempty"`
// GenerateWebDriverValue (experimental) (optional) Whether the result should be serialized according to https://w3c.github.io/webdriver-bidi.
GenerateWebDriverValue bool `json:"generateWebDriverValue,omitempty"`
}
// ProtoReq name
func (m RuntimeEvaluate) ProtoReq() string { return "Runtime.evaluate" }
// Call the request
func (m RuntimeEvaluate) Call(c Client) (*RuntimeEvaluateResult, error) {
var res RuntimeEvaluateResult
return &res, call(m.ProtoReq(), m, &res, c)
}
// RuntimeEvaluateResult ...
type RuntimeEvaluateResult struct {
// Result Evaluation result.
Result *RuntimeRemoteObject `json:"result"`
// ExceptionDetails (optional) Exception details.
ExceptionDetails *RuntimeExceptionDetails `json:"exceptionDetails,omitempty"`
}
// RuntimeGetIsolateID (experimental) Returns the isolate id.
type RuntimeGetIsolateID struct {
}
// ProtoReq name
func (m RuntimeGetIsolateID) ProtoReq() string { return "Runtime.getIsolateId" }
// Call the request
func (m RuntimeGetIsolateID) Call(c Client) (*RuntimeGetIsolateIDResult, error) {
var res RuntimeGetIsolateIDResult
return &res, call(m.ProtoReq(), m, &res, c)
}
// RuntimeGetIsolateIDResult (experimental) ...
type RuntimeGetIsolateIDResult struct {
// ID The isolate id.
ID string `json:"id"`
}
// RuntimeGetHeapUsage (experimental) Returns the JavaScript heap usage.
// It is the total usage of the corresponding isolate not scoped to a particular Runtime.
type RuntimeGetHeapUsage struct {
}
// ProtoReq name
func (m RuntimeGetHeapUsage) ProtoReq() string { return "Runtime.getHeapUsage" }
// Call the request
func (m RuntimeGetHeapUsage) Call(c Client) (*RuntimeGetHeapUsageResult, error) {
var res RuntimeGetHeapUsageResult
return &res, call(m.ProtoReq(), m, &res, c)
}
// RuntimeGetHeapUsageResult (experimental) ...
type RuntimeGetHeapUsageResult struct {
// UsedSize Used heap size in bytes.
UsedSize float64 `json:"usedSize"`
// TotalSize Allocated heap size in bytes.
TotalSize float64 `json:"totalSize"`
}
// RuntimeGetProperties Returns properties of a given object. Object group of the result is inherited from the target