-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcdp_emulation.ml
More file actions
816 lines (573 loc) · 30.1 KB
/
Copy pathcdp_emulation.ml
File metadata and controls
816 lines (573 loc) · 30.1 KB
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
(* Generated by cdp-gen from Chrome DevTools Protocol r1687809. DO NOT EDIT. *)
include Cdp_emulation_types
open Jsonkit.Primitives
module Can_emulate = struct
let name = "Emulation.canEmulate"
type result = { result : bool [@key "result"] } [@@allow_extra_fields] [@@deriving json, show, eq]
let command : result Cdp_command.t = { Cdp_command.name; params = None; parse = result_of_json }
end
[@@ocaml.deprecated "deprecated in CDP"]
module Clear_device_metrics_override = struct
let name = "Emulation.clearDeviceMetricsOverride"
type result = unit [@@deriving show, eq]
let result_of_json (_ignored_payload : Cdp_json.t) : result = ()
let command : result Cdp_command.t = { Cdp_command.name; params = None; parse = result_of_json }
end
module Clear_geolocation_override = struct
let name = "Emulation.clearGeolocationOverride"
type result = unit [@@deriving show, eq]
let result_of_json (_ignored_payload : Cdp_json.t) : result = ()
let command : result Cdp_command.t = { Cdp_command.name; params = None; parse = result_of_json }
end
module Reset_page_scale_factor = struct
let name = "Emulation.resetPageScaleFactor"
type result = unit [@@deriving show, eq]
let result_of_json (_ignored_payload : Cdp_json.t) : result = ()
let command : result Cdp_command.t = { Cdp_command.name; params = None; parse = result_of_json }
end
[@@alert experimental "experimental in CDP, may change with Chrome"]
module Set_focus_emulation_enabled = struct
let name = "Emulation.setFocusEmulationEnabled"
type params = { enabled : bool [@key "enabled"] } [@@allow_extra_fields] [@@deriving json, show, eq, make]
type result = unit [@@deriving show, eq]
let result_of_json (_ignored_payload : Cdp_json.t) : result = ()
let command params : result Cdp_command.t =
{ Cdp_command.name; params = Some (params_to_json params); parse = result_of_json }
end
[@@alert experimental "experimental in CDP, may change with Chrome"]
module Set_auto_dark_mode_override = struct
let name = "Emulation.setAutoDarkModeOverride"
type params = { enabled : bool option [@key "enabled"] [@option] [@json.drop_default] }
[@@allow_extra_fields] [@@deriving json, show, eq, make]
type result = unit [@@deriving show, eq]
let result_of_json (_ignored_payload : Cdp_json.t) : result = ()
let command params : result Cdp_command.t =
{ Cdp_command.name; params = Some (params_to_json params); parse = result_of_json }
end
[@@alert experimental "experimental in CDP, may change with Chrome"]
module Set_cpu_throttling_rate = struct
let name = "Emulation.setCPUThrottlingRate"
type params = { rate : float [@key "rate"] } [@@allow_extra_fields] [@@deriving json, show, eq, make]
type result = unit [@@deriving show, eq]
let result_of_json (_ignored_payload : Cdp_json.t) : result = ()
let command params : result Cdp_command.t =
{ Cdp_command.name; params = Some (params_to_json params); parse = result_of_json }
end
module Set_default_background_color_override = struct
let name = "Emulation.setDefaultBackgroundColorOverride"
type params = { color : Cdp_dom_types.rgba option [@key "color"] [@option] [@json.drop_default] }
[@@allow_extra_fields] [@@deriving json, show, eq, make]
type result = unit [@@deriving show, eq]
let result_of_json (_ignored_payload : Cdp_json.t) : result = ()
let command params : result Cdp_command.t =
{ Cdp_command.name; params = Some (params_to_json params); parse = result_of_json }
end
module Set_safe_area_insets_override = struct
let name = "Emulation.setSafeAreaInsetsOverride"
type params = { insets : safe_area_insets [@key "insets"] } [@@allow_extra_fields] [@@deriving json, show, eq, make]
type result = unit [@@deriving show, eq]
let result_of_json (_ignored_payload : Cdp_json.t) : result = ()
let command params : result Cdp_command.t =
{ Cdp_command.name; params = Some (params_to_json params); parse = result_of_json }
end
[@@alert experimental "experimental in CDP, may change with Chrome"]
module Set_virtual_keyboard_geometry_override = struct
let name = "Emulation.setVirtualKeyboardGeometryOverride"
type params = { keyboard_rect : Cdp_dom_types.rect option [@key "keyboardRect"] [@option] [@json.drop_default] }
[@@allow_extra_fields] [@@deriving json, show, eq, make]
type result = unit [@@deriving show, eq]
let result_of_json (_ignored_payload : Cdp_json.t) : result = ()
let command params : result Cdp_command.t =
{ Cdp_command.name; params = Some (params_to_json params); parse = result_of_json }
end
[@@alert experimental "experimental in CDP, may change with Chrome"]
module Set_device_metrics_override = struct
let name = "Emulation.setDeviceMetricsOverride"
type scrollbar_type =
| Overlay [@json.name "overlay"]
| Default [@json.name "default"]
| Other of Cdp_json.unknown [@json.catch_all]
[@@compact_variants] [@@deriving json, show, eq]
type params = {
width : int; [@key "width"]
height : int; [@key "height"]
device_scale_factor : float; [@key "deviceScaleFactor"]
mobile : bool; [@key "mobile"]
scale : float option; [@key "scale"] [@option] [@json.drop_default]
screen_width : int option; [@key "screenWidth"] [@option] [@json.drop_default]
screen_height : int option; [@key "screenHeight"] [@option] [@json.drop_default]
position_x : int option; [@key "positionX"] [@option] [@json.drop_default]
position_y : int option; [@key "positionY"] [@option] [@json.drop_default]
dont_set_visible_size : bool option; [@key "dontSetVisibleSize"] [@option] [@json.drop_default]
screen_orientation : screen_orientation option; [@key "screenOrientation"] [@option] [@json.drop_default]
viewport : Cdp_page_types.viewport option; [@key "viewport"] [@option] [@json.drop_default]
display_feature : display_feature option; [@key "displayFeature"] [@option] [@json.drop_default]
device_posture : device_posture option; [@key "devicePosture"] [@option] [@json.drop_default]
scrollbar_type : scrollbar_type option; [@key "scrollbarType"] [@option] [@json.drop_default]
screen_orientation_lock_emulation : bool option;
[@key "screenOrientationLockEmulation"] [@option] [@json.drop_default]
}
[@@allow_extra_fields] [@@deriving json, show, eq, make]
type result = unit [@@deriving show, eq]
let result_of_json (_ignored_payload : Cdp_json.t) : result = ()
let command params : result Cdp_command.t =
{ Cdp_command.name; params = Some (params_to_json params); parse = result_of_json }
end
module Set_device_posture_override = struct
let name = "Emulation.setDevicePostureOverride"
type params = { posture : device_posture [@key "posture"] } [@@allow_extra_fields] [@@deriving json, show, eq, make]
type result = unit [@@deriving show, eq]
let result_of_json (_ignored_payload : Cdp_json.t) : result = ()
let command params : result Cdp_command.t =
{ Cdp_command.name; params = Some (params_to_json params); parse = result_of_json }
end
[@@alert experimental "experimental in CDP, may change with Chrome"]
module Clear_device_posture_override = struct
let name = "Emulation.clearDevicePostureOverride"
type result = unit [@@deriving show, eq]
let result_of_json (_ignored_payload : Cdp_json.t) : result = ()
let command : result Cdp_command.t = { Cdp_command.name; params = None; parse = result_of_json }
end
[@@alert experimental "experimental in CDP, may change with Chrome"]
module Set_display_features_override = struct
let name = "Emulation.setDisplayFeaturesOverride"
type params = { features : display_feature list [@key "features"] }
[@@allow_extra_fields] [@@deriving json, show, eq, make]
type result = unit [@@deriving show, eq]
let result_of_json (_ignored_payload : Cdp_json.t) : result = ()
let command params : result Cdp_command.t =
{ Cdp_command.name; params = Some (params_to_json params); parse = result_of_json }
end
[@@alert experimental "experimental in CDP, may change with Chrome"]
module Clear_display_features_override = struct
let name = "Emulation.clearDisplayFeaturesOverride"
type result = unit [@@deriving show, eq]
let result_of_json (_ignored_payload : Cdp_json.t) : result = ()
let command : result Cdp_command.t = { Cdp_command.name; params = None; parse = result_of_json }
end
[@@alert experimental "experimental in CDP, may change with Chrome"]
module Set_scrollbars_hidden = struct
let name = "Emulation.setScrollbarsHidden"
type params = { hidden : bool [@key "hidden"] } [@@allow_extra_fields] [@@deriving json, show, eq, make]
type result = unit [@@deriving show, eq]
let result_of_json (_ignored_payload : Cdp_json.t) : result = ()
let command params : result Cdp_command.t =
{ Cdp_command.name; params = Some (params_to_json params); parse = result_of_json }
end
[@@alert experimental "experimental in CDP, may change with Chrome"]
module Set_document_cookie_disabled = struct
let name = "Emulation.setDocumentCookieDisabled"
type params = { disabled : bool [@key "disabled"] } [@@allow_extra_fields] [@@deriving json, show, eq, make]
type result = unit [@@deriving show, eq]
let result_of_json (_ignored_payload : Cdp_json.t) : result = ()
let command params : result Cdp_command.t =
{ Cdp_command.name; params = Some (params_to_json params); parse = result_of_json }
end
[@@alert experimental "experimental in CDP, may change with Chrome"]
module Set_emit_touch_events_for_mouse = struct
let name = "Emulation.setEmitTouchEventsForMouse"
type configuration =
| Mobile [@json.name "mobile"]
| Desktop [@json.name "desktop"]
| Other of Cdp_json.unknown [@json.catch_all]
[@@compact_variants] [@@deriving json, show, eq]
type params = {
enabled : bool; [@key "enabled"]
configuration : configuration option; [@key "configuration"] [@option] [@json.drop_default]
}
[@@allow_extra_fields] [@@deriving json, show, eq, make]
type result = unit [@@deriving show, eq]
let result_of_json (_ignored_payload : Cdp_json.t) : result = ()
let command params : result Cdp_command.t =
{ Cdp_command.name; params = Some (params_to_json params); parse = result_of_json }
end
[@@alert experimental "experimental in CDP, may change with Chrome"]
module Set_emulated_media = struct
let name = "Emulation.setEmulatedMedia"
type params = {
media : string option; [@key "media"] [@option] [@json.drop_default]
features : media_feature list option; [@key "features"] [@option] [@json.drop_default]
}
[@@allow_extra_fields] [@@deriving json, show, eq, make]
type result = unit [@@deriving show, eq]
let result_of_json (_ignored_payload : Cdp_json.t) : result = ()
let command params : result Cdp_command.t =
{ Cdp_command.name; params = Some (params_to_json params); parse = result_of_json }
end
module Set_emulated_vision_deficiency = struct
let name = "Emulation.setEmulatedVisionDeficiency"
type type_ =
| None_ [@json.name "none"]
| BlurredVision [@json.name "blurredVision"]
| ReducedContrast [@json.name "reducedContrast"]
| Achromatopsia [@json.name "achromatopsia"]
| Deuteranopia [@json.name "deuteranopia"]
| Protanopia [@json.name "protanopia"]
| Tritanopia [@json.name "tritanopia"]
| Other of Cdp_json.unknown [@json.catch_all]
[@@compact_variants] [@@deriving json, show, eq]
type params = { type_ : type_ [@key "type"] } [@@allow_extra_fields] [@@deriving json, show, eq, make]
type result = unit [@@deriving show, eq]
let result_of_json (_ignored_payload : Cdp_json.t) : result = ()
let command params : result Cdp_command.t =
{ Cdp_command.name; params = Some (params_to_json params); parse = result_of_json }
end
module Set_emulated_os_text_scale = struct
let name = "Emulation.setEmulatedOSTextScale"
type params = { scale : float option [@key "scale"] [@option] [@json.drop_default] }
[@@allow_extra_fields] [@@deriving json, show, eq, make]
type result = unit [@@deriving show, eq]
let result_of_json (_ignored_payload : Cdp_json.t) : result = ()
let command params : result Cdp_command.t =
{ Cdp_command.name; params = Some (params_to_json params); parse = result_of_json }
end
module Set_geolocation_override = struct
let name = "Emulation.setGeolocationOverride"
type params = {
latitude : float option; [@key "latitude"] [@option] [@json.drop_default]
longitude : float option; [@key "longitude"] [@option] [@json.drop_default]
accuracy : float option; [@key "accuracy"] [@option] [@json.drop_default]
altitude : float option; [@key "altitude"] [@option] [@json.drop_default]
altitude_accuracy : float option; [@key "altitudeAccuracy"] [@option] [@json.drop_default]
heading : float option; [@key "heading"] [@option] [@json.drop_default]
speed : float option; [@key "speed"] [@option] [@json.drop_default]
}
[@@allow_extra_fields] [@@deriving json, show, eq, make]
type result = unit [@@deriving show, eq]
let result_of_json (_ignored_payload : Cdp_json.t) : result = ()
let command params : result Cdp_command.t =
{ Cdp_command.name; params = Some (params_to_json params); parse = result_of_json }
end
module Get_overridden_sensor_information = struct
let name = "Emulation.getOverriddenSensorInformation"
type params = { type_ : sensor_type [@key "type"] } [@@allow_extra_fields] [@@deriving json, show, eq, make]
type result = { requested_sampling_frequency : float [@key "requestedSamplingFrequency"] }
[@@allow_extra_fields] [@@deriving json, show, eq]
let command params : result Cdp_command.t =
{ Cdp_command.name; params = Some (params_to_json params); parse = result_of_json }
end
[@@alert experimental "experimental in CDP, may change with Chrome"]
module Set_sensor_override_enabled = struct
let name = "Emulation.setSensorOverrideEnabled"
type params = {
enabled : bool; [@key "enabled"]
type_ : sensor_type; [@key "type"]
metadata : sensor_metadata option; [@key "metadata"] [@option] [@json.drop_default]
}
[@@allow_extra_fields] [@@deriving json, show, eq, make]
type result = unit [@@deriving show, eq]
let result_of_json (_ignored_payload : Cdp_json.t) : result = ()
let command params : result Cdp_command.t =
{ Cdp_command.name; params = Some (params_to_json params); parse = result_of_json }
end
[@@alert experimental "experimental in CDP, may change with Chrome"]
module Set_sensor_override_readings = struct
let name = "Emulation.setSensorOverrideReadings"
type params = {
type_ : sensor_type; [@key "type"]
reading : sensor_reading; [@key "reading"]
}
[@@allow_extra_fields] [@@deriving json, show, eq, make]
type result = unit [@@deriving show, eq]
let result_of_json (_ignored_payload : Cdp_json.t) : result = ()
let command params : result Cdp_command.t =
{ Cdp_command.name; params = Some (params_to_json params); parse = result_of_json }
end
[@@alert experimental "experimental in CDP, may change with Chrome"]
module Set_pressure_source_override_enabled = struct
let name = "Emulation.setPressureSourceOverrideEnabled"
type params = {
enabled : bool; [@key "enabled"]
source : pressure_source; [@key "source"]
metadata : pressure_metadata option; [@key "metadata"] [@option] [@json.drop_default]
}
[@@allow_extra_fields] [@@deriving json, show, eq, make]
type result = unit [@@deriving show, eq]
let result_of_json (_ignored_payload : Cdp_json.t) : result = ()
let command params : result Cdp_command.t =
{ Cdp_command.name; params = Some (params_to_json params); parse = result_of_json }
end
[@@alert experimental "experimental in CDP, may change with Chrome"]
module Set_pressure_state_override = struct
let name = "Emulation.setPressureStateOverride"
type params = {
source : pressure_source; [@key "source"]
state : pressure_state; [@key "state"]
}
[@@allow_extra_fields] [@@deriving json, show, eq, make]
type result = unit [@@deriving show, eq]
let result_of_json (_ignored_payload : Cdp_json.t) : result = ()
let command params : result Cdp_command.t =
{ Cdp_command.name; params = Some (params_to_json params); parse = result_of_json }
end
[@@alert experimental "experimental in CDP, may change with Chrome"]
module Set_idle_override = struct
let name = "Emulation.setIdleOverride"
type params = {
is_user_active : bool; [@key "isUserActive"]
is_screen_unlocked : bool; [@key "isScreenUnlocked"]
}
[@@allow_extra_fields] [@@deriving json, show, eq, make]
type result = unit [@@deriving show, eq]
let result_of_json (_ignored_payload : Cdp_json.t) : result = ()
let command params : result Cdp_command.t =
{ Cdp_command.name; params = Some (params_to_json params); parse = result_of_json }
end
module Clear_idle_override = struct
let name = "Emulation.clearIdleOverride"
type result = unit [@@deriving show, eq]
let result_of_json (_ignored_payload : Cdp_json.t) : result = ()
let command : result Cdp_command.t = { Cdp_command.name; params = None; parse = result_of_json }
end
module Set_navigator_overrides = struct
let name = "Emulation.setNavigatorOverrides"
type params = { platform : string [@key "platform"] } [@@allow_extra_fields] [@@deriving json, show, eq, make]
type result = unit [@@deriving show, eq]
let result_of_json (_ignored_payload : Cdp_json.t) : result = ()
let command params : result Cdp_command.t =
{ Cdp_command.name; params = Some (params_to_json params); parse = result_of_json }
end
[@@ocaml.deprecated "deprecated in CDP"] [@@alert experimental "experimental in CDP, may change with Chrome"]
module Set_page_scale_factor = struct
let name = "Emulation.setPageScaleFactor"
type params = { page_scale_factor : float [@key "pageScaleFactor"] }
[@@allow_extra_fields] [@@deriving json, show, eq, make]
type result = unit [@@deriving show, eq]
let result_of_json (_ignored_payload : Cdp_json.t) : result = ()
let command params : result Cdp_command.t =
{ Cdp_command.name; params = Some (params_to_json params); parse = result_of_json }
end
[@@alert experimental "experimental in CDP, may change with Chrome"]
module Set_script_execution_disabled = struct
let name = "Emulation.setScriptExecutionDisabled"
type params = { value : bool [@key "value"] } [@@allow_extra_fields] [@@deriving json, show, eq, make]
type result = unit [@@deriving show, eq]
let result_of_json (_ignored_payload : Cdp_json.t) : result = ()
let command params : result Cdp_command.t =
{ Cdp_command.name; params = Some (params_to_json params); parse = result_of_json }
end
module Set_touch_emulation_enabled = struct
let name = "Emulation.setTouchEmulationEnabled"
type params = {
enabled : bool; [@key "enabled"]
max_touch_points : int option; [@key "maxTouchPoints"] [@option] [@json.drop_default]
}
[@@allow_extra_fields] [@@deriving json, show, eq, make]
type result = unit [@@deriving show, eq]
let result_of_json (_ignored_payload : Cdp_json.t) : result = ()
let command params : result Cdp_command.t =
{ Cdp_command.name; params = Some (params_to_json params); parse = result_of_json }
end
module Set_virtual_time_policy = struct
let name = "Emulation.setVirtualTimePolicy"
type params = {
policy : virtual_time_policy; [@key "policy"]
budget : float option; [@key "budget"] [@option] [@json.drop_default]
max_virtual_time_task_starvation_count : int option;
[@key "maxVirtualTimeTaskStarvationCount"] [@option] [@json.drop_default]
initial_virtual_time : Cdp_base.Network.Time_since_epoch.t option;
[@key "initialVirtualTime"] [@option] [@json.drop_default]
}
[@@allow_extra_fields] [@@deriving json, show, eq, make]
type result = { virtual_time_ticks_base : float [@key "virtualTimeTicksBase"] }
[@@allow_extra_fields] [@@deriving json, show, eq]
let command params : result Cdp_command.t =
{ Cdp_command.name; params = Some (params_to_json params); parse = result_of_json }
end
[@@alert experimental "experimental in CDP, may change with Chrome"]
module Set_locale_override = struct
let name = "Emulation.setLocaleOverride"
type params = { locale : string option [@key "locale"] [@option] [@json.drop_default] }
[@@allow_extra_fields] [@@deriving json, show, eq, make]
type result = unit [@@deriving show, eq]
let result_of_json (_ignored_payload : Cdp_json.t) : result = ()
let command params : result Cdp_command.t =
{ Cdp_command.name; params = Some (params_to_json params); parse = result_of_json }
end
[@@alert experimental "experimental in CDP, may change with Chrome"]
module Set_timezone_override = struct
let name = "Emulation.setTimezoneOverride"
type params = { timezone_id : string [@key "timezoneId"] } [@@allow_extra_fields] [@@deriving json, show, eq, make]
type result = unit [@@deriving show, eq]
let result_of_json (_ignored_payload : Cdp_json.t) : result = ()
let command params : result Cdp_command.t =
{ Cdp_command.name; params = Some (params_to_json params); parse = result_of_json }
end
module Set_visible_size = struct
let name = "Emulation.setVisibleSize"
type params = {
width : int; [@key "width"]
height : int; [@key "height"]
}
[@@allow_extra_fields] [@@deriving json, show, eq, make]
type result = unit [@@deriving show, eq]
let result_of_json (_ignored_payload : Cdp_json.t) : result = ()
let command params : result Cdp_command.t =
{ Cdp_command.name; params = Some (params_to_json params); parse = result_of_json }
end
[@@ocaml.deprecated "deprecated in CDP"] [@@alert experimental "experimental in CDP, may change with Chrome"]
module Set_disabled_image_types = struct
let name = "Emulation.setDisabledImageTypes"
type params = { image_types : disabled_image_type list [@key "imageTypes"] }
[@@allow_extra_fields] [@@deriving json, show, eq, make]
type result = unit [@@deriving show, eq]
let result_of_json (_ignored_payload : Cdp_json.t) : result = ()
let command params : result Cdp_command.t =
{ Cdp_command.name; params = Some (params_to_json params); parse = result_of_json }
end
[@@alert experimental "experimental in CDP, may change with Chrome"]
module Set_data_saver_override = struct
let name = "Emulation.setDataSaverOverride"
type params = { data_saver_enabled : bool option [@key "dataSaverEnabled"] [@option] [@json.drop_default] }
[@@allow_extra_fields] [@@deriving json, show, eq, make]
type result = unit [@@deriving show, eq]
let result_of_json (_ignored_payload : Cdp_json.t) : result = ()
let command params : result Cdp_command.t =
{ Cdp_command.name; params = Some (params_to_json params); parse = result_of_json }
end
[@@alert experimental "experimental in CDP, may change with Chrome"]
module Set_hardware_concurrency_override = struct
let name = "Emulation.setHardwareConcurrencyOverride"
type params = { hardware_concurrency : int [@key "hardwareConcurrency"] }
[@@allow_extra_fields] [@@deriving json, show, eq, make]
type result = unit [@@deriving show, eq]
let result_of_json (_ignored_payload : Cdp_json.t) : result = ()
let command params : result Cdp_command.t =
{ Cdp_command.name; params = Some (params_to_json params); parse = result_of_json }
end
[@@alert experimental "experimental in CDP, may change with Chrome"]
module Set_cpu_performance_override = struct
let name = "Emulation.setCPUPerformanceOverride"
type performance_tier =
| Unknown [@json.name "unknown"]
| Low [@json.name "low"]
| Mid [@json.name "mid"]
| High [@json.name "high"]
| Ultra [@json.name "ultra"]
| Other of Cdp_json.unknown [@json.catch_all]
[@@compact_variants] [@@deriving json, show, eq]
type params = { performance_tier : performance_tier option [@key "performanceTier"] [@option] [@json.drop_default] }
[@@allow_extra_fields] [@@deriving json, show, eq, make]
type result = unit [@@deriving show, eq]
let result_of_json (_ignored_payload : Cdp_json.t) : result = ()
let command params : result Cdp_command.t =
{ Cdp_command.name; params = Some (params_to_json params); parse = result_of_json }
end
[@@alert experimental "experimental in CDP, may change with Chrome"]
module Set_user_agent_override = struct
let name = "Emulation.setUserAgentOverride"
type params = {
user_agent : string; [@key "userAgent"]
accept_language : string option; [@key "acceptLanguage"] [@option] [@json.drop_default]
platform : string option; [@key "platform"] [@option] [@json.drop_default]
user_agent_metadata : user_agent_metadata option; [@key "userAgentMetadata"] [@option] [@json.drop_default]
}
[@@allow_extra_fields] [@@deriving json, show, eq, make]
type result = unit [@@deriving show, eq]
let result_of_json (_ignored_payload : Cdp_json.t) : result = ()
let command params : result Cdp_command.t =
{ Cdp_command.name; params = Some (params_to_json params); parse = result_of_json }
end
module Set_automation_override = struct
let name = "Emulation.setAutomationOverride"
type params = { enabled : bool [@key "enabled"] } [@@allow_extra_fields] [@@deriving json, show, eq, make]
type result = unit [@@deriving show, eq]
let result_of_json (_ignored_payload : Cdp_json.t) : result = ()
let command params : result Cdp_command.t =
{ Cdp_command.name; params = Some (params_to_json params); parse = result_of_json }
end
[@@alert experimental "experimental in CDP, may change with Chrome"]
module Set_small_viewport_height_difference_override = struct
let name = "Emulation.setSmallViewportHeightDifferenceOverride"
type params = { difference : int [@key "difference"] } [@@allow_extra_fields] [@@deriving json, show, eq, make]
type result = unit [@@deriving show, eq]
let result_of_json (_ignored_payload : Cdp_json.t) : result = ()
let command params : result Cdp_command.t =
{ Cdp_command.name; params = Some (params_to_json params); parse = result_of_json }
end
[@@alert experimental "experimental in CDP, may change with Chrome"]
module Get_screen_infos = struct
let name = "Emulation.getScreenInfos"
type result = { screen_infos : screen_info list [@key "screenInfos"] }
[@@allow_extra_fields] [@@deriving json, show, eq]
let command : result Cdp_command.t = { Cdp_command.name; params = None; parse = result_of_json }
end
[@@alert experimental "experimental in CDP, may change with Chrome"]
module Add_screen = struct
let name = "Emulation.addScreen"
type params = {
left : int; [@key "left"]
top : int; [@key "top"]
width : int; [@key "width"]
height : int; [@key "height"]
work_area_insets : work_area_insets option; [@key "workAreaInsets"] [@option] [@json.drop_default]
device_pixel_ratio : float option; [@key "devicePixelRatio"] [@option] [@json.drop_default]
rotation : int option; [@key "rotation"] [@option] [@json.drop_default]
color_depth : int option; [@key "colorDepth"] [@option] [@json.drop_default]
label : string option; [@key "label"] [@option] [@json.drop_default]
is_internal : bool option; [@key "isInternal"] [@option] [@json.drop_default]
}
[@@allow_extra_fields] [@@deriving json, show, eq, make]
type result = { screen_info : screen_info [@key "screenInfo"] } [@@allow_extra_fields] [@@deriving json, show, eq]
let command params : result Cdp_command.t =
{ Cdp_command.name; params = Some (params_to_json params); parse = result_of_json }
end
[@@alert experimental "experimental in CDP, may change with Chrome"]
module Update_screen = struct
let name = "Emulation.updateScreen"
type params = {
screen_id : Cdp_base.Emulation.Screen_id.t; [@key "screenId"]
left : int option; [@key "left"] [@option] [@json.drop_default]
top : int option; [@key "top"] [@option] [@json.drop_default]
width : int option; [@key "width"] [@option] [@json.drop_default]
height : int option; [@key "height"] [@option] [@json.drop_default]
work_area_insets : work_area_insets option; [@key "workAreaInsets"] [@option] [@json.drop_default]
device_pixel_ratio : float option; [@key "devicePixelRatio"] [@option] [@json.drop_default]
rotation : int option; [@key "rotation"] [@option] [@json.drop_default]
color_depth : int option; [@key "colorDepth"] [@option] [@json.drop_default]
label : string option; [@key "label"] [@option] [@json.drop_default]
is_internal : bool option; [@key "isInternal"] [@option] [@json.drop_default]
}
[@@allow_extra_fields] [@@deriving json, show, eq, make]
type result = { screen_info : screen_info [@key "screenInfo"] } [@@allow_extra_fields] [@@deriving json, show, eq]
let command params : result Cdp_command.t =
{ Cdp_command.name; params = Some (params_to_json params); parse = result_of_json }
end
[@@alert experimental "experimental in CDP, may change with Chrome"]
module Remove_screen = struct
let name = "Emulation.removeScreen"
type params = { screen_id : Cdp_base.Emulation.Screen_id.t [@key "screenId"] }
[@@allow_extra_fields] [@@deriving json, show, eq, make]
type result = unit [@@deriving show, eq]
let result_of_json (_ignored_payload : Cdp_json.t) : result = ()
let command params : result Cdp_command.t =
{ Cdp_command.name; params = Some (params_to_json params); parse = result_of_json }
end
[@@alert experimental "experimental in CDP, may change with Chrome"]
module Set_primary_screen = struct
let name = "Emulation.setPrimaryScreen"
type params = { screen_id : Cdp_base.Emulation.Screen_id.t [@key "screenId"] }
[@@allow_extra_fields] [@@deriving json, show, eq, make]
type result = unit [@@deriving show, eq]
let result_of_json (_ignored_payload : Cdp_json.t) : result = ()
let command params : result Cdp_command.t =
{ Cdp_command.name; params = Some (params_to_json params); parse = result_of_json }
end
[@@alert experimental "experimental in CDP, may change with Chrome"]
module Virtual_time_budget_expired = struct
let name = "Emulation.virtualTimeBudgetExpired"
type params = unit [@@deriving show, eq]
let params_of_json (_ignored_payload : Cdp_json.t) : params = ()
let event : params Cdp_event.t = { Cdp_event.name; parse = params_of_json }
end
[@@alert experimental "experimental in CDP, may change with Chrome"]
module Screen_orientation_lock_changed = struct
let name = "Emulation.screenOrientationLockChanged"
type params = {
locked : bool; [@key "locked"]
orientation : screen_orientation option; [@key "orientation"] [@option] [@json.drop_default]
}
[@@allow_extra_fields] [@@deriving json, show, eq, make]
let event : params Cdp_event.t = { Cdp_event.name; parse = params_of_json }
end
[@@alert experimental "experimental in CDP, may change with Chrome"]