Skip to main content

browser_protocol/overlay/
mod.rs

1//! This domain provides various functionality related to drawing atop the inspected page.
2
3use serde::{Serialize, Deserialize};
4use serde_json::Value as JsonValue;
5
6/// Configuration data for drawing the source order of an elements children.
7
8#[derive(Debug, Clone, Serialize, Deserialize, Default)]
9#[serde(rename_all = "camelCase")]
10pub struct SourceOrderConfig {
11    /// the color to outline the given element in.
12
13    pub parentOutlineColor: crate::dom::RGBA,
14    /// the color to outline the child elements in.
15
16    pub childOutlineColor: crate::dom::RGBA,
17}
18
19/// Configuration data for the highlighting of Grid elements.
20
21#[derive(Debug, Clone, Serialize, Deserialize, Default)]
22#[serde(rename_all = "camelCase")]
23pub struct GridHighlightConfig {
24    /// Whether the extension lines from grid cells to the rulers should be shown (default: false).
25
26    #[serde(skip_serializing_if = "Option::is_none")]
27    pub showGridExtensionLines: Option<bool>,
28    /// Show Positive line number labels (default: false).
29
30    #[serde(skip_serializing_if = "Option::is_none")]
31    pub showPositiveLineNumbers: Option<bool>,
32    /// Show Negative line number labels (default: false).
33
34    #[serde(skip_serializing_if = "Option::is_none")]
35    pub showNegativeLineNumbers: Option<bool>,
36    /// Show area name labels (default: false).
37
38    #[serde(skip_serializing_if = "Option::is_none")]
39    pub showAreaNames: Option<bool>,
40    /// Show line name labels (default: false).
41
42    #[serde(skip_serializing_if = "Option::is_none")]
43    pub showLineNames: Option<bool>,
44    /// Show track size labels (default: false).
45
46    #[serde(skip_serializing_if = "Option::is_none")]
47    pub showTrackSizes: Option<bool>,
48    /// The grid container border highlight color (default: transparent).
49
50    #[serde(skip_serializing_if = "Option::is_none")]
51    pub gridBorderColor: Option<crate::dom::RGBA>,
52    /// The cell border color (default: transparent). Deprecated, please use rowLineColor and columnLineColor instead.
53
54    #[serde(skip_serializing_if = "Option::is_none")]
55    pub cellBorderColor: Option<crate::dom::RGBA>,
56    /// The row line color (default: transparent).
57
58    #[serde(skip_serializing_if = "Option::is_none")]
59    pub rowLineColor: Option<crate::dom::RGBA>,
60    /// The column line color (default: transparent).
61
62    #[serde(skip_serializing_if = "Option::is_none")]
63    pub columnLineColor: Option<crate::dom::RGBA>,
64    /// Whether the grid border is dashed (default: false).
65
66    #[serde(skip_serializing_if = "Option::is_none")]
67    pub gridBorderDash: Option<bool>,
68    /// Whether the cell border is dashed (default: false). Deprecated, please us rowLineDash and columnLineDash instead.
69
70    #[serde(skip_serializing_if = "Option::is_none")]
71    pub cellBorderDash: Option<bool>,
72    /// Whether row lines are dashed (default: false).
73
74    #[serde(skip_serializing_if = "Option::is_none")]
75    pub rowLineDash: Option<bool>,
76    /// Whether column lines are dashed (default: false).
77
78    #[serde(skip_serializing_if = "Option::is_none")]
79    pub columnLineDash: Option<bool>,
80    /// The row gap highlight fill color (default: transparent).
81
82    #[serde(skip_serializing_if = "Option::is_none")]
83    pub rowGapColor: Option<crate::dom::RGBA>,
84    /// The row gap hatching fill color (default: transparent).
85
86    #[serde(skip_serializing_if = "Option::is_none")]
87    pub rowHatchColor: Option<crate::dom::RGBA>,
88    /// The column gap highlight fill color (default: transparent).
89
90    #[serde(skip_serializing_if = "Option::is_none")]
91    pub columnGapColor: Option<crate::dom::RGBA>,
92    /// The column gap hatching fill color (default: transparent).
93
94    #[serde(skip_serializing_if = "Option::is_none")]
95    pub columnHatchColor: Option<crate::dom::RGBA>,
96    /// The named grid areas border color (Default: transparent).
97
98    #[serde(skip_serializing_if = "Option::is_none")]
99    pub areaBorderColor: Option<crate::dom::RGBA>,
100    /// The grid container background color (Default: transparent).
101
102    #[serde(skip_serializing_if = "Option::is_none")]
103    pub gridBackgroundColor: Option<crate::dom::RGBA>,
104}
105
106/// Configuration data for the highlighting of Flex container elements.
107
108#[derive(Debug, Clone, Serialize, Deserialize, Default)]
109#[serde(rename_all = "camelCase")]
110pub struct FlexContainerHighlightConfig {
111    /// The style of the container border
112
113    #[serde(skip_serializing_if = "Option::is_none")]
114    pub containerBorder: Option<LineStyle>,
115    /// The style of the separator between lines
116
117    #[serde(skip_serializing_if = "Option::is_none")]
118    pub lineSeparator: Option<LineStyle>,
119    /// The style of the separator between items
120
121    #[serde(skip_serializing_if = "Option::is_none")]
122    pub itemSeparator: Option<LineStyle>,
123    /// Style of content-distribution space on the main axis (justify-content).
124
125    #[serde(skip_serializing_if = "Option::is_none")]
126    pub mainDistributedSpace: Option<BoxStyle>,
127    /// Style of content-distribution space on the cross axis (align-content).
128
129    #[serde(skip_serializing_if = "Option::is_none")]
130    pub crossDistributedSpace: Option<BoxStyle>,
131    /// Style of empty space caused by row gaps (gap/row-gap).
132
133    #[serde(skip_serializing_if = "Option::is_none")]
134    pub rowGapSpace: Option<BoxStyle>,
135    /// Style of empty space caused by columns gaps (gap/column-gap).
136
137    #[serde(skip_serializing_if = "Option::is_none")]
138    pub columnGapSpace: Option<BoxStyle>,
139    /// Style of the self-alignment line (align-items).
140
141    #[serde(skip_serializing_if = "Option::is_none")]
142    pub crossAlignment: Option<LineStyle>,
143}
144
145/// Configuration data for the highlighting of Flex item elements.
146
147#[derive(Debug, Clone, Serialize, Deserialize, Default)]
148#[serde(rename_all = "camelCase")]
149pub struct FlexItemHighlightConfig {
150    /// Style of the box representing the item's base size
151
152    #[serde(skip_serializing_if = "Option::is_none")]
153    pub baseSizeBox: Option<BoxStyle>,
154    /// Style of the border around the box representing the item's base size
155
156    #[serde(skip_serializing_if = "Option::is_none")]
157    pub baseSizeBorder: Option<LineStyle>,
158    /// Style of the arrow representing if the item grew or shrank
159
160    #[serde(skip_serializing_if = "Option::is_none")]
161    pub flexibilityArrow: Option<LineStyle>,
162}
163
164/// Style information for drawing a line.
165
166#[derive(Debug, Clone, Serialize, Deserialize, Default)]
167#[serde(rename_all = "camelCase")]
168pub struct LineStyle {
169    /// The color of the line (default: transparent)
170
171    #[serde(skip_serializing_if = "Option::is_none")]
172    pub color: Option<crate::dom::RGBA>,
173    /// The line pattern (default: solid)
174
175    #[serde(skip_serializing_if = "Option::is_none")]
176    pub pattern: Option<String>,
177}
178
179/// Style information for drawing a box.
180
181#[derive(Debug, Clone, Serialize, Deserialize, Default)]
182#[serde(rename_all = "camelCase")]
183pub struct BoxStyle {
184    /// The background color for the box (default: transparent)
185
186    #[serde(skip_serializing_if = "Option::is_none")]
187    pub fillColor: Option<crate::dom::RGBA>,
188    /// The hatching color for the box (default: transparent)
189
190    #[serde(skip_serializing_if = "Option::is_none")]
191    pub hatchColor: Option<crate::dom::RGBA>,
192}
193
194
195#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
196pub enum ContrastAlgorithm {
197    #[default]
198    Aa,
199    Aaa,
200    Apca,
201}
202
203/// Configuration data for the highlighting of page elements.
204
205#[derive(Debug, Clone, Serialize, Deserialize, Default)]
206#[serde(rename_all = "camelCase")]
207pub struct HighlightConfig {
208    /// Whether the node info tooltip should be shown (default: false).
209
210    #[serde(skip_serializing_if = "Option::is_none")]
211    pub showInfo: Option<bool>,
212    /// Whether the node styles in the tooltip (default: false).
213
214    #[serde(skip_serializing_if = "Option::is_none")]
215    pub showStyles: Option<bool>,
216    /// Whether the rulers should be shown (default: false).
217
218    #[serde(skip_serializing_if = "Option::is_none")]
219    pub showRulers: Option<bool>,
220    /// Whether the a11y info should be shown (default: true).
221
222    #[serde(skip_serializing_if = "Option::is_none")]
223    pub showAccessibilityInfo: Option<bool>,
224    /// Whether the extension lines from node to the rulers should be shown (default: false).
225
226    #[serde(skip_serializing_if = "Option::is_none")]
227    pub showExtensionLines: Option<bool>,
228    /// The content box highlight fill color (default: transparent).
229
230    #[serde(skip_serializing_if = "Option::is_none")]
231    pub contentColor: Option<crate::dom::RGBA>,
232    /// The padding highlight fill color (default: transparent).
233
234    #[serde(skip_serializing_if = "Option::is_none")]
235    pub paddingColor: Option<crate::dom::RGBA>,
236    /// The border highlight fill color (default: transparent).
237
238    #[serde(skip_serializing_if = "Option::is_none")]
239    pub borderColor: Option<crate::dom::RGBA>,
240    /// The margin highlight fill color (default: transparent).
241
242    #[serde(skip_serializing_if = "Option::is_none")]
243    pub marginColor: Option<crate::dom::RGBA>,
244    /// The event target element highlight fill color (default: transparent).
245
246    #[serde(skip_serializing_if = "Option::is_none")]
247    pub eventTargetColor: Option<crate::dom::RGBA>,
248    /// The shape outside fill color (default: transparent).
249
250    #[serde(skip_serializing_if = "Option::is_none")]
251    pub shapeColor: Option<crate::dom::RGBA>,
252    /// The shape margin fill color (default: transparent).
253
254    #[serde(skip_serializing_if = "Option::is_none")]
255    pub shapeMarginColor: Option<crate::dom::RGBA>,
256    /// The grid layout color (default: transparent).
257
258    #[serde(skip_serializing_if = "Option::is_none")]
259    pub cssGridColor: Option<crate::dom::RGBA>,
260    /// The color format used to format color styles (default: hex).
261
262    #[serde(skip_serializing_if = "Option::is_none")]
263    pub colorFormat: Option<ColorFormat>,
264    /// The grid layout highlight configuration (default: all transparent).
265
266    #[serde(skip_serializing_if = "Option::is_none")]
267    pub gridHighlightConfig: Option<GridHighlightConfig>,
268    /// The flex container highlight configuration (default: all transparent).
269
270    #[serde(skip_serializing_if = "Option::is_none")]
271    pub flexContainerHighlightConfig: Option<FlexContainerHighlightConfig>,
272    /// The flex item highlight configuration (default: all transparent).
273
274    #[serde(skip_serializing_if = "Option::is_none")]
275    pub flexItemHighlightConfig: Option<FlexItemHighlightConfig>,
276    /// The contrast algorithm to use for the contrast ratio (default: aa).
277
278    #[serde(skip_serializing_if = "Option::is_none")]
279    pub contrastAlgorithm: Option<ContrastAlgorithm>,
280    /// The container query container highlight configuration (default: all transparent).
281
282    #[serde(skip_serializing_if = "Option::is_none")]
283    pub containerQueryContainerHighlightConfig: Option<ContainerQueryContainerHighlightConfig>,
284}
285
286
287#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
288pub enum ColorFormat {
289    #[default]
290    Rgb,
291    Hsl,
292    Hwb,
293    Hex,
294}
295
296/// Configurations for Persistent Grid Highlight
297
298#[derive(Debug, Clone, Serialize, Deserialize, Default)]
299#[serde(rename_all = "camelCase")]
300pub struct GridNodeHighlightConfig {
301    /// A descriptor for the highlight appearance.
302
303    pub gridHighlightConfig: GridHighlightConfig,
304    /// Identifier of the node to highlight.
305
306    pub nodeId: crate::dom::NodeId,
307}
308
309
310#[derive(Debug, Clone, Serialize, Deserialize, Default)]
311#[serde(rename_all = "camelCase")]
312pub struct FlexNodeHighlightConfig {
313    /// A descriptor for the highlight appearance of flex containers.
314
315    pub flexContainerHighlightConfig: FlexContainerHighlightConfig,
316    /// Identifier of the node to highlight.
317
318    pub nodeId: crate::dom::NodeId,
319}
320
321
322#[derive(Debug, Clone, Serialize, Deserialize, Default)]
323#[serde(rename_all = "camelCase")]
324pub struct ScrollSnapContainerHighlightConfig {
325    /// The style of the snapport border (default: transparent)
326
327    #[serde(skip_serializing_if = "Option::is_none")]
328    pub snapportBorder: Option<LineStyle>,
329    /// The style of the snap area border (default: transparent)
330
331    #[serde(skip_serializing_if = "Option::is_none")]
332    pub snapAreaBorder: Option<LineStyle>,
333    /// The margin highlight fill color (default: transparent).
334
335    #[serde(skip_serializing_if = "Option::is_none")]
336    pub scrollMarginColor: Option<crate::dom::RGBA>,
337    /// The padding highlight fill color (default: transparent).
338
339    #[serde(skip_serializing_if = "Option::is_none")]
340    pub scrollPaddingColor: Option<crate::dom::RGBA>,
341}
342
343
344#[derive(Debug, Clone, Serialize, Deserialize, Default)]
345#[serde(rename_all = "camelCase")]
346pub struct ScrollSnapHighlightConfig {
347    /// A descriptor for the highlight appearance of scroll snap containers.
348
349    pub scrollSnapContainerHighlightConfig: ScrollSnapContainerHighlightConfig,
350    /// Identifier of the node to highlight.
351
352    pub nodeId: crate::dom::NodeId,
353}
354
355/// Configuration for dual screen hinge
356
357#[derive(Debug, Clone, Serialize, Deserialize, Default)]
358#[serde(rename_all = "camelCase")]
359pub struct HingeConfig {
360    /// A rectangle represent hinge
361
362    pub rect: crate::dom::Rect,
363    /// The content box highlight fill color (default: a dark color).
364
365    #[serde(skip_serializing_if = "Option::is_none")]
366    pub contentColor: Option<crate::dom::RGBA>,
367    /// The content box highlight outline color (default: transparent).
368
369    #[serde(skip_serializing_if = "Option::is_none")]
370    pub outlineColor: Option<crate::dom::RGBA>,
371}
372
373/// Configuration for Window Controls Overlay
374
375#[derive(Debug, Clone, Serialize, Deserialize, Default)]
376#[serde(rename_all = "camelCase")]
377pub struct WindowControlsOverlayConfig {
378    /// Whether the title bar CSS should be shown when emulating the Window Controls Overlay.
379
380    pub showCSS: bool,
381    /// Selected platforms to show the overlay.
382
383    pub selectedPlatform: String,
384    /// The theme color defined in app manifest.
385
386    pub themeColor: String,
387}
388
389
390#[derive(Debug, Clone, Serialize, Deserialize, Default)]
391#[serde(rename_all = "camelCase")]
392pub struct ContainerQueryHighlightConfig {
393    /// A descriptor for the highlight appearance of container query containers.
394
395    pub containerQueryContainerHighlightConfig: ContainerQueryContainerHighlightConfig,
396    /// Identifier of the container node to highlight.
397
398    pub nodeId: crate::dom::NodeId,
399}
400
401
402#[derive(Debug, Clone, Serialize, Deserialize, Default)]
403#[serde(rename_all = "camelCase")]
404pub struct ContainerQueryContainerHighlightConfig {
405    /// The style of the container border.
406
407    #[serde(skip_serializing_if = "Option::is_none")]
408    pub containerBorder: Option<LineStyle>,
409    /// The style of the descendants' borders.
410
411    #[serde(skip_serializing_if = "Option::is_none")]
412    pub descendantBorder: Option<LineStyle>,
413}
414
415
416#[derive(Debug, Clone, Serialize, Deserialize, Default)]
417#[serde(rename_all = "camelCase")]
418pub struct IsolatedElementHighlightConfig {
419    /// A descriptor for the highlight appearance of an element in isolation mode.
420
421    pub isolationModeHighlightConfig: IsolationModeHighlightConfig,
422    /// Identifier of the isolated element to highlight.
423
424    pub nodeId: crate::dom::NodeId,
425}
426
427
428#[derive(Debug, Clone, Serialize, Deserialize, Default)]
429#[serde(rename_all = "camelCase")]
430pub struct IsolationModeHighlightConfig {
431    /// The fill color of the resizers (default: transparent).
432
433    #[serde(skip_serializing_if = "Option::is_none")]
434    pub resizerColor: Option<crate::dom::RGBA>,
435    /// The fill color for resizer handles (default: transparent).
436
437    #[serde(skip_serializing_if = "Option::is_none")]
438    pub resizerHandleColor: Option<crate::dom::RGBA>,
439    /// The fill color for the mask covering non-isolated elements (default: transparent).
440
441    #[serde(skip_serializing_if = "Option::is_none")]
442    pub maskColor: Option<crate::dom::RGBA>,
443}
444
445
446#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
447pub enum InspectMode {
448    #[default]
449    SearchForNode,
450    SearchForUAShadowDOM,
451    CaptureAreaScreenshot,
452    None,
453}
454
455
456#[derive(Debug, Clone, Serialize, Deserialize, Default)]
457#[serde(rename_all = "camelCase")]
458pub struct InspectedElementAnchorConfig {
459    /// Identifier of the node to highlight.
460
461    #[serde(skip_serializing_if = "Option::is_none")]
462    pub nodeId: Option<crate::dom::NodeId>,
463    /// Identifier of the backend node to highlight.
464
465    #[serde(skip_serializing_if = "Option::is_none")]
466    pub backendNodeId: Option<crate::dom::BackendNodeId>,
467}
468
469/// For testing.
470
471#[derive(Debug, Clone, Serialize, Deserialize, Default)]
472#[serde(rename_all = "camelCase")]
473pub struct GetHighlightObjectForTestParams {
474    /// Id of the node to get highlight object for.
475
476    pub nodeId: crate::dom::NodeId,
477    /// Whether to include distance info.
478
479    #[serde(skip_serializing_if = "Option::is_none")]
480    pub includeDistance: Option<bool>,
481    /// Whether to include style info.
482
483    #[serde(skip_serializing_if = "Option::is_none")]
484    pub includeStyle: Option<bool>,
485    /// The color format to get config with (default: hex).
486
487    #[serde(skip_serializing_if = "Option::is_none")]
488    pub colorFormat: Option<ColorFormat>,
489    /// Whether to show accessibility info (default: true).
490
491    #[serde(skip_serializing_if = "Option::is_none")]
492    pub showAccessibilityInfo: Option<bool>,
493}
494
495/// For testing.
496
497#[derive(Debug, Clone, Serialize, Deserialize, Default)]
498#[serde(rename_all = "camelCase")]
499pub struct GetHighlightObjectForTestReturns {
500    /// Highlight data for the node.
501
502    pub highlight: serde_json::Map<String, JsonValue>,
503}
504
505/// For Persistent Grid testing.
506
507#[derive(Debug, Clone, Serialize, Deserialize, Default)]
508#[serde(rename_all = "camelCase")]
509pub struct GetGridHighlightObjectsForTestParams {
510    /// Ids of the node to get highlight object for.
511
512    pub nodeIds: Vec<crate::dom::NodeId>,
513}
514
515/// For Persistent Grid testing.
516
517#[derive(Debug, Clone, Serialize, Deserialize, Default)]
518#[serde(rename_all = "camelCase")]
519pub struct GetGridHighlightObjectsForTestReturns {
520    /// Grid Highlight data for the node ids provided.
521
522    pub highlights: serde_json::Map<String, JsonValue>,
523}
524
525/// For Source Order Viewer testing.
526
527#[derive(Debug, Clone, Serialize, Deserialize, Default)]
528#[serde(rename_all = "camelCase")]
529pub struct GetSourceOrderHighlightObjectForTestParams {
530    /// Id of the node to highlight.
531
532    pub nodeId: crate::dom::NodeId,
533}
534
535/// For Source Order Viewer testing.
536
537#[derive(Debug, Clone, Serialize, Deserialize, Default)]
538#[serde(rename_all = "camelCase")]
539pub struct GetSourceOrderHighlightObjectForTestReturns {
540    /// Source order highlight data for the node id provided.
541
542    pub highlight: serde_json::Map<String, JsonValue>,
543}
544
545/// Highlights owner element of the frame with given id.
546/// Deprecated: Doesn't work reliably and cannot be fixed due to process
547/// separation (the owner node might be in a different process). Determine
548/// the owner node in the client and use highlightNode.
549
550#[derive(Debug, Clone, Serialize, Deserialize, Default)]
551#[serde(rename_all = "camelCase")]
552pub struct HighlightFrameParams {
553    /// Identifier of the frame to highlight.
554
555    pub frameId: crate::page::FrameId,
556    /// The content box highlight fill color (default: transparent).
557
558    #[serde(skip_serializing_if = "Option::is_none")]
559    pub contentColor: Option<crate::dom::RGBA>,
560    /// The content box highlight outline color (default: transparent).
561
562    #[serde(skip_serializing_if = "Option::is_none")]
563    pub contentOutlineColor: Option<crate::dom::RGBA>,
564}
565
566/// Highlights DOM node with given id or with the given JavaScript object wrapper. Either nodeId or
567/// objectId must be specified.
568
569#[derive(Debug, Clone, Serialize, Deserialize, Default)]
570#[serde(rename_all = "camelCase")]
571pub struct HighlightNodeParams {
572    /// A descriptor for the highlight appearance.
573
574    pub highlightConfig: HighlightConfig,
575    /// Identifier of the node to highlight.
576
577    #[serde(skip_serializing_if = "Option::is_none")]
578    pub nodeId: Option<crate::dom::NodeId>,
579    /// Identifier of the backend node to highlight.
580
581    #[serde(skip_serializing_if = "Option::is_none")]
582    pub backendNodeId: Option<crate::dom::BackendNodeId>,
583    /// JavaScript object id of the node to be highlighted.
584
585    #[serde(skip_serializing_if = "Option::is_none")]
586    pub objectId: Option<crate::runtime::RemoteObjectId>,
587    /// Selectors to highlight relevant nodes.
588
589    #[serde(skip_serializing_if = "Option::is_none")]
590    pub selector: Option<String>,
591}
592
593/// Highlights given quad. Coordinates are absolute with respect to the main frame viewport.
594
595#[derive(Debug, Clone, Serialize, Deserialize, Default)]
596#[serde(rename_all = "camelCase")]
597pub struct HighlightQuadParams {
598    /// Quad to highlight
599
600    pub quad: crate::dom::Quad,
601    /// The highlight fill color (default: transparent).
602
603    #[serde(skip_serializing_if = "Option::is_none")]
604    pub color: Option<crate::dom::RGBA>,
605    /// The highlight outline color (default: transparent).
606
607    #[serde(skip_serializing_if = "Option::is_none")]
608    pub outlineColor: Option<crate::dom::RGBA>,
609}
610
611/// Highlights given rectangle. Coordinates are absolute with respect to the main frame viewport.
612/// Issue: the method does not handle device pixel ratio (DPR) correctly.
613/// The coordinates currently have to be adjusted by the client
614/// if DPR is not 1 (see crbug.com/437807128).
615
616#[derive(Debug, Clone, Serialize, Deserialize, Default)]
617#[serde(rename_all = "camelCase")]
618pub struct HighlightRectParams {
619    /// X coordinate
620
621    pub x: i32,
622    /// Y coordinate
623
624    pub y: i32,
625    /// Rectangle width
626
627    pub width: u64,
628    /// Rectangle height
629
630    pub height: i64,
631    /// The highlight fill color (default: transparent).
632
633    #[serde(skip_serializing_if = "Option::is_none")]
634    pub color: Option<crate::dom::RGBA>,
635    /// The highlight outline color (default: transparent).
636
637    #[serde(skip_serializing_if = "Option::is_none")]
638    pub outlineColor: Option<crate::dom::RGBA>,
639}
640
641/// Highlights the source order of the children of the DOM node with given id or with the given
642/// JavaScript object wrapper. Either nodeId or objectId must be specified.
643
644#[derive(Debug, Clone, Serialize, Deserialize, Default)]
645#[serde(rename_all = "camelCase")]
646pub struct HighlightSourceOrderParams {
647    /// A descriptor for the appearance of the overlay drawing.
648
649    pub sourceOrderConfig: SourceOrderConfig,
650    /// Identifier of the node to highlight.
651
652    #[serde(skip_serializing_if = "Option::is_none")]
653    pub nodeId: Option<crate::dom::NodeId>,
654    /// Identifier of the backend node to highlight.
655
656    #[serde(skip_serializing_if = "Option::is_none")]
657    pub backendNodeId: Option<crate::dom::BackendNodeId>,
658    /// JavaScript object id of the node to be highlighted.
659
660    #[serde(skip_serializing_if = "Option::is_none")]
661    pub objectId: Option<crate::runtime::RemoteObjectId>,
662}
663
664/// Enters the 'inspect' mode. In this mode, elements that user is hovering over are highlighted.
665/// Backend then generates 'inspectNodeRequested' event upon element selection.
666
667#[derive(Debug, Clone, Serialize, Deserialize, Default)]
668#[serde(rename_all = "camelCase")]
669pub struct SetInspectModeParams {
670    /// Set an inspection mode.
671
672    pub mode: InspectMode,
673    /// A descriptor for the highlight appearance of hovered-over nodes. May be omitted if 'enabled
674    /// == false'.
675
676    #[serde(skip_serializing_if = "Option::is_none")]
677    pub highlightConfig: Option<HighlightConfig>,
678}
679
680/// Highlights owner element of all frames detected to be ads.
681
682#[derive(Debug, Clone, Serialize, Deserialize, Default)]
683#[serde(rename_all = "camelCase")]
684pub struct SetShowAdHighlightsParams {
685    /// True for showing ad highlights
686
687    pub show: bool,
688}
689
690
691#[derive(Debug, Clone, Serialize, Deserialize, Default)]
692#[serde(rename_all = "camelCase")]
693pub struct SetPausedInDebuggerMessageParams {
694    /// The message to display, also triggers resume and step over controls.
695
696    #[serde(skip_serializing_if = "Option::is_none")]
697    pub message: Option<String>,
698}
699
700/// Requests that backend shows debug borders on layers
701
702#[derive(Debug, Clone, Serialize, Deserialize, Default)]
703#[serde(rename_all = "camelCase")]
704pub struct SetShowDebugBordersParams {
705    /// True for showing debug borders
706
707    pub show: bool,
708}
709
710/// Requests that backend shows the FPS counter
711
712#[derive(Debug, Clone, Serialize, Deserialize, Default)]
713#[serde(rename_all = "camelCase")]
714pub struct SetShowFPSCounterParams {
715    /// True for showing the FPS counter
716
717    pub show: bool,
718}
719
720/// Highlight multiple elements with the CSS Grid overlay.
721
722#[derive(Debug, Clone, Serialize, Deserialize, Default)]
723#[serde(rename_all = "camelCase")]
724pub struct SetShowGridOverlaysParams {
725    /// An array of node identifiers and descriptors for the highlight appearance.
726
727    pub gridNodeHighlightConfigs: Vec<GridNodeHighlightConfig>,
728}
729
730
731#[derive(Debug, Clone, Serialize, Deserialize, Default)]
732#[serde(rename_all = "camelCase")]
733pub struct SetShowFlexOverlaysParams {
734    /// An array of node identifiers and descriptors for the highlight appearance.
735
736    pub flexNodeHighlightConfigs: Vec<FlexNodeHighlightConfig>,
737}
738
739
740#[derive(Debug, Clone, Serialize, Deserialize, Default)]
741#[serde(rename_all = "camelCase")]
742pub struct SetShowScrollSnapOverlaysParams {
743    /// An array of node identifiers and descriptors for the highlight appearance.
744
745    pub scrollSnapHighlightConfigs: Vec<ScrollSnapHighlightConfig>,
746}
747
748
749#[derive(Debug, Clone, Serialize, Deserialize, Default)]
750#[serde(rename_all = "camelCase")]
751pub struct SetShowContainerQueryOverlaysParams {
752    /// An array of node identifiers and descriptors for the highlight appearance.
753
754    pub containerQueryHighlightConfigs: Vec<ContainerQueryHighlightConfig>,
755}
756
757
758#[derive(Debug, Clone, Serialize, Deserialize, Default)]
759#[serde(rename_all = "camelCase")]
760pub struct SetShowInspectedElementAnchorParams {
761    /// Node identifier for which to show an anchor for.
762
763    pub inspectedElementAnchorConfig: InspectedElementAnchorConfig,
764}
765
766/// Requests that backend shows paint rectangles
767
768#[derive(Debug, Clone, Serialize, Deserialize, Default)]
769#[serde(rename_all = "camelCase")]
770pub struct SetShowPaintRectsParams {
771    /// True for showing paint rectangles
772
773    pub result: bool,
774}
775
776/// Requests that backend shows layout shift regions
777
778#[derive(Debug, Clone, Serialize, Deserialize, Default)]
779#[serde(rename_all = "camelCase")]
780pub struct SetShowLayoutShiftRegionsParams {
781    /// True for showing layout shift regions
782
783    pub result: bool,
784}
785
786/// Requests that backend shows scroll bottleneck rects
787
788#[derive(Debug, Clone, Serialize, Deserialize, Default)]
789#[serde(rename_all = "camelCase")]
790pub struct SetShowScrollBottleneckRectsParams {
791    /// True for showing scroll bottleneck rects
792
793    pub show: bool,
794}
795
796/// Deprecated, no longer has any effect.
797
798#[derive(Debug, Clone, Serialize, Deserialize, Default)]
799#[serde(rename_all = "camelCase")]
800pub struct SetShowHitTestBordersParams {
801    /// True for showing hit-test borders
802
803    pub show: bool,
804}
805
806/// Deprecated, no longer has any effect.
807
808#[derive(Debug, Clone, Serialize, Deserialize, Default)]
809#[serde(rename_all = "camelCase")]
810pub struct SetShowWebVitalsParams {
811
812    pub show: bool,
813}
814
815/// Paints viewport size upon main frame resize.
816
817#[derive(Debug, Clone, Serialize, Deserialize, Default)]
818#[serde(rename_all = "camelCase")]
819pub struct SetShowViewportSizeOnResizeParams {
820    /// Whether to paint size or not.
821
822    pub show: bool,
823}
824
825/// Add a dual screen device hinge
826
827#[derive(Debug, Clone, Serialize, Deserialize, Default)]
828#[serde(rename_all = "camelCase")]
829pub struct SetShowHingeParams {
830    /// hinge data, null means hideHinge
831
832    #[serde(skip_serializing_if = "Option::is_none")]
833    pub hingeConfig: Option<HingeConfig>,
834}
835
836/// Show elements in isolation mode with overlays.
837
838#[derive(Debug, Clone, Serialize, Deserialize, Default)]
839#[serde(rename_all = "camelCase")]
840pub struct SetShowIsolatedElementsParams {
841    /// An array of node identifiers and descriptors for the highlight appearance.
842
843    pub isolatedElementHighlightConfigs: Vec<IsolatedElementHighlightConfig>,
844}
845
846/// Show Window Controls Overlay for PWA
847
848#[derive(Debug, Clone, Serialize, Deserialize, Default)]
849#[serde(rename_all = "camelCase")]
850pub struct SetShowWindowControlsOverlayParams {
851    /// Window Controls Overlay data, null means hide Window Controls Overlay
852
853    #[serde(skip_serializing_if = "Option::is_none")]
854    pub windowControlsOverlayConfig: Option<WindowControlsOverlayConfig>,
855}