-
Notifications
You must be signed in to change notification settings - Fork 48
/
command.go
1029 lines (865 loc) · 40.6 KB
/
command.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
// Code generated by cdpgen. DO NOT EDIT.
package dom
import (
"github.com/mafredri/cdp/protocol/internal"
"github.com/mafredri/cdp/protocol/runtime"
)
// CollectClassNamesFromSubtreeArgs represents the arguments for CollectClassNamesFromSubtree in the DOM domain.
type CollectClassNamesFromSubtreeArgs struct {
NodeID NodeID `json:"nodeId"` // Id of the node to collect class names.
}
// NewCollectClassNamesFromSubtreeArgs initializes CollectClassNamesFromSubtreeArgs with the required arguments.
func NewCollectClassNamesFromSubtreeArgs(nodeID NodeID) *CollectClassNamesFromSubtreeArgs {
args := new(CollectClassNamesFromSubtreeArgs)
args.NodeID = nodeID
return args
}
// CollectClassNamesFromSubtreeReply represents the return values for CollectClassNamesFromSubtree in the DOM domain.
type CollectClassNamesFromSubtreeReply struct {
ClassNames []string `json:"classNames"` // Class name list.
}
// CopyToArgs represents the arguments for CopyTo in the DOM domain.
type CopyToArgs struct {
NodeID NodeID `json:"nodeId"` // Id of the node to copy.
TargetNodeID NodeID `json:"targetNodeId"` // Id of the element to drop the copy into.
InsertBeforeNodeID *NodeID `json:"insertBeforeNodeId,omitempty"` // Drop the copy before this node (if absent, the copy becomes the last child of `targetNodeId`).
}
// NewCopyToArgs initializes CopyToArgs with the required arguments.
func NewCopyToArgs(nodeID NodeID, targetNodeID NodeID) *CopyToArgs {
args := new(CopyToArgs)
args.NodeID = nodeID
args.TargetNodeID = targetNodeID
return args
}
// SetInsertBeforeNodeID sets the InsertBeforeNodeID optional argument.
// Drop the copy before this node (if absent, the copy becomes the last
// child of `targetNodeId`).
func (a *CopyToArgs) SetInsertBeforeNodeID(insertBeforeNodeID NodeID) *CopyToArgs {
a.InsertBeforeNodeID = &insertBeforeNodeID
return a
}
// CopyToReply represents the return values for CopyTo in the DOM domain.
type CopyToReply struct {
NodeID NodeID `json:"nodeId"` // Id of the node clone.
}
// DescribeNodeArgs represents the arguments for DescribeNode in the DOM domain.
type DescribeNodeArgs struct {
NodeID *NodeID `json:"nodeId,omitempty"` // Identifier of the node.
BackendNodeID *BackendNodeID `json:"backendNodeId,omitempty"` // Identifier of the backend node.
ObjectID *runtime.RemoteObjectID `json:"objectId,omitempty"` // JavaScript object id of the node wrapper.
Depth *int `json:"depth,omitempty"` // The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0.
Pierce *bool `json:"pierce,omitempty"` // Whether or not iframes and shadow roots should be traversed when returning the subtree (default is false).
}
// NewDescribeNodeArgs initializes DescribeNodeArgs with the required arguments.
func NewDescribeNodeArgs() *DescribeNodeArgs {
args := new(DescribeNodeArgs)
return args
}
// SetNodeID sets the NodeID optional argument. Identifier of the
// node.
func (a *DescribeNodeArgs) SetNodeID(nodeID NodeID) *DescribeNodeArgs {
a.NodeID = &nodeID
return a
}
// SetBackendNodeID sets the BackendNodeID optional argument.
// Identifier of the backend node.
func (a *DescribeNodeArgs) SetBackendNodeID(backendNodeID BackendNodeID) *DescribeNodeArgs {
a.BackendNodeID = &backendNodeID
return a
}
// SetObjectID sets the ObjectID optional argument. JavaScript object
// id of the node wrapper.
func (a *DescribeNodeArgs) SetObjectID(objectID runtime.RemoteObjectID) *DescribeNodeArgs {
a.ObjectID = &objectID
return a
}
// SetDepth sets the Depth optional argument. The maximum depth at
// which children should be retrieved, defaults to 1. Use -1 for the
// entire subtree or provide an integer larger than 0.
func (a *DescribeNodeArgs) SetDepth(depth int) *DescribeNodeArgs {
a.Depth = &depth
return a
}
// SetPierce sets the Pierce optional argument. Whether or not iframes
// and shadow roots should be traversed when returning the subtree
// (default is false).
func (a *DescribeNodeArgs) SetPierce(pierce bool) *DescribeNodeArgs {
a.Pierce = &pierce
return a
}
// DescribeNodeReply represents the return values for DescribeNode in the DOM domain.
type DescribeNodeReply struct {
Node Node `json:"node"` // Node description.
}
// ScrollIntoViewIfNeededArgs represents the arguments for ScrollIntoViewIfNeeded in the DOM domain.
type ScrollIntoViewIfNeededArgs struct {
NodeID *NodeID `json:"nodeId,omitempty"` // Identifier of the node.
BackendNodeID *BackendNodeID `json:"backendNodeId,omitempty"` // Identifier of the backend node.
ObjectID *runtime.RemoteObjectID `json:"objectId,omitempty"` // JavaScript object id of the node wrapper.
Rect *Rect `json:"rect,omitempty"` // The rect to be scrolled into view, relative to the node's border box, in CSS pixels. When omitted, center of the node will be used, similar to Element.scrollIntoView.
}
// NewScrollIntoViewIfNeededArgs initializes ScrollIntoViewIfNeededArgs with the required arguments.
func NewScrollIntoViewIfNeededArgs() *ScrollIntoViewIfNeededArgs {
args := new(ScrollIntoViewIfNeededArgs)
return args
}
// SetNodeID sets the NodeID optional argument. Identifier of the
// node.
func (a *ScrollIntoViewIfNeededArgs) SetNodeID(nodeID NodeID) *ScrollIntoViewIfNeededArgs {
a.NodeID = &nodeID
return a
}
// SetBackendNodeID sets the BackendNodeID optional argument.
// Identifier of the backend node.
func (a *ScrollIntoViewIfNeededArgs) SetBackendNodeID(backendNodeID BackendNodeID) *ScrollIntoViewIfNeededArgs {
a.BackendNodeID = &backendNodeID
return a
}
// SetObjectID sets the ObjectID optional argument. JavaScript object
// id of the node wrapper.
func (a *ScrollIntoViewIfNeededArgs) SetObjectID(objectID runtime.RemoteObjectID) *ScrollIntoViewIfNeededArgs {
a.ObjectID = &objectID
return a
}
// SetRect sets the Rect optional argument. The rect to be scrolled
// into view, relative to the node's border box, in CSS pixels. When
// omitted, center of the node will be used, similar to
// Element.scrollIntoView.
func (a *ScrollIntoViewIfNeededArgs) SetRect(rect Rect) *ScrollIntoViewIfNeededArgs {
a.Rect = &rect
return a
}
// DiscardSearchResultsArgs represents the arguments for DiscardSearchResults in the DOM domain.
type DiscardSearchResultsArgs struct {
SearchID string `json:"searchId"` // Unique search session identifier.
}
// NewDiscardSearchResultsArgs initializes DiscardSearchResultsArgs with the required arguments.
func NewDiscardSearchResultsArgs(searchID string) *DiscardSearchResultsArgs {
args := new(DiscardSearchResultsArgs)
args.SearchID = searchID
return args
}
// EnableArgs represents the arguments for Enable in the DOM domain.
type EnableArgs struct {
// IncludeWhitespace Whether to include whitespaces in the children
// array of returned Nodes.
//
// Values: "none", "all".
//
// Note: This property is experimental.
IncludeWhitespace *string `json:"includeWhitespace,omitempty"`
}
// NewEnableArgs initializes EnableArgs with the required arguments.
func NewEnableArgs() *EnableArgs {
args := new(EnableArgs)
return args
}
// SetIncludeWhitespace sets the IncludeWhitespace optional argument.
// Whether to include whitespaces in the children array of returned
// Nodes.
//
// Values: "none", "all".
//
// Note: This property is experimental.
func (a *EnableArgs) SetIncludeWhitespace(includeWhitespace string) *EnableArgs {
a.IncludeWhitespace = &includeWhitespace
return a
}
// FocusArgs represents the arguments for Focus in the DOM domain.
type FocusArgs struct {
NodeID *NodeID `json:"nodeId,omitempty"` // Identifier of the node.
BackendNodeID *BackendNodeID `json:"backendNodeId,omitempty"` // Identifier of the backend node.
ObjectID *runtime.RemoteObjectID `json:"objectId,omitempty"` // JavaScript object id of the node wrapper.
}
// NewFocusArgs initializes FocusArgs with the required arguments.
func NewFocusArgs() *FocusArgs {
args := new(FocusArgs)
return args
}
// SetNodeID sets the NodeID optional argument. Identifier of the
// node.
func (a *FocusArgs) SetNodeID(nodeID NodeID) *FocusArgs {
a.NodeID = &nodeID
return a
}
// SetBackendNodeID sets the BackendNodeID optional argument.
// Identifier of the backend node.
func (a *FocusArgs) SetBackendNodeID(backendNodeID BackendNodeID) *FocusArgs {
a.BackendNodeID = &backendNodeID
return a
}
// SetObjectID sets the ObjectID optional argument. JavaScript object
// id of the node wrapper.
func (a *FocusArgs) SetObjectID(objectID runtime.RemoteObjectID) *FocusArgs {
a.ObjectID = &objectID
return a
}
// GetAttributesArgs represents the arguments for GetAttributes in the DOM domain.
type GetAttributesArgs struct {
NodeID NodeID `json:"nodeId"` // Id of the node to retrieve attibutes for.
}
// NewGetAttributesArgs initializes GetAttributesArgs with the required arguments.
func NewGetAttributesArgs(nodeID NodeID) *GetAttributesArgs {
args := new(GetAttributesArgs)
args.NodeID = nodeID
return args
}
// GetAttributesReply represents the return values for GetAttributes in the DOM domain.
type GetAttributesReply struct {
Attributes []string `json:"attributes"` // An interleaved array of node attribute names and values.
}
// GetBoxModelArgs represents the arguments for GetBoxModel in the DOM domain.
type GetBoxModelArgs struct {
NodeID *NodeID `json:"nodeId,omitempty"` // Identifier of the node.
BackendNodeID *BackendNodeID `json:"backendNodeId,omitempty"` // Identifier of the backend node.
ObjectID *runtime.RemoteObjectID `json:"objectId,omitempty"` // JavaScript object id of the node wrapper.
}
// NewGetBoxModelArgs initializes GetBoxModelArgs with the required arguments.
func NewGetBoxModelArgs() *GetBoxModelArgs {
args := new(GetBoxModelArgs)
return args
}
// SetNodeID sets the NodeID optional argument. Identifier of the
// node.
func (a *GetBoxModelArgs) SetNodeID(nodeID NodeID) *GetBoxModelArgs {
a.NodeID = &nodeID
return a
}
// SetBackendNodeID sets the BackendNodeID optional argument.
// Identifier of the backend node.
func (a *GetBoxModelArgs) SetBackendNodeID(backendNodeID BackendNodeID) *GetBoxModelArgs {
a.BackendNodeID = &backendNodeID
return a
}
// SetObjectID sets the ObjectID optional argument. JavaScript object
// id of the node wrapper.
func (a *GetBoxModelArgs) SetObjectID(objectID runtime.RemoteObjectID) *GetBoxModelArgs {
a.ObjectID = &objectID
return a
}
// GetBoxModelReply represents the return values for GetBoxModel in the DOM domain.
type GetBoxModelReply struct {
Model BoxModel `json:"model"` // Box model for the node.
}
// GetContentQuadsArgs represents the arguments for GetContentQuads in the DOM domain.
type GetContentQuadsArgs struct {
NodeID *NodeID `json:"nodeId,omitempty"` // Identifier of the node.
BackendNodeID *BackendNodeID `json:"backendNodeId,omitempty"` // Identifier of the backend node.
ObjectID *runtime.RemoteObjectID `json:"objectId,omitempty"` // JavaScript object id of the node wrapper.
}
// NewGetContentQuadsArgs initializes GetContentQuadsArgs with the required arguments.
func NewGetContentQuadsArgs() *GetContentQuadsArgs {
args := new(GetContentQuadsArgs)
return args
}
// SetNodeID sets the NodeID optional argument. Identifier of the
// node.
func (a *GetContentQuadsArgs) SetNodeID(nodeID NodeID) *GetContentQuadsArgs {
a.NodeID = &nodeID
return a
}
// SetBackendNodeID sets the BackendNodeID optional argument.
// Identifier of the backend node.
func (a *GetContentQuadsArgs) SetBackendNodeID(backendNodeID BackendNodeID) *GetContentQuadsArgs {
a.BackendNodeID = &backendNodeID
return a
}
// SetObjectID sets the ObjectID optional argument. JavaScript object
// id of the node wrapper.
func (a *GetContentQuadsArgs) SetObjectID(objectID runtime.RemoteObjectID) *GetContentQuadsArgs {
a.ObjectID = &objectID
return a
}
// GetContentQuadsReply represents the return values for GetContentQuads in the DOM domain.
type GetContentQuadsReply struct {
Quads []Quad `json:"quads"` // Quads that describe node layout relative to viewport.
}
// GetDocumentArgs represents the arguments for GetDocument in the DOM domain.
type GetDocumentArgs struct {
Depth *int `json:"depth,omitempty"` // The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0.
Pierce *bool `json:"pierce,omitempty"` // Whether or not iframes and shadow roots should be traversed when returning the subtree (default is false).
}
// NewGetDocumentArgs initializes GetDocumentArgs with the required arguments.
func NewGetDocumentArgs() *GetDocumentArgs {
args := new(GetDocumentArgs)
return args
}
// SetDepth sets the Depth optional argument. The maximum depth at
// which children should be retrieved, defaults to 1. Use -1 for the
// entire subtree or provide an integer larger than 0.
func (a *GetDocumentArgs) SetDepth(depth int) *GetDocumentArgs {
a.Depth = &depth
return a
}
// SetPierce sets the Pierce optional argument. Whether or not iframes
// and shadow roots should be traversed when returning the subtree
// (default is false).
func (a *GetDocumentArgs) SetPierce(pierce bool) *GetDocumentArgs {
a.Pierce = &pierce
return a
}
// GetDocumentReply represents the return values for GetDocument in the DOM domain.
type GetDocumentReply struct {
Root Node `json:"root"` // Resulting node.
}
// GetFlattenedDocumentArgs represents the arguments for GetFlattenedDocument in the DOM domain.
type GetFlattenedDocumentArgs struct {
Depth *int `json:"depth,omitempty"` // The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0.
Pierce *bool `json:"pierce,omitempty"` // Whether or not iframes and shadow roots should be traversed when returning the subtree (default is false).
}
// NewGetFlattenedDocumentArgs initializes GetFlattenedDocumentArgs with the required arguments.
func NewGetFlattenedDocumentArgs() *GetFlattenedDocumentArgs {
args := new(GetFlattenedDocumentArgs)
return args
}
// SetDepth sets the Depth optional argument. The maximum depth at
// which children should be retrieved, defaults to 1. Use -1 for the
// entire subtree or provide an integer larger than 0.
func (a *GetFlattenedDocumentArgs) SetDepth(depth int) *GetFlattenedDocumentArgs {
a.Depth = &depth
return a
}
// SetPierce sets the Pierce optional argument. Whether or not iframes
// and shadow roots should be traversed when returning the subtree
// (default is false).
func (a *GetFlattenedDocumentArgs) SetPierce(pierce bool) *GetFlattenedDocumentArgs {
a.Pierce = &pierce
return a
}
// GetFlattenedDocumentReply represents the return values for GetFlattenedDocument in the DOM domain.
type GetFlattenedDocumentReply struct {
Nodes []Node `json:"nodes"` // Resulting node.
}
// GetNodesForSubtreeByStyleArgs represents the arguments for GetNodesForSubtreeByStyle in the DOM domain.
type GetNodesForSubtreeByStyleArgs struct {
NodeID NodeID `json:"nodeId"` // Node ID pointing to the root of a subtree.
ComputedStyles []CSSComputedStyleProperty `json:"computedStyles"` // The style to filter nodes by (includes nodes if any of properties matches).
Pierce *bool `json:"pierce,omitempty"` // Whether or not iframes and shadow roots in the same target should be traversed when returning the results (default is false).
}
// NewGetNodesForSubtreeByStyleArgs initializes GetNodesForSubtreeByStyleArgs with the required arguments.
func NewGetNodesForSubtreeByStyleArgs(nodeID NodeID, computedStyles []CSSComputedStyleProperty) *GetNodesForSubtreeByStyleArgs {
args := new(GetNodesForSubtreeByStyleArgs)
args.NodeID = nodeID
args.ComputedStyles = computedStyles
return args
}
// SetPierce sets the Pierce optional argument. Whether or not iframes
// and shadow roots in the same target should be traversed when
// returning the results (default is false).
func (a *GetNodesForSubtreeByStyleArgs) SetPierce(pierce bool) *GetNodesForSubtreeByStyleArgs {
a.Pierce = &pierce
return a
}
// GetNodesForSubtreeByStyleReply represents the return values for GetNodesForSubtreeByStyle in the DOM domain.
type GetNodesForSubtreeByStyleReply struct {
NodeIDs []NodeID `json:"nodeIds"` // Resulting nodes.
}
// GetNodeForLocationArgs represents the arguments for GetNodeForLocation in the DOM domain.
type GetNodeForLocationArgs struct {
X int `json:"x"` // X coordinate.
Y int `json:"y"` // Y coordinate.
IncludeUserAgentShadowDOM *bool `json:"includeUserAgentShadowDOM,omitempty"` // False to skip to the nearest non-UA shadow root ancestor (default: false).
IgnorePointerEventsNone *bool `json:"ignorePointerEventsNone,omitempty"` // Whether to ignore pointer-events: none on elements and hit test them.
}
// NewGetNodeForLocationArgs initializes GetNodeForLocationArgs with the required arguments.
func NewGetNodeForLocationArgs(x int, y int) *GetNodeForLocationArgs {
args := new(GetNodeForLocationArgs)
args.X = x
args.Y = y
return args
}
// SetIncludeUserAgentShadowDOM sets the IncludeUserAgentShadowDOM optional argument.
// False to skip to the nearest non-UA shadow root ancestor (default:
// false).
func (a *GetNodeForLocationArgs) SetIncludeUserAgentShadowDOM(includeUserAgentShadowDOM bool) *GetNodeForLocationArgs {
a.IncludeUserAgentShadowDOM = &includeUserAgentShadowDOM
return a
}
// SetIgnorePointerEventsNone sets the IgnorePointerEventsNone optional argument.
// Whether to ignore pointer-events: none on elements and hit test
// them.
func (a *GetNodeForLocationArgs) SetIgnorePointerEventsNone(ignorePointerEventsNone bool) *GetNodeForLocationArgs {
a.IgnorePointerEventsNone = &ignorePointerEventsNone
return a
}
// GetNodeForLocationReply represents the return values for GetNodeForLocation in the DOM domain.
type GetNodeForLocationReply struct {
BackendNodeID BackendNodeID `json:"backendNodeId"` // Resulting node.
FrameID internal.PageFrameID `json:"frameId"` // Frame this node belongs to.
NodeID *NodeID `json:"nodeId,omitempty"` // Id of the node at given coordinates, only when enabled and requested document.
}
// GetOuterHTMLArgs represents the arguments for GetOuterHTML in the DOM domain.
type GetOuterHTMLArgs struct {
NodeID *NodeID `json:"nodeId,omitempty"` // Identifier of the node.
BackendNodeID *BackendNodeID `json:"backendNodeId,omitempty"` // Identifier of the backend node.
ObjectID *runtime.RemoteObjectID `json:"objectId,omitempty"` // JavaScript object id of the node wrapper.
}
// NewGetOuterHTMLArgs initializes GetOuterHTMLArgs with the required arguments.
func NewGetOuterHTMLArgs() *GetOuterHTMLArgs {
args := new(GetOuterHTMLArgs)
return args
}
// SetNodeID sets the NodeID optional argument. Identifier of the
// node.
func (a *GetOuterHTMLArgs) SetNodeID(nodeID NodeID) *GetOuterHTMLArgs {
a.NodeID = &nodeID
return a
}
// SetBackendNodeID sets the BackendNodeID optional argument.
// Identifier of the backend node.
func (a *GetOuterHTMLArgs) SetBackendNodeID(backendNodeID BackendNodeID) *GetOuterHTMLArgs {
a.BackendNodeID = &backendNodeID
return a
}
// SetObjectID sets the ObjectID optional argument. JavaScript object
// id of the node wrapper.
func (a *GetOuterHTMLArgs) SetObjectID(objectID runtime.RemoteObjectID) *GetOuterHTMLArgs {
a.ObjectID = &objectID
return a
}
// GetOuterHTMLReply represents the return values for GetOuterHTML in the DOM domain.
type GetOuterHTMLReply struct {
OuterHTML string `json:"outerHTML"` // Outer HTML markup.
}
// GetRelayoutBoundaryArgs represents the arguments for GetRelayoutBoundary in the DOM domain.
type GetRelayoutBoundaryArgs struct {
NodeID NodeID `json:"nodeId"` // Id of the node.
}
// NewGetRelayoutBoundaryArgs initializes GetRelayoutBoundaryArgs with the required arguments.
func NewGetRelayoutBoundaryArgs(nodeID NodeID) *GetRelayoutBoundaryArgs {
args := new(GetRelayoutBoundaryArgs)
args.NodeID = nodeID
return args
}
// GetRelayoutBoundaryReply represents the return values for GetRelayoutBoundary in the DOM domain.
type GetRelayoutBoundaryReply struct {
NodeID NodeID `json:"nodeId"` // Relayout boundary node id for the given node.
}
// GetSearchResultsArgs represents the arguments for GetSearchResults in the DOM domain.
type GetSearchResultsArgs struct {
SearchID string `json:"searchId"` // Unique search session identifier.
FromIndex int `json:"fromIndex"` // Start index of the search result to be returned.
ToIndex int `json:"toIndex"` // End index of the search result to be returned.
}
// NewGetSearchResultsArgs initializes GetSearchResultsArgs with the required arguments.
func NewGetSearchResultsArgs(searchID string, fromIndex int, toIndex int) *GetSearchResultsArgs {
args := new(GetSearchResultsArgs)
args.SearchID = searchID
args.FromIndex = fromIndex
args.ToIndex = toIndex
return args
}
// GetSearchResultsReply represents the return values for GetSearchResults in the DOM domain.
type GetSearchResultsReply struct {
NodeIDs []NodeID `json:"nodeIds"` // Ids of the search result nodes.
}
// MoveToArgs represents the arguments for MoveTo in the DOM domain.
type MoveToArgs struct {
NodeID NodeID `json:"nodeId"` // Id of the node to move.
TargetNodeID NodeID `json:"targetNodeId"` // Id of the element to drop the moved node into.
InsertBeforeNodeID *NodeID `json:"insertBeforeNodeId,omitempty"` // Drop node before this one (if absent, the moved node becomes the last child of `targetNodeId`).
}
// NewMoveToArgs initializes MoveToArgs with the required arguments.
func NewMoveToArgs(nodeID NodeID, targetNodeID NodeID) *MoveToArgs {
args := new(MoveToArgs)
args.NodeID = nodeID
args.TargetNodeID = targetNodeID
return args
}
// SetInsertBeforeNodeID sets the InsertBeforeNodeID optional argument.
// Drop node before this one (if absent, the moved node becomes the
// last child of `targetNodeId`).
func (a *MoveToArgs) SetInsertBeforeNodeID(insertBeforeNodeID NodeID) *MoveToArgs {
a.InsertBeforeNodeID = &insertBeforeNodeID
return a
}
// MoveToReply represents the return values for MoveTo in the DOM domain.
type MoveToReply struct {
NodeID NodeID `json:"nodeId"` // New id of the moved node.
}
// PerformSearchArgs represents the arguments for PerformSearch in the DOM domain.
type PerformSearchArgs struct {
Query string `json:"query"` // Plain text or query selector or XPath search query.
IncludeUserAgentShadowDOM *bool `json:"includeUserAgentShadowDOM,omitempty"` // True to search in user agent shadow DOM.
}
// NewPerformSearchArgs initializes PerformSearchArgs with the required arguments.
func NewPerformSearchArgs(query string) *PerformSearchArgs {
args := new(PerformSearchArgs)
args.Query = query
return args
}
// SetIncludeUserAgentShadowDOM sets the IncludeUserAgentShadowDOM optional argument.
// True to search in user agent shadow DOM.
func (a *PerformSearchArgs) SetIncludeUserAgentShadowDOM(includeUserAgentShadowDOM bool) *PerformSearchArgs {
a.IncludeUserAgentShadowDOM = &includeUserAgentShadowDOM
return a
}
// PerformSearchReply represents the return values for PerformSearch in the DOM domain.
type PerformSearchReply struct {
SearchID string `json:"searchId"` // Unique search session identifier.
ResultCount int `json:"resultCount"` // Number of search results.
}
// PushNodeByPathToFrontendArgs represents the arguments for PushNodeByPathToFrontend in the DOM domain.
type PushNodeByPathToFrontendArgs struct {
Path string `json:"path"` // Path to node in the proprietary format.
}
// NewPushNodeByPathToFrontendArgs initializes PushNodeByPathToFrontendArgs with the required arguments.
func NewPushNodeByPathToFrontendArgs(path string) *PushNodeByPathToFrontendArgs {
args := new(PushNodeByPathToFrontendArgs)
args.Path = path
return args
}
// PushNodeByPathToFrontendReply represents the return values for PushNodeByPathToFrontend in the DOM domain.
type PushNodeByPathToFrontendReply struct {
NodeID NodeID `json:"nodeId"` // Id of the node for given path.
}
// PushNodesByBackendIDsToFrontendArgs represents the arguments for PushNodesByBackendIDsToFrontend in the DOM domain.
type PushNodesByBackendIDsToFrontendArgs struct {
BackendNodeIDs []BackendNodeID `json:"backendNodeIds"` // The array of backend node ids.
}
// NewPushNodesByBackendIDsToFrontendArgs initializes PushNodesByBackendIDsToFrontendArgs with the required arguments.
func NewPushNodesByBackendIDsToFrontendArgs(backendNodeIDs []BackendNodeID) *PushNodesByBackendIDsToFrontendArgs {
args := new(PushNodesByBackendIDsToFrontendArgs)
args.BackendNodeIDs = backendNodeIDs
return args
}
// PushNodesByBackendIDsToFrontendReply represents the return values for PushNodesByBackendIDsToFrontend in the DOM domain.
type PushNodesByBackendIDsToFrontendReply struct {
NodeIDs []NodeID `json:"nodeIds"` // The array of ids of pushed nodes that correspond to the backend ids specified in backendNodeIds.
}
// QuerySelectorArgs represents the arguments for QuerySelector in the DOM domain.
type QuerySelectorArgs struct {
NodeID NodeID `json:"nodeId"` // Id of the node to query upon.
Selector string `json:"selector"` // Selector string.
}
// NewQuerySelectorArgs initializes QuerySelectorArgs with the required arguments.
func NewQuerySelectorArgs(nodeID NodeID, selector string) *QuerySelectorArgs {
args := new(QuerySelectorArgs)
args.NodeID = nodeID
args.Selector = selector
return args
}
// QuerySelectorReply represents the return values for QuerySelector in the DOM domain.
type QuerySelectorReply struct {
NodeID NodeID `json:"nodeId"` // Query selector result.
}
// QuerySelectorAllArgs represents the arguments for QuerySelectorAll in the DOM domain.
type QuerySelectorAllArgs struct {
NodeID NodeID `json:"nodeId"` // Id of the node to query upon.
Selector string `json:"selector"` // Selector string.
}
// NewQuerySelectorAllArgs initializes QuerySelectorAllArgs with the required arguments.
func NewQuerySelectorAllArgs(nodeID NodeID, selector string) *QuerySelectorAllArgs {
args := new(QuerySelectorAllArgs)
args.NodeID = nodeID
args.Selector = selector
return args
}
// QuerySelectorAllReply represents the return values for QuerySelectorAll in the DOM domain.
type QuerySelectorAllReply struct {
NodeIDs []NodeID `json:"nodeIds"` // Query selector result.
}
// RemoveAttributeArgs represents the arguments for RemoveAttribute in the DOM domain.
type RemoveAttributeArgs struct {
NodeID NodeID `json:"nodeId"` // Id of the element to remove attribute from.
Name string `json:"name"` // Name of the attribute to remove.
}
// NewRemoveAttributeArgs initializes RemoveAttributeArgs with the required arguments.
func NewRemoveAttributeArgs(nodeID NodeID, name string) *RemoveAttributeArgs {
args := new(RemoveAttributeArgs)
args.NodeID = nodeID
args.Name = name
return args
}
// RemoveNodeArgs represents the arguments for RemoveNode in the DOM domain.
type RemoveNodeArgs struct {
NodeID NodeID `json:"nodeId"` // Id of the node to remove.
}
// NewRemoveNodeArgs initializes RemoveNodeArgs with the required arguments.
func NewRemoveNodeArgs(nodeID NodeID) *RemoveNodeArgs {
args := new(RemoveNodeArgs)
args.NodeID = nodeID
return args
}
// RequestChildNodesArgs represents the arguments for RequestChildNodes in the DOM domain.
type RequestChildNodesArgs struct {
NodeID NodeID `json:"nodeId"` // Id of the node to get children for.
Depth *int `json:"depth,omitempty"` // The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0.
Pierce *bool `json:"pierce,omitempty"` // Whether or not iframes and shadow roots should be traversed when returning the sub-tree (default is false).
}
// NewRequestChildNodesArgs initializes RequestChildNodesArgs with the required arguments.
func NewRequestChildNodesArgs(nodeID NodeID) *RequestChildNodesArgs {
args := new(RequestChildNodesArgs)
args.NodeID = nodeID
return args
}
// SetDepth sets the Depth optional argument. The maximum depth at
// which children should be retrieved, defaults to 1. Use -1 for the
// entire subtree or provide an integer larger than 0.
func (a *RequestChildNodesArgs) SetDepth(depth int) *RequestChildNodesArgs {
a.Depth = &depth
return a
}
// SetPierce sets the Pierce optional argument. Whether or not iframes
// and shadow roots should be traversed when returning the sub-tree
// (default is false).
func (a *RequestChildNodesArgs) SetPierce(pierce bool) *RequestChildNodesArgs {
a.Pierce = &pierce
return a
}
// RequestNodeArgs represents the arguments for RequestNode in the DOM domain.
type RequestNodeArgs struct {
ObjectID runtime.RemoteObjectID `json:"objectId"` // JavaScript object id to convert into node.
}
// NewRequestNodeArgs initializes RequestNodeArgs with the required arguments.
func NewRequestNodeArgs(objectID runtime.RemoteObjectID) *RequestNodeArgs {
args := new(RequestNodeArgs)
args.ObjectID = objectID
return args
}
// RequestNodeReply represents the return values for RequestNode in the DOM domain.
type RequestNodeReply struct {
NodeID NodeID `json:"nodeId"` // Node id for given object.
}
// ResolveNodeArgs represents the arguments for ResolveNode in the DOM domain.
type ResolveNodeArgs struct {
NodeID *NodeID `json:"nodeId,omitempty"` // Id of the node to resolve.
BackendNodeID *BackendNodeID `json:"backendNodeId,omitempty"` // Backend identifier of the node to resolve.
ObjectGroup *string `json:"objectGroup,omitempty"` // Symbolic group name that can be used to release multiple objects.
ExecutionContextID *runtime.ExecutionContextID `json:"executionContextId,omitempty"` // Execution context in which to resolve the node.
}
// NewResolveNodeArgs initializes ResolveNodeArgs with the required arguments.
func NewResolveNodeArgs() *ResolveNodeArgs {
args := new(ResolveNodeArgs)
return args
}
// SetNodeID sets the NodeID optional argument. Id of the node to
// resolve.
func (a *ResolveNodeArgs) SetNodeID(nodeID NodeID) *ResolveNodeArgs {
a.NodeID = &nodeID
return a
}
// SetBackendNodeID sets the BackendNodeID optional argument. Backend
// identifier of the node to resolve.
func (a *ResolveNodeArgs) SetBackendNodeID(backendNodeID BackendNodeID) *ResolveNodeArgs {
a.BackendNodeID = &backendNodeID
return a
}
// SetObjectGroup sets the ObjectGroup optional argument. Symbolic
// group name that can be used to release multiple objects.
func (a *ResolveNodeArgs) SetObjectGroup(objectGroup string) *ResolveNodeArgs {
a.ObjectGroup = &objectGroup
return a
}
// SetExecutionContextID sets the ExecutionContextID optional argument.
// Execution context in which to resolve the node.
func (a *ResolveNodeArgs) SetExecutionContextID(executionContextID runtime.ExecutionContextID) *ResolveNodeArgs {
a.ExecutionContextID = &executionContextID
return a
}
// ResolveNodeReply represents the return values for ResolveNode in the DOM domain.
type ResolveNodeReply struct {
Object runtime.RemoteObject `json:"object"` // JavaScript object wrapper for given node.
}
// SetAttributeValueArgs represents the arguments for SetAttributeValue in the DOM domain.
type SetAttributeValueArgs struct {
NodeID NodeID `json:"nodeId"` // Id of the element to set attribute for.
Name string `json:"name"` // Attribute name.
Value string `json:"value"` // Attribute value.
}
// NewSetAttributeValueArgs initializes SetAttributeValueArgs with the required arguments.
func NewSetAttributeValueArgs(nodeID NodeID, name string, value string) *SetAttributeValueArgs {
args := new(SetAttributeValueArgs)
args.NodeID = nodeID
args.Name = name
args.Value = value
return args
}
// SetAttributesAsTextArgs represents the arguments for SetAttributesAsText in the DOM domain.
type SetAttributesAsTextArgs struct {
NodeID NodeID `json:"nodeId"` // Id of the element to set attributes for.
Text string `json:"text"` // Text with a number of attributes. Will parse this text using HTML parser.
Name *string `json:"name,omitempty"` // Attribute name to replace with new attributes derived from text in case text parsed successfully.
}
// NewSetAttributesAsTextArgs initializes SetAttributesAsTextArgs with the required arguments.
func NewSetAttributesAsTextArgs(nodeID NodeID, text string) *SetAttributesAsTextArgs {
args := new(SetAttributesAsTextArgs)
args.NodeID = nodeID
args.Text = text
return args
}
// SetName sets the Name optional argument. Attribute name to replace
// with new attributes derived from text in case text parsed
// successfully.
func (a *SetAttributesAsTextArgs) SetName(name string) *SetAttributesAsTextArgs {
a.Name = &name
return a
}
// SetFileInputFilesArgs represents the arguments for SetFileInputFiles in the DOM domain.
type SetFileInputFilesArgs struct {
Files []string `json:"files"` // Array of file paths to set.
NodeID *NodeID `json:"nodeId,omitempty"` // Identifier of the node.
BackendNodeID *BackendNodeID `json:"backendNodeId,omitempty"` // Identifier of the backend node.
ObjectID *runtime.RemoteObjectID `json:"objectId,omitempty"` // JavaScript object id of the node wrapper.
}
// NewSetFileInputFilesArgs initializes SetFileInputFilesArgs with the required arguments.
func NewSetFileInputFilesArgs(files []string) *SetFileInputFilesArgs {
args := new(SetFileInputFilesArgs)
args.Files = files
return args
}
// SetNodeID sets the NodeID optional argument. Identifier of the
// node.
func (a *SetFileInputFilesArgs) SetNodeID(nodeID NodeID) *SetFileInputFilesArgs {
a.NodeID = &nodeID
return a
}
// SetBackendNodeID sets the BackendNodeID optional argument.
// Identifier of the backend node.
func (a *SetFileInputFilesArgs) SetBackendNodeID(backendNodeID BackendNodeID) *SetFileInputFilesArgs {
a.BackendNodeID = &backendNodeID
return a
}
// SetObjectID sets the ObjectID optional argument. JavaScript object
// id of the node wrapper.
func (a *SetFileInputFilesArgs) SetObjectID(objectID runtime.RemoteObjectID) *SetFileInputFilesArgs {
a.ObjectID = &objectID
return a
}
// SetNodeStackTracesEnabledArgs represents the arguments for SetNodeStackTracesEnabled in the DOM domain.
type SetNodeStackTracesEnabledArgs struct {
Enable bool `json:"enable"` // Enable or disable.
}
// NewSetNodeStackTracesEnabledArgs initializes SetNodeStackTracesEnabledArgs with the required arguments.
func NewSetNodeStackTracesEnabledArgs(enable bool) *SetNodeStackTracesEnabledArgs {
args := new(SetNodeStackTracesEnabledArgs)
args.Enable = enable
return args
}
// GetNodeStackTracesArgs represents the arguments for GetNodeStackTraces in the DOM domain.
type GetNodeStackTracesArgs struct {
NodeID NodeID `json:"nodeId"` // Id of the node to get stack traces for.
}
// NewGetNodeStackTracesArgs initializes GetNodeStackTracesArgs with the required arguments.
func NewGetNodeStackTracesArgs(nodeID NodeID) *GetNodeStackTracesArgs {
args := new(GetNodeStackTracesArgs)
args.NodeID = nodeID
return args
}
// GetNodeStackTracesReply represents the return values for GetNodeStackTraces in the DOM domain.
type GetNodeStackTracesReply struct {
Creation *runtime.StackTrace `json:"creation,omitempty"` // Creation stack trace, if available.
}
// GetFileInfoArgs represents the arguments for GetFileInfo in the DOM domain.
type GetFileInfoArgs struct {
ObjectID runtime.RemoteObjectID `json:"objectId"` // JavaScript object id of the node wrapper.
}
// NewGetFileInfoArgs initializes GetFileInfoArgs with the required arguments.
func NewGetFileInfoArgs(objectID runtime.RemoteObjectID) *GetFileInfoArgs {
args := new(GetFileInfoArgs)
args.ObjectID = objectID
return args
}
// GetFileInfoReply represents the return values for GetFileInfo in the DOM domain.
type GetFileInfoReply struct {
Path string `json:"path"` // No description.
}
// SetInspectedNodeArgs represents the arguments for SetInspectedNode in the DOM domain.
type SetInspectedNodeArgs struct {
NodeID NodeID `json:"nodeId"` // DOM node id to be accessible by means of $x command line API.
}
// NewSetInspectedNodeArgs initializes SetInspectedNodeArgs with the required arguments.
func NewSetInspectedNodeArgs(nodeID NodeID) *SetInspectedNodeArgs {
args := new(SetInspectedNodeArgs)
args.NodeID = nodeID
return args
}
// SetNodeNameArgs represents the arguments for SetNodeName in the DOM domain.
type SetNodeNameArgs struct {
NodeID NodeID `json:"nodeId"` // Id of the node to set name for.
Name string `json:"name"` // New node's name.
}
// NewSetNodeNameArgs initializes SetNodeNameArgs with the required arguments.
func NewSetNodeNameArgs(nodeID NodeID, name string) *SetNodeNameArgs {
args := new(SetNodeNameArgs)
args.NodeID = nodeID
args.Name = name
return args
}
// SetNodeNameReply represents the return values for SetNodeName in the DOM domain.
type SetNodeNameReply struct {
NodeID NodeID `json:"nodeId"` // New node's id.
}
// SetNodeValueArgs represents the arguments for SetNodeValue in the DOM domain.
type SetNodeValueArgs struct {
NodeID NodeID `json:"nodeId"` // Id of the node to set value for.
Value string `json:"value"` // New node's value.
}
// NewSetNodeValueArgs initializes SetNodeValueArgs with the required arguments.
func NewSetNodeValueArgs(nodeID NodeID, value string) *SetNodeValueArgs {
args := new(SetNodeValueArgs)
args.NodeID = nodeID
args.Value = value
return args
}
// SetOuterHTMLArgs represents the arguments for SetOuterHTML in the DOM domain.
type SetOuterHTMLArgs struct {
NodeID NodeID `json:"nodeId"` // Id of the node to set markup for.
OuterHTML string `json:"outerHTML"` // Outer HTML markup to set.
}
// NewSetOuterHTMLArgs initializes SetOuterHTMLArgs with the required arguments.
func NewSetOuterHTMLArgs(nodeID NodeID, outerHTML string) *SetOuterHTMLArgs {
args := new(SetOuterHTMLArgs)
args.NodeID = nodeID
args.OuterHTML = outerHTML
return args
}
// GetFrameOwnerArgs represents the arguments for GetFrameOwner in the DOM domain.
type GetFrameOwnerArgs struct {
FrameID internal.PageFrameID `json:"frameId"` // No description.
}
// NewGetFrameOwnerArgs initializes GetFrameOwnerArgs with the required arguments.
func NewGetFrameOwnerArgs(frameID internal.PageFrameID) *GetFrameOwnerArgs {
args := new(GetFrameOwnerArgs)
args.FrameID = frameID
return args
}
// GetFrameOwnerReply represents the return values for GetFrameOwner in the DOM domain.
type GetFrameOwnerReply struct {
BackendNodeID BackendNodeID `json:"backendNodeId"` // Resulting node.
NodeID *NodeID `json:"nodeId,omitempty"` // Id of the node at given coordinates, only when enabled and requested document.
}
// GetContainerForNodeArgs represents the arguments for GetContainerForNode in the DOM domain.
type GetContainerForNodeArgs struct {
NodeID NodeID `json:"nodeId"` // No description.
ContainerName *string `json:"containerName,omitempty"` // No description.
}
// NewGetContainerForNodeArgs initializes GetContainerForNodeArgs with the required arguments.
func NewGetContainerForNodeArgs(nodeID NodeID) *GetContainerForNodeArgs {
args := new(GetContainerForNodeArgs)
args.NodeID = nodeID
return args