Skip to main content

browser_protocol/overlay/
mod.rs

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