-
Notifications
You must be signed in to change notification settings - Fork 45
/
cdp.go
5095 lines (4305 loc) · 172 KB
/
cdp.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 cdp
import (
"context"
"github.com/mafredri/cdp/protocol/accessibility"
"github.com/mafredri/cdp/protocol/animation"
"github.com/mafredri/cdp/protocol/audits"
"github.com/mafredri/cdp/protocol/autofill"
"github.com/mafredri/cdp/protocol/backgroundservice"
"github.com/mafredri/cdp/protocol/bluetoothemulation"
"github.com/mafredri/cdp/protocol/browser"
"github.com/mafredri/cdp/protocol/cachestorage"
"github.com/mafredri/cdp/protocol/cast"
"github.com/mafredri/cdp/protocol/console"
"github.com/mafredri/cdp/protocol/css"
"github.com/mafredri/cdp/protocol/database"
"github.com/mafredri/cdp/protocol/debugger"
"github.com/mafredri/cdp/protocol/deviceaccess"
"github.com/mafredri/cdp/protocol/deviceorientation"
"github.com/mafredri/cdp/protocol/dom"
"github.com/mafredri/cdp/protocol/domdebugger"
"github.com/mafredri/cdp/protocol/domsnapshot"
"github.com/mafredri/cdp/protocol/domstorage"
"github.com/mafredri/cdp/protocol/emulation"
"github.com/mafredri/cdp/protocol/eventbreakpoints"
"github.com/mafredri/cdp/protocol/extensions"
"github.com/mafredri/cdp/protocol/fedcm"
"github.com/mafredri/cdp/protocol/fetch"
"github.com/mafredri/cdp/protocol/filesystem"
"github.com/mafredri/cdp/protocol/headlessexperimental"
"github.com/mafredri/cdp/protocol/heapprofiler"
"github.com/mafredri/cdp/protocol/indexeddb"
"github.com/mafredri/cdp/protocol/input"
"github.com/mafredri/cdp/protocol/inspector"
"github.com/mafredri/cdp/protocol/io"
"github.com/mafredri/cdp/protocol/layertree"
"github.com/mafredri/cdp/protocol/log"
"github.com/mafredri/cdp/protocol/media"
"github.com/mafredri/cdp/protocol/memory"
"github.com/mafredri/cdp/protocol/network"
"github.com/mafredri/cdp/protocol/overlay"
"github.com/mafredri/cdp/protocol/page"
"github.com/mafredri/cdp/protocol/performance"
"github.com/mafredri/cdp/protocol/performancetimeline"
"github.com/mafredri/cdp/protocol/preload"
"github.com/mafredri/cdp/protocol/profiler"
"github.com/mafredri/cdp/protocol/pwa"
"github.com/mafredri/cdp/protocol/runtime"
"github.com/mafredri/cdp/protocol/schema"
"github.com/mafredri/cdp/protocol/security"
"github.com/mafredri/cdp/protocol/serviceworker"
"github.com/mafredri/cdp/protocol/storage"
"github.com/mafredri/cdp/protocol/systeminfo"
"github.com/mafredri/cdp/protocol/target"
"github.com/mafredri/cdp/protocol/tethering"
"github.com/mafredri/cdp/protocol/tracing"
"github.com/mafredri/cdp/protocol/webaudio"
"github.com/mafredri/cdp/protocol/webauthn"
)
// The Accessibility domain.
//
// Note: This domain is experimental.
type Accessibility interface {
// Command Disable
//
// Disables the accessibility domain.
Disable(context.Context) error
// Command Enable
//
// Enables the accessibility domain which causes `AXNodeId`s to remain
// consistent between method calls. This turns on accessibility for the
// page, which can impact performance until accessibility is disabled.
Enable(context.Context) error
// Command GetPartialAXTree
//
// Fetches the accessibility node and partial accessibility tree for
// this DOM node, if it exists.
//
// Note: This command is experimental.
GetPartialAXTree(context.Context, *accessibility.GetPartialAXTreeArgs) (*accessibility.GetPartialAXTreeReply, error)
// Command GetFullAXTree
//
// Fetches the entire accessibility tree for the root Document
//
// Note: This command is experimental.
GetFullAXTree(context.Context, *accessibility.GetFullAXTreeArgs) (*accessibility.GetFullAXTreeReply, error)
// Command GetRootAXNode
//
// Fetches the root node. Requires `enable()` to have been called
// previously.
//
// Note: This command is experimental.
GetRootAXNode(context.Context, *accessibility.GetRootAXNodeArgs) (*accessibility.GetRootAXNodeReply, error)
// Command GetAXNodeAndAncestors
//
// Fetches a node and all ancestors up to and including the root.
// Requires `enable()` to have been called previously.
//
// Note: This command is experimental.
GetAXNodeAndAncestors(context.Context, *accessibility.GetAXNodeAndAncestorsArgs) (*accessibility.GetAXNodeAndAncestorsReply, error)
// Command GetChildAXNodes
//
// Fetches a particular accessibility node by AXNodeId. Requires
// `enable()` to have been called previously.
//
// Note: This command is experimental.
GetChildAXNodes(context.Context, *accessibility.GetChildAXNodesArgs) (*accessibility.GetChildAXNodesReply, error)
// Command QueryAXTree
//
// Query a DOM node's accessibility subtree for accessible name and
// role. This command computes the name and role for all nodes in the
// subtree, including those that are ignored for accessibility, and
// returns those that match the specified name and role. If no DOM node
// is specified, or the DOM node does not exist, the command returns an
// error. If neither `accessibleName` or `role` is specified, it
// returns all the accessibility nodes in the subtree.
//
// Note: This command is experimental.
QueryAXTree(context.Context, *accessibility.QueryAXTreeArgs) (*accessibility.QueryAXTreeReply, error)
// Event LoadComplete
//
// The loadComplete event mirrors the load complete event sent by the
// browser to assistive technology when the web page has finished
// loading.
//
// Note: This event is experimental.
LoadComplete(context.Context) (accessibility.LoadCompleteClient, error)
// Event NodesUpdated
//
// The nodesUpdated event is sent every time a previously requested
// node has changed the in tree.
//
// Note: This event is experimental.
NodesUpdated(context.Context) (accessibility.NodesUpdatedClient, error)
}
// The Animation domain.
//
// Note: This domain is experimental.
type Animation interface {
// Command Disable
//
// Disables animation domain notifications.
Disable(context.Context) error
// Command Enable
//
// Enables animation domain notifications.
Enable(context.Context) error
// Command GetCurrentTime
//
// Returns the current time of the an animation.
GetCurrentTime(context.Context, *animation.GetCurrentTimeArgs) (*animation.GetCurrentTimeReply, error)
// Command GetPlaybackRate
//
// Gets the playback rate of the document timeline.
GetPlaybackRate(context.Context) (*animation.GetPlaybackRateReply, error)
// Command ReleaseAnimations
//
// Releases a set of animations to no longer be manipulated.
ReleaseAnimations(context.Context, *animation.ReleaseAnimationsArgs) error
// Command ResolveAnimation
//
// Gets the remote object of the Animation.
ResolveAnimation(context.Context, *animation.ResolveAnimationArgs) (*animation.ResolveAnimationReply, error)
// Command SeekAnimations
//
// Seek a set of animations to a particular time within each
// animation.
SeekAnimations(context.Context, *animation.SeekAnimationsArgs) error
// Command SetPaused
//
// Sets the paused state of a set of animations.
SetPaused(context.Context, *animation.SetPausedArgs) error
// Command SetPlaybackRate
//
// Sets the playback rate of the document timeline.
SetPlaybackRate(context.Context, *animation.SetPlaybackRateArgs) error
// Command SetTiming
//
// Sets the timing of an animation node.
SetTiming(context.Context, *animation.SetTimingArgs) error
// Event AnimationCanceled
//
// Event for when an animation has been canceled.
AnimationCanceled(context.Context) (animation.CanceledClient, error)
// Event AnimationCreated
//
// Event for each animation that has been created.
AnimationCreated(context.Context) (animation.CreatedClient, error)
// Event AnimationStarted
//
// Event for animation that has been started.
AnimationStarted(context.Context) (animation.StartedClient, error)
// Event AnimationUpdated
//
// Event for animation that has been updated.
AnimationUpdated(context.Context) (animation.UpdatedClient, error)
}
// The Audits domain. Audits domain allows investigation of page violations
// and possible improvements.
//
// Note: This domain is experimental.
type Audits interface {
// Command GetEncodedResponse
//
// Returns the response body and size if it were re-encoded with the
// specified settings. Only applies to images.
GetEncodedResponse(context.Context, *audits.GetEncodedResponseArgs) (*audits.GetEncodedResponseReply, error)
// Command Disable
//
// Disables issues domain, prevents further issues from being reported
// to the client.
Disable(context.Context) error
// Command Enable
//
// Enables issues domain, sends the issues collected so far to the
// client by means of the `issueAdded` event.
Enable(context.Context) error
// Command CheckContrast
//
// Runs the contrast check for the target page. Found issues are
// reported using Audits.issueAdded event.
CheckContrast(context.Context, *audits.CheckContrastArgs) error
// Command CheckFormsIssues
//
// Runs the form issues check for the target page. Found issues are
// reported using Audits.issueAdded event.
CheckFormsIssues(context.Context) (*audits.CheckFormsIssuesReply, error)
// Event IssueAdded
IssueAdded(context.Context) (audits.IssueAddedClient, error)
}
// The Autofill domain. Defines commands and events for Autofill.
//
// Note: This domain is experimental.
type Autofill interface {
// Command Trigger
//
// Trigger autofill on a form identified by the fieldId. If the field
// and related form cannot be autofilled, returns an error.
Trigger(context.Context, *autofill.TriggerArgs) error
// Command SetAddresses
//
// Set addresses so that developers can verify their forms
// implementation.
SetAddresses(context.Context, *autofill.SetAddressesArgs) error
// Command Disable
//
// Disables autofill domain notifications.
Disable(context.Context) error
// Command Enable
//
// Enables autofill domain notifications.
Enable(context.Context) error
// Event AddressFormFilled
//
// Emitted when an address form is filled.
AddressFormFilled(context.Context) (autofill.AddressFormFilledClient, error)
}
// The BackgroundService domain. Defines events for background web platform
// features.
//
// Note: This domain is experimental.
type BackgroundService interface {
// Command StartObserving
//
// Enables event updates for the service.
StartObserving(context.Context, *backgroundservice.StartObservingArgs) error
// Command StopObserving
//
// Disables event updates for the service.
StopObserving(context.Context, *backgroundservice.StopObservingArgs) error
// Command SetRecording
//
// Set the recording state for the service.
SetRecording(context.Context, *backgroundservice.SetRecordingArgs) error
// Command ClearEvents
//
// Clears all stored data for the service.
ClearEvents(context.Context, *backgroundservice.ClearEventsArgs) error
// Event RecordingStateChanged
//
// Called when the recording state for the service has been updated.
RecordingStateChanged(context.Context) (backgroundservice.RecordingStateChangedClient, error)
// Event BackgroundServiceEventReceived
//
// Called with all existing backgroundServiceEvents when enabled, and
// all new events afterwards if enabled and recording.
BackgroundServiceEventReceived(context.Context) (backgroundservice.EventReceivedClient, error)
}
// The BluetoothEmulation domain. This domain allows configuring virtual
// Bluetooth devices to test the web-bluetooth API.
//
// Note: This domain is experimental.
type BluetoothEmulation interface {
// Command Enable
//
// Enable the BluetoothEmulation domain.
Enable(context.Context, *bluetoothemulation.EnableArgs) error
// Command Disable
//
// Disable the BluetoothEmulation domain.
Disable(context.Context) error
// Command SimulatePreconnectedPeripheral
//
// Simulates a peripheral with |address|, |name| and
// |knownServiceUuids| that has already been connected to the system.
SimulatePreconnectedPeripheral(context.Context, *bluetoothemulation.SimulatePreconnectedPeripheralArgs) error
// Command SimulateAdvertisement
//
// Simulates an advertisement packet described in |entry| being
// received by the central.
SimulateAdvertisement(context.Context, *bluetoothemulation.SimulateAdvertisementArgs) error
}
// The Browser domain. The Browser domain defines methods and events for
// browser managing.
type Browser interface {
// Command SetPermission
//
// Set permission settings for given origin.
//
// Note: This command is experimental.
SetPermission(context.Context, *browser.SetPermissionArgs) error
// Command GrantPermissions
//
// Grant specific permissions to the given origin and reject all
// others.
//
// Note: This command is experimental.
GrantPermissions(context.Context, *browser.GrantPermissionsArgs) error
// Command ResetPermissions
//
// Reset all permission management for all origins.
ResetPermissions(context.Context, *browser.ResetPermissionsArgs) error
// Command SetDownloadBehavior
//
// Set the behavior when downloading a file.
//
// Note: This command is experimental.
SetDownloadBehavior(context.Context, *browser.SetDownloadBehaviorArgs) error
// Command CancelDownload
//
// Cancel a download if in progress
//
// Note: This command is experimental.
CancelDownload(context.Context, *browser.CancelDownloadArgs) error
// Command Close
//
// Close browser gracefully.
Close(context.Context) error
// Command Crash
//
// Crashes browser on the main thread.
//
// Note: This command is experimental.
Crash(context.Context) error
// Command CrashGPUProcess
//
// Crashes GPU process.
//
// Note: This command is experimental.
CrashGPUProcess(context.Context) error
// Command GetVersion
//
// Returns version information.
GetVersion(context.Context) (*browser.GetVersionReply, error)
// Command GetBrowserCommandLine
//
// Returns the command line switches for the browser process if, and
// only if --enable-automation is on the commandline.
//
// Note: This command is experimental.
GetBrowserCommandLine(context.Context) (*browser.GetBrowserCommandLineReply, error)
// Command GetHistograms
//
// Get Chrome histograms.
//
// Note: This command is experimental.
GetHistograms(context.Context, *browser.GetHistogramsArgs) (*browser.GetHistogramsReply, error)
// Command GetHistogram
//
// Get a Chrome histogram by name.
//
// Note: This command is experimental.
GetHistogram(context.Context, *browser.GetHistogramArgs) (*browser.GetHistogramReply, error)
// Command GetWindowBounds
//
// Get position and size of the browser window.
//
// Note: This command is experimental.
GetWindowBounds(context.Context, *browser.GetWindowBoundsArgs) (*browser.GetWindowBoundsReply, error)
// Command GetWindowForTarget
//
// Get the browser window that contains the devtools target.
//
// Note: This command is experimental.
GetWindowForTarget(context.Context, *browser.GetWindowForTargetArgs) (*browser.GetWindowForTargetReply, error)
// Command SetWindowBounds
//
// Set position and/or size of the browser window.
//
// Note: This command is experimental.
SetWindowBounds(context.Context, *browser.SetWindowBoundsArgs) error
// Command SetDockTile
//
// Set dock tile details, platform-specific.
//
// Note: This command is experimental.
SetDockTile(context.Context, *browser.SetDockTileArgs) error
// Command ExecuteBrowserCommand
//
// Invoke custom browser commands used by telemetry.
//
// Note: This command is experimental.
ExecuteBrowserCommand(context.Context, *browser.ExecuteBrowserCommandArgs) error
// Command AddPrivacySandboxEnrollmentOverride
//
// Allows a site to use privacy sandbox features that require
// enrollment without the site actually being enrolled. Only supported
// on page targets.
AddPrivacySandboxEnrollmentOverride(context.Context, *browser.AddPrivacySandboxEnrollmentOverrideArgs) error
// Event DownloadWillBegin
//
// Fired when page is about to start a download.
//
// Note: This event is experimental.
DownloadWillBegin(context.Context) (browser.DownloadWillBeginClient, error)
// Event DownloadProgress
//
// Fired when download makes progress. Last call has |done| == true.
//
// Note: This event is experimental.
DownloadProgress(context.Context) (browser.DownloadProgressClient, error)
}
// The CSS domain. This domain exposes CSS read/write operations. All CSS
// objects (stylesheets, rules, and styles) have an associated `id` used in
// subsequent operations on the related object. Each object type has a specific
// `id` structure, and those are not interchangeable between objects of
// different kinds. CSS objects can be loaded using the `get*ForNode()` calls
// (which accept a DOM node id). A client can also keep track of stylesheets
// via the `styleSheetAdded`/`styleSheetRemoved` events and subsequently load
// the required stylesheet contents using the `getStyleSheet[Text]()` methods.
//
// Note: This domain is experimental.
type CSS interface {
// Command AddRule
//
// Inserts a new rule with the given `ruleText` in a stylesheet with
// given `styleSheetId`, at the position specified by `location`.
AddRule(context.Context, *css.AddRuleArgs) (*css.AddRuleReply, error)
// Command CollectClassNames
//
// Returns all class names from specified stylesheet.
CollectClassNames(context.Context, *css.CollectClassNamesArgs) (*css.CollectClassNamesReply, error)
// Command CreateStyleSheet
//
// Creates a new special "via-inspector" stylesheet in the frame with
// given `frameId`.
CreateStyleSheet(context.Context, *css.CreateStyleSheetArgs) (*css.CreateStyleSheetReply, error)
// Command Disable
//
// Disables the CSS agent for the given page.
Disable(context.Context) error
// Command Enable
//
// Enables the CSS agent for the given page. Clients should not assume
// that the CSS agent has been enabled until the result of this command
// is received.
Enable(context.Context) error
// Command ForcePseudoState
//
// Ensures that the given node will have specified pseudo-classes
// whenever its style is computed by the browser.
ForcePseudoState(context.Context, *css.ForcePseudoStateArgs) error
// Command GetBackgroundColors
GetBackgroundColors(context.Context, *css.GetBackgroundColorsArgs) (*css.GetBackgroundColorsReply, error)
// Command GetComputedStyleForNode
//
// Returns the computed style for a DOM node identified by `nodeId`.
GetComputedStyleForNode(context.Context, *css.GetComputedStyleForNodeArgs) (*css.GetComputedStyleForNodeReply, error)
// Command GetInlineStylesForNode
//
// Returns the styles defined inline (explicitly in the "style"
// attribute and implicitly, using DOM attributes) for a DOM node
// identified by `nodeId`.
GetInlineStylesForNode(context.Context, *css.GetInlineStylesForNodeArgs) (*css.GetInlineStylesForNodeReply, error)
// Command GetMatchedStylesForNode
//
// Returns requested styles for a DOM node identified by `nodeId`.
GetMatchedStylesForNode(context.Context, *css.GetMatchedStylesForNodeArgs) (*css.GetMatchedStylesForNodeReply, error)
// Command GetMediaQueries
//
// Returns all media queries parsed by the rendering engine.
GetMediaQueries(context.Context) (*css.GetMediaQueriesReply, error)
// Command GetPlatformFontsForNode
//
// Requests information about platform fonts which we used to render
// child TextNodes in the given node.
GetPlatformFontsForNode(context.Context, *css.GetPlatformFontsForNodeArgs) (*css.GetPlatformFontsForNodeReply, error)
// Command GetStyleSheetText
//
// Returns the current textual content for a stylesheet.
GetStyleSheetText(context.Context, *css.GetStyleSheetTextArgs) (*css.GetStyleSheetTextReply, error)
// Command GetLayersForNode
//
// Returns all layers parsed by the rendering engine for the tree
// scope of a node. Given a DOM element identified by nodeId,
// getLayersForNode returns the root layer for the nearest ancestor
// document or shadow root. The layer root contains the full layer tree
// for the tree scope and their ordering.
//
// Note: This command is experimental.
GetLayersForNode(context.Context, *css.GetLayersForNodeArgs) (*css.GetLayersForNodeReply, error)
// Command GetLocationForSelector
//
// Given a CSS selector text and a style sheet ID,
// getLocationForSelector returns an array of locations of the CSS
// selector in the style sheet.
//
// Note: This command is experimental.
GetLocationForSelector(context.Context, *css.GetLocationForSelectorArgs) (*css.GetLocationForSelectorReply, error)
// Command TrackComputedStyleUpdates
//
// Starts tracking the given computed styles for updates. The
// specified array of properties replaces the one previously specified.
// Pass empty array to disable tracking. Use takeComputedStyleUpdates
// to retrieve the list of nodes that had properties modified. The
// changes to computed style properties are only tracked for nodes
// pushed to the front-end by the DOM agent. If no changes to the
// tracked properties occur after the node has been pushed to the
// front-end, no updates will be issued for the node.
//
// Note: This command is experimental.
TrackComputedStyleUpdates(context.Context, *css.TrackComputedStyleUpdatesArgs) error
// Command TakeComputedStyleUpdates
//
// Polls the next batch of computed style updates.
//
// Note: This command is experimental.
TakeComputedStyleUpdates(context.Context) (*css.TakeComputedStyleUpdatesReply, error)
// Command SetEffectivePropertyValueForNode
//
// Find a rule with the given active property for the given node and
// set the new value for this property
SetEffectivePropertyValueForNode(context.Context, *css.SetEffectivePropertyValueForNodeArgs) error
// Command SetPropertyRulePropertyName
//
// Modifies the property rule property name.
SetPropertyRulePropertyName(context.Context, *css.SetPropertyRulePropertyNameArgs) (*css.SetPropertyRulePropertyNameReply, error)
// Command SetKeyframeKey
//
// Modifies the keyframe rule key text.
SetKeyframeKey(context.Context, *css.SetKeyframeKeyArgs) (*css.SetKeyframeKeyReply, error)
// Command SetMediaText
//
// Modifies the rule selector.
SetMediaText(context.Context, *css.SetMediaTextArgs) (*css.SetMediaTextReply, error)
// Command SetContainerQueryText
//
// Modifies the expression of a container query.
//
// Note: This command is experimental.
SetContainerQueryText(context.Context, *css.SetContainerQueryTextArgs) (*css.SetContainerQueryTextReply, error)
// Command SetSupportsText
//
// Modifies the expression of a supports at-rule.
//
// Note: This command is experimental.
SetSupportsText(context.Context, *css.SetSupportsTextArgs) (*css.SetSupportsTextReply, error)
// Command SetScopeText
//
// Modifies the expression of a scope at-rule.
//
// Note: This command is experimental.
SetScopeText(context.Context, *css.SetScopeTextArgs) (*css.SetScopeTextReply, error)
// Command SetRuleSelector
//
// Modifies the rule selector.
SetRuleSelector(context.Context, *css.SetRuleSelectorArgs) (*css.SetRuleSelectorReply, error)
// Command SetStyleSheetText
//
// Sets the new stylesheet text.
SetStyleSheetText(context.Context, *css.SetStyleSheetTextArgs) (*css.SetStyleSheetTextReply, error)
// Command SetStyleTexts
//
// Applies specified style edits one after another in the given order.
SetStyleTexts(context.Context, *css.SetStyleTextsArgs) (*css.SetStyleTextsReply, error)
// Command StartRuleUsageTracking
//
// Enables the selector recording.
StartRuleUsageTracking(context.Context) error
// Command StopRuleUsageTracking
//
// Stop tracking rule usage and return the list of rules that were
// used since last call to `takeCoverageDelta` (or since start of
// coverage instrumentation).
StopRuleUsageTracking(context.Context) (*css.StopRuleUsageTrackingReply, error)
// Command TakeCoverageDelta
//
// Obtain list of rules that became used since last call to this
// method (or since start of coverage instrumentation).
TakeCoverageDelta(context.Context) (*css.TakeCoverageDeltaReply, error)
// Command SetLocalFontsEnabled
//
// Enables/disables rendering of local CSS fonts (enabled by default).
//
// Note: This command is experimental.
SetLocalFontsEnabled(context.Context, *css.SetLocalFontsEnabledArgs) error
// Event FontsUpdated
//
// Fires whenever a web font is updated. A non-empty font parameter
// indicates a successfully loaded web font.
FontsUpdated(context.Context) (css.FontsUpdatedClient, error)
// Event MediaQueryResultChanged
//
// Fires whenever a MediaQuery result changes (for example, after a
// browser window has been resized.) The current implementation
// considers only viewport-dependent media features.
MediaQueryResultChanged(context.Context) (css.MediaQueryResultChangedClient, error)
// Event StyleSheetAdded
//
// Fired whenever an active document stylesheet is added.
StyleSheetAdded(context.Context) (css.StyleSheetAddedClient, error)
// Event StyleSheetChanged
//
// Fired whenever a stylesheet is changed as a result of the client
// operation.
StyleSheetChanged(context.Context) (css.StyleSheetChangedClient, error)
// Event StyleSheetRemoved
//
// Fired whenever an active document stylesheet is removed.
StyleSheetRemoved(context.Context) (css.StyleSheetRemovedClient, error)
}
// The CacheStorage domain.
//
// Note: This domain is experimental.
type CacheStorage interface {
// Command DeleteCache
//
// Deletes a cache.
DeleteCache(context.Context, *cachestorage.DeleteCacheArgs) error
// Command DeleteEntry
//
// Deletes a cache entry.
DeleteEntry(context.Context, *cachestorage.DeleteEntryArgs) error
// Command RequestCacheNames
//
// Requests cache names.
RequestCacheNames(context.Context, *cachestorage.RequestCacheNamesArgs) (*cachestorage.RequestCacheNamesReply, error)
// Command RequestCachedResponse
//
// Fetches cache entry.
RequestCachedResponse(context.Context, *cachestorage.RequestCachedResponseArgs) (*cachestorage.RequestCachedResponseReply, error)
// Command RequestEntries
//
// Requests data from cache.
RequestEntries(context.Context, *cachestorage.RequestEntriesArgs) (*cachestorage.RequestEntriesReply, error)
}
// The Cast domain. A domain for interacting with Cast, Presentation API, and
// Remote Playback API functionalities.
//
// Note: This domain is experimental.
type Cast interface {
// Command Enable
//
// Starts observing for sinks that can be used for tab mirroring, and
// if set, sinks compatible with |presentationUrl| as well. When sinks
// are found, a |sinksUpdated| event is fired. Also starts observing
// for issue messages. When an issue is added or removed, an
// |issueUpdated| event is fired.
Enable(context.Context, *cast.EnableArgs) error
// Command Disable
//
// Stops observing for sinks and issues.
Disable(context.Context) error
// Command SetSinkToUse
//
// Sets a sink to be used when the web page requests the browser to
// choose a sink via Presentation API, Remote Playback API, or Cast
// SDK.
SetSinkToUse(context.Context, *cast.SetSinkToUseArgs) error
// Command StartDesktopMirroring
//
// Starts mirroring the desktop to the sink.
StartDesktopMirroring(context.Context, *cast.StartDesktopMirroringArgs) error
// Command StartTabMirroring
//
// Starts mirroring the tab to the sink.
StartTabMirroring(context.Context, *cast.StartTabMirroringArgs) error
// Command StopCasting
//
// Stops the active Cast session on the sink.
StopCasting(context.Context, *cast.StopCastingArgs) error
// Event SinksUpdated
//
// This is fired whenever the list of available sinks changes. A sink
// is a device or a software surface that you can cast to.
SinksUpdated(context.Context) (cast.SinksUpdatedClient, error)
// Event IssueUpdated
//
// This is fired whenever the outstanding issue/error message changes.
// |issueMessage| is empty if there is no issue.
IssueUpdated(context.Context) (cast.IssueUpdatedClient, error)
}
// The Console domain.
//
// Deprecated: This domain is deprecated - use Runtime or Log instead.
type Console interface {
// Command ClearMessages
//
// Does nothing.
ClearMessages(context.Context) error
// Command Disable
//
// Disables console domain, prevents further console messages from
// being reported to the client.
Disable(context.Context) error
// Command Enable
//
// Enables console domain, sends the messages collected so far to the
// client by means of the `messageAdded` notification.
Enable(context.Context) error
// Event MessageAdded
//
// Issued when new console message is added.
MessageAdded(context.Context) (console.MessageAddedClient, error)
}
// The DOM domain. This domain exposes DOM read/write operations. Each DOM
// Node is represented with its mirror object that has an `id`. This `id` can
// be used to get additional information on the Node, resolve it into the
// JavaScript object wrapper, etc. It is important that client receives DOM
// events only for the nodes that are known to the client. Backend keeps track
// of the nodes that were sent to the client and never sends the same node
// twice. It is client's responsibility to collect information about the nodes
// that were sent to the client. Note that `iframe` owner elements will return
// corresponding document elements as their child nodes.
type DOM interface {
// Command CollectClassNamesFromSubtree
//
// Collects class names for the node with given id and all of it's
// child nodes.
//
// Note: This command is experimental.
CollectClassNamesFromSubtree(context.Context, *dom.CollectClassNamesFromSubtreeArgs) (*dom.CollectClassNamesFromSubtreeReply, error)
// Command CopyTo
//
// Creates a deep copy of the specified node and places it into the
// target container before the given anchor.
//
// Note: This command is experimental.
CopyTo(context.Context, *dom.CopyToArgs) (*dom.CopyToReply, error)
// Command DescribeNode
//
// Describes node given its id, does not require domain to be enabled.
// Does not start tracking any objects, can be used for automation.
DescribeNode(context.Context, *dom.DescribeNodeArgs) (*dom.DescribeNodeReply, error)
// Command ScrollIntoViewIfNeeded
//
// Scrolls the specified rect of the given node into view if not
// already visible. Note: exactly one between nodeId, backendNodeId and
// objectId should be passed to identify the node.
ScrollIntoViewIfNeeded(context.Context, *dom.ScrollIntoViewIfNeededArgs) error
// Command Disable
//
// Disables DOM agent for the given page.
Disable(context.Context) error
// Command DiscardSearchResults
//
// Discards search results from the session with the given id.
// `getSearchResults` should no longer be called for that search.
//
// Note: This command is experimental.
DiscardSearchResults(context.Context, *dom.DiscardSearchResultsArgs) error
// Command Enable
//
// Enables DOM agent for the given page.
Enable(context.Context, *dom.EnableArgs) error
// Command Focus
//
// Focuses the given element.
Focus(context.Context, *dom.FocusArgs) error
// Command GetAttributes
//
// Returns attributes for the specified node.
GetAttributes(context.Context, *dom.GetAttributesArgs) (*dom.GetAttributesReply, error)
// Command GetBoxModel
//
// Returns boxes for the given node.
GetBoxModel(context.Context, *dom.GetBoxModelArgs) (*dom.GetBoxModelReply, error)
// Command GetContentQuads
//
// Returns quads that describe node position on the page. This method
// might return multiple quads for inline nodes.
//
// Note: This command is experimental.
GetContentQuads(context.Context, *dom.GetContentQuadsArgs) (*dom.GetContentQuadsReply, error)
// Command GetDocument
//
// Returns the root DOM node (and optionally the subtree) to the
// caller. Implicitly enables the DOM domain events for the current
// target.
GetDocument(context.Context, *dom.GetDocumentArgs) (*dom.GetDocumentReply, error)
// Command GetFlattenedDocument
//
// Deprecated: Returns the root DOM node (and optionally the subtree)
// to the caller. as it is not designed to work well with
// the rest of the DOM agent. Use DOMSnapshot.captureSnapshot instead.
GetFlattenedDocument(context.Context, *dom.GetFlattenedDocumentArgs) (*dom.GetFlattenedDocumentReply, error)
// Command GetNodesForSubtreeByStyle
//
// Finds nodes with a given computed style in a subtree.
//
// Note: This command is experimental.
GetNodesForSubtreeByStyle(context.Context, *dom.GetNodesForSubtreeByStyleArgs) (*dom.GetNodesForSubtreeByStyleReply, error)
// Command GetNodeForLocation
//
// Returns node id at given location. Depending on whether DOM domain
// is enabled, nodeId is either returned or not.
GetNodeForLocation(context.Context, *dom.GetNodeForLocationArgs) (*dom.GetNodeForLocationReply, error)
// Command GetOuterHTML
//
// Returns node's HTML markup.
GetOuterHTML(context.Context, *dom.GetOuterHTMLArgs) (*dom.GetOuterHTMLReply, error)
// Command GetRelayoutBoundary
//
// Returns the id of the nearest ancestor that is a relayout boundary.
//
// Note: This command is experimental.
GetRelayoutBoundary(context.Context, *dom.GetRelayoutBoundaryArgs) (*dom.GetRelayoutBoundaryReply, error)
// Command GetSearchResults
//
// Returns search results from given `fromIndex` to given `toIndex`
// from the search with the given identifier.
//
// Note: This command is experimental.
GetSearchResults(context.Context, *dom.GetSearchResultsArgs) (*dom.GetSearchResultsReply, error)
// Command MarkUndoableState
//
// Marks last undoable state.
//
// Note: This command is experimental.
MarkUndoableState(context.Context) error
// Command MoveTo
//
// Moves node into the new container, places it before the given
// anchor.
MoveTo(context.Context, *dom.MoveToArgs) (*dom.MoveToReply, error)
// Command PerformSearch
//
// Searches for a given string in the DOM tree. Use `getSearchResults`
// to access search results or `cancelSearch` to end this search
// session.
//
// Note: This command is experimental.
PerformSearch(context.Context, *dom.PerformSearchArgs) (*dom.PerformSearchReply, error)
// Command PushNodeByPathToFrontend
//
// Requests that the node is sent to the caller given its path. //
// FIXME, use XPath