cdp_driver/methods/emulation.rs
1// @generated by `just generate-methods` from protocol/*.json.
2// Do not edit by hand; edit xtask/ and regenerate.
3
4//! This domain emulates different environments for the page.
5//!
6//! Method names for the `Emulation` domain, for use with
7//! [`CdpClient::call`](crate::CdpClient::call).
8
9/// Tells whether emulation is supported.
10///
11/// Deprecated in the protocol.
12///
13/// Returns: `result`
14pub const CAN_EMULATE: &str = "Emulation.canEmulate";
15
16/// Clears the overridden device metrics.
17pub const CLEAR_DEVICE_METRICS_OVERRIDE: &str = "Emulation.clearDeviceMetricsOverride";
18
19/// Clears the overridden Geolocation Position and Error.
20pub const CLEAR_GEOLOCATION_OVERRIDE: &str = "Emulation.clearGeolocationOverride";
21
22/// Requests that page scale factor is reset to initial values.
23///
24/// Experimental: may change without notice.
25pub const RESET_PAGE_SCALE_FACTOR: &str = "Emulation.resetPageScaleFactor";
26
27/// Enables or disables simulating a focused and active page.
28///
29/// Experimental: may change without notice.
30///
31/// Parameters:
32/// - `enabled`: boolean
33pub const SET_FOCUS_EMULATION_ENABLED: &str = "Emulation.setFocusEmulationEnabled";
34
35/// Automatically render all web contents using a dark theme.
36///
37/// Experimental: may change without notice.
38///
39/// Parameters:
40/// - `enabled`: boolean (optional)
41pub const SET_AUTO_DARK_MODE_OVERRIDE: &str = "Emulation.setAutoDarkModeOverride";
42
43/// Enables CPU throttling to emulate slow CPUs.
44///
45/// Parameters:
46/// - `rate`: number
47pub const SET_CPU_THROTTLING_RATE: &str = "Emulation.setCPUThrottlingRate";
48
49/// Sets or clears an override of the default background color of the frame.
50/// This override is used if the content does not specify one.
51///
52/// Parameters:
53/// - `color`: DOM.RGBA (optional)
54pub const SET_DEFAULT_BACKGROUND_COLOR_OVERRIDE: &str =
55 "Emulation.setDefaultBackgroundColorOverride";
56
57/// Overrides the values for env(safe-area-inset-*) and
58/// env(safe-area-max-inset-*). Unset values will cause the respective
59/// variables to be undefined, even if previously overridden.
60///
61/// Experimental: may change without notice.
62///
63/// Parameters:
64/// - `insets`: SafeAreaInsets
65pub const SET_SAFE_AREA_INSETS_OVERRIDE: &str = "Emulation.setSafeAreaInsetsOverride";
66
67/// Overrides virtual keyboard geometry in CSS pixels, relative to the
68/// top-level viewport. The provided rect is used for
69/// navigator.virtualKeyboard.boundingRect, geometrychange events, and
70/// env(keyboard-inset-*) values on the inspected frame. The override applies
71/// independently of navigator.virtualKeyboard.overlaysContent so clients can
72/// preview overlay geometry without mutating page state. Values are rounded
73/// to the nearest CSS pixel. Omitting the rect clears the override.
74///
75/// Experimental: may change without notice.
76///
77/// Parameters:
78/// - `keyboardRect`: DOM.Rect (optional)
79pub const SET_VIRTUAL_KEYBOARD_GEOMETRY_OVERRIDE: &str =
80 "Emulation.setVirtualKeyboardGeometryOverride";
81
82/// Overrides the values of device screen dimensions (window.screen.width,
83/// window.screen.height, window.innerWidth, window.innerHeight, and
84/// "device-width"/"device-height"-related CSS media query results).
85///
86/// Parameters:
87/// - `width`: integer
88/// - `height`: integer
89/// - `deviceScaleFactor`: number
90/// - `mobile`: boolean
91/// - `scale`: number (optional)
92/// - `screenWidth`: integer (optional)
93/// - `screenHeight`: integer (optional)
94/// - `positionX`: integer (optional)
95/// - `positionY`: integer (optional)
96/// - `dontSetVisibleSize`: boolean (optional)
97/// - `screenOrientation`: ScreenOrientation (optional)
98/// - `viewport`: Page.Viewport (optional)
99/// - `displayFeature`: DisplayFeature (optional)
100/// - `devicePosture`: DevicePosture (optional)
101/// - `scrollbarType`: string (optional)
102/// - `screenOrientationLockEmulation`: boolean (optional)
103/// - `viewportMeta`: string (optional)
104/// - `textLayoutMode`: string (optional)
105pub const SET_DEVICE_METRICS_OVERRIDE: &str = "Emulation.setDeviceMetricsOverride";
106
107/// Start reporting the given posture value to the Device Posture API. This
108/// override can also be set in setDeviceMetricsOverride().
109///
110/// Experimental: may change without notice.
111///
112/// Parameters:
113/// - `posture`: DevicePosture
114pub const SET_DEVICE_POSTURE_OVERRIDE: &str = "Emulation.setDevicePostureOverride";
115
116/// Clears a device posture override set with either
117/// setDeviceMetricsOverride() or setDevicePostureOverride() and starts using
118/// posture information from the platform again. Does nothing if no override
119/// is set.
120///
121/// Experimental: may change without notice.
122pub const CLEAR_DEVICE_POSTURE_OVERRIDE: &str = "Emulation.clearDevicePostureOverride";
123
124/// Start using the given display features to pupulate the Viewport Segments
125/// API. This override can also be set in setDeviceMetricsOverride().
126///
127/// Experimental: may change without notice.
128///
129/// Parameters:
130/// - `features`: array
131pub const SET_DISPLAY_FEATURES_OVERRIDE: &str = "Emulation.setDisplayFeaturesOverride";
132
133/// Clears the display features override set with either
134/// setDeviceMetricsOverride() or setDisplayFeaturesOverride() and starts
135/// using display features from the platform again. Does nothing if no
136/// override is set.
137///
138/// Experimental: may change without notice.
139pub const CLEAR_DISPLAY_FEATURES_OVERRIDE: &str = "Emulation.clearDisplayFeaturesOverride";
140
141/// `Emulation.setScrollbarsHidden`
142///
143/// Experimental: may change without notice.
144///
145/// Parameters:
146/// - `hidden`: boolean
147pub const SET_SCROLLBARS_HIDDEN: &str = "Emulation.setScrollbarsHidden";
148
149/// `Emulation.setDocumentCookieDisabled`
150///
151/// Experimental: may change without notice.
152///
153/// Parameters:
154/// - `disabled`: boolean
155pub const SET_DOCUMENT_COOKIE_DISABLED: &str = "Emulation.setDocumentCookieDisabled";
156
157/// `Emulation.setEmitTouchEventsForMouse`
158///
159/// Experimental: may change without notice.
160///
161/// Parameters:
162/// - `enabled`: boolean
163/// - `configuration`: string (optional)
164pub const SET_EMIT_TOUCH_EVENTS_FOR_MOUSE: &str = "Emulation.setEmitTouchEventsForMouse";
165
166/// Emulates the given media type or media feature for CSS media queries.
167///
168/// Parameters:
169/// - `media`: string (optional)
170/// - `features`: array (optional)
171pub const SET_EMULATED_MEDIA: &str = "Emulation.setEmulatedMedia";
172
173/// Emulates the given vision deficiency.
174///
175/// Parameters:
176/// - `type`: string
177pub const SET_EMULATED_VISION_DEFICIENCY: &str = "Emulation.setEmulatedVisionDeficiency";
178
179/// Emulates the given OS text scale.
180///
181/// Parameters:
182/// - `scale`: number (optional)
183pub const SET_EMULATED_OS_TEXT_SCALE: &str = "Emulation.setEmulatedOSTextScale";
184
185/// Overrides the Geolocation Position or Error. Omitting latitude, longitude
186/// or accuracy emulates position unavailable.
187///
188/// Parameters:
189/// - `latitude`: number (optional)
190/// - `longitude`: number (optional)
191/// - `accuracy`: number (optional)
192/// - `altitude`: number (optional)
193/// - `altitudeAccuracy`: number (optional)
194/// - `heading`: number (optional)
195/// - `speed`: number (optional)
196pub const SET_GEOLOCATION_OVERRIDE: &str = "Emulation.setGeolocationOverride";
197
198/// `Emulation.getOverriddenSensorInformation`
199///
200/// Experimental: may change without notice.
201///
202/// Parameters:
203/// - `type`: SensorType
204///
205/// Returns: `requestedSamplingFrequency`
206pub const GET_OVERRIDDEN_SENSOR_INFORMATION: &str = "Emulation.getOverriddenSensorInformation";
207
208/// Overrides a platform sensor of a given type. If |enabled| is true, calls
209/// to Sensor.start() will use a virtual sensor as backend rather than
210/// fetching data from a real hardware sensor. Otherwise, existing virtual
211/// sensor-backend Sensor objects will fire an error event and new calls to
212/// Sensor.start() will attempt to use a real sensor instead.
213///
214/// Experimental: may change without notice.
215///
216/// Parameters:
217/// - `enabled`: boolean
218/// - `type`: SensorType
219/// - `metadata`: SensorMetadata (optional)
220pub const SET_SENSOR_OVERRIDE_ENABLED: &str = "Emulation.setSensorOverrideEnabled";
221
222/// Updates the sensor readings reported by a sensor type previously
223/// overridden by setSensorOverrideEnabled.
224///
225/// Experimental: may change without notice.
226///
227/// Parameters:
228/// - `type`: SensorType
229/// - `reading`: SensorReading
230pub const SET_SENSOR_OVERRIDE_READINGS: &str = "Emulation.setSensorOverrideReadings";
231
232/// Overrides a pressure source of a given type, as used by the Compute
233/// Pressure API, so that updates to PressureObserver.observe() are provided
234/// via setPressureStateOverride instead of being retrieved from
235/// platform-provided telemetry data.
236///
237/// Experimental: may change without notice.
238///
239/// Parameters:
240/// - `enabled`: boolean
241/// - `source`: PressureSource
242/// - `metadata`: PressureMetadata (optional)
243pub const SET_PRESSURE_SOURCE_OVERRIDE_ENABLED: &str = "Emulation.setPressureSourceOverrideEnabled";
244
245/// Provides a given pressure state that will be processed and eventually be
246/// delivered to PressureObserver users. |source| must have been previously
247/// overridden by setPressureSourceOverrideEnabled.
248///
249/// Experimental: may change without notice.
250///
251/// Parameters:
252/// - `source`: PressureSource
253/// - `state`: PressureState
254pub const SET_PRESSURE_STATE_OVERRIDE: &str = "Emulation.setPressureStateOverride";
255
256/// Overrides the Idle state.
257///
258/// Parameters:
259/// - `isUserActive`: boolean
260/// - `isScreenUnlocked`: boolean
261pub const SET_IDLE_OVERRIDE: &str = "Emulation.setIdleOverride";
262
263/// Clears Idle state overrides.
264pub const CLEAR_IDLE_OVERRIDE: &str = "Emulation.clearIdleOverride";
265
266/// Overrides value returned by the javascript navigator object.
267///
268/// Deprecated in the protocol.
269/// Experimental: may change without notice.
270///
271/// Parameters:
272/// - `platform`: string
273pub const SET_NAVIGATOR_OVERRIDES: &str = "Emulation.setNavigatorOverrides";
274
275/// Sets a specified page scale factor.
276///
277/// Experimental: may change without notice.
278///
279/// Parameters:
280/// - `pageScaleFactor`: number
281pub const SET_PAGE_SCALE_FACTOR: &str = "Emulation.setPageScaleFactor";
282
283/// Switches script execution in the page.
284///
285/// Parameters:
286/// - `value`: boolean
287pub const SET_SCRIPT_EXECUTION_DISABLED: &str = "Emulation.setScriptExecutionDisabled";
288
289/// Enables touch on platforms which do not support them.
290///
291/// Parameters:
292/// - `enabled`: boolean
293/// - `maxTouchPoints`: integer (optional)
294pub const SET_TOUCH_EMULATION_ENABLED: &str = "Emulation.setTouchEmulationEnabled";
295
296/// Turns on virtual time for all frames (replacing real-time with a synthetic
297/// time source) and sets the current virtual time policy. Note this
298/// supersedes any previous time budget.
299///
300/// Experimental: may change without notice.
301///
302/// Parameters:
303/// - `policy`: VirtualTimePolicy
304/// - `budget`: number (optional)
305/// - `maxVirtualTimeTaskStarvationCount`: integer (optional)
306/// - `initialVirtualTime`: Network.TimeSinceEpoch (optional)
307///
308/// Returns: `virtualTimeTicksBase`
309pub const SET_VIRTUAL_TIME_POLICY: &str = "Emulation.setVirtualTimePolicy";
310
311/// Overrides default host system locale with the specified one.
312///
313/// Experimental: may change without notice.
314///
315/// Parameters:
316/// - `locale`: string (optional)
317pub const SET_LOCALE_OVERRIDE: &str = "Emulation.setLocaleOverride";
318
319/// Overrides default host system timezone with the specified one.
320///
321/// Parameters:
322/// - `timezoneId`: string
323pub const SET_TIMEZONE_OVERRIDE: &str = "Emulation.setTimezoneOverride";
324
325/// Resizes the frame/viewport of the page. Note that this does not affect the
326/// frame's container (e.g. browser window). Can be used to produce
327/// screenshots of the specified size. Not supported on Android.
328///
329/// Deprecated in the protocol.
330/// Experimental: may change without notice.
331///
332/// Parameters:
333/// - `width`: integer
334/// - `height`: integer
335pub const SET_VISIBLE_SIZE: &str = "Emulation.setVisibleSize";
336
337/// `Emulation.setDisabledImageTypes`
338///
339/// Experimental: may change without notice.
340///
341/// Parameters:
342/// - `imageTypes`: array
343pub const SET_DISABLED_IMAGE_TYPES: &str = "Emulation.setDisabledImageTypes";
344
345/// Override the value of navigator.connection.saveData
346///
347/// Experimental: may change without notice.
348///
349/// Parameters:
350/// - `dataSaverEnabled`: boolean (optional)
351pub const SET_DATA_SAVER_OVERRIDE: &str = "Emulation.setDataSaverOverride";
352
353/// `Emulation.setHardwareConcurrencyOverride`
354///
355/// Experimental: may change without notice.
356///
357/// Parameters:
358/// - `hardwareConcurrency`: integer
359pub const SET_HARDWARE_CONCURRENCY_OVERRIDE: &str = "Emulation.setHardwareConcurrencyOverride";
360
361/// Overrides the value of navigator.cpuPerformance
362///
363/// Experimental: may change without notice.
364///
365/// Parameters:
366/// - `performanceTier`: string (optional)
367pub const SET_CPU_PERFORMANCE_OVERRIDE: &str = "Emulation.setCPUPerformanceOverride";
368
369/// Allows overriding user agent with the given string. `userAgentMetadata`
370/// must be set for Client Hint headers to be sent.
371///
372/// Parameters:
373/// - `userAgent`: string
374/// - `acceptLanguage`: string (optional)
375/// - `platform`: string (optional)
376/// - `userAgentMetadata`: UserAgentMetadata (optional)
377pub const SET_USER_AGENT_OVERRIDE: &str = "Emulation.setUserAgentOverride";
378
379/// Allows overriding the automation flag.
380///
381/// Experimental: may change without notice.
382///
383/// Parameters:
384/// - `enabled`: boolean
385pub const SET_AUTOMATION_OVERRIDE: &str = "Emulation.setAutomationOverride";
386
387/// Allows overriding the difference between the small and large viewport
388/// sizes, which determine the value of the `svh` and `lvh` unit,
389/// respectively. Only supported for top-level frames.
390///
391/// Experimental: may change without notice.
392///
393/// Parameters:
394/// - `difference`: integer
395pub const SET_SMALL_VIEWPORT_HEIGHT_DIFFERENCE_OVERRIDE: &str =
396 "Emulation.setSmallViewportHeightDifferenceOverride";
397
398/// Returns device's screen configuration. In headful mode, the physical
399/// screens configuration is returned, whereas in headless mode, a virtual
400/// headless screen configuration is provided instead.
401///
402/// Experimental: may change without notice.
403///
404/// Returns: `screenInfos`
405pub const GET_SCREEN_INFOS: &str = "Emulation.getScreenInfos";
406
407/// Add a new screen to the device. Only supported in headless mode.
408///
409/// Experimental: may change without notice.
410///
411/// Parameters:
412/// - `left`: integer
413/// - `top`: integer
414/// - `width`: integer
415/// - `height`: integer
416/// - `workAreaInsets`: WorkAreaInsets (optional)
417/// - `devicePixelRatio`: number (optional)
418/// - `rotation`: integer (optional)
419/// - `colorDepth`: integer (optional)
420/// - `label`: string (optional)
421/// - `isInternal`: boolean (optional)
422///
423/// Returns: `screenInfo`
424pub const ADD_SCREEN: &str = "Emulation.addScreen";
425
426/// Updates specified screen parameters. Only supported in headless mode.
427///
428/// Experimental: may change without notice.
429///
430/// Parameters:
431/// - `screenId`: ScreenId
432/// - `left`: integer (optional)
433/// - `top`: integer (optional)
434/// - `width`: integer (optional)
435/// - `height`: integer (optional)
436/// - `workAreaInsets`: WorkAreaInsets (optional)
437/// - `devicePixelRatio`: number (optional)
438/// - `rotation`: integer (optional)
439/// - `colorDepth`: integer (optional)
440/// - `label`: string (optional)
441/// - `isInternal`: boolean (optional)
442///
443/// Returns: `screenInfo`
444pub const UPDATE_SCREEN: &str = "Emulation.updateScreen";
445
446/// Remove screen from the device. Only supported in headless mode.
447///
448/// Experimental: may change without notice.
449///
450/// Parameters:
451/// - `screenId`: ScreenId
452pub const REMOVE_SCREEN: &str = "Emulation.removeScreen";
453
454/// Set primary screen. Only supported in headless mode. Note that this
455/// changes the coordinate system origin to the top-left of the new primary
456/// screen, updating the bounds and work areas of all existing screens
457/// accordingly.
458///
459/// Experimental: may change without notice.
460///
461/// Parameters:
462/// - `screenId`: ScreenId
463pub const SET_PRIMARY_SCREEN: &str = "Emulation.setPrimaryScreen";