Expand description
This domain emulates different environments for the page.
Method names for the Emulation domain, for use with
CdpClient::call.
Constants§
- ADD_
SCREEN - Add a new screen to the device. Only supported in headless mode.
- CAN_
EMULATE - Tells whether emulation is supported.
- CLEAR_
DEVICE_ METRICS_ OVERRIDE - Clears the overridden device metrics.
- CLEAR_
DEVICE_ POSTURE_ OVERRIDE - Clears a device posture override set with either setDeviceMetricsOverride() or setDevicePostureOverride() and starts using posture information from the platform again. Does nothing if no override is set.
- CLEAR_
DISPLAY_ FEATURES_ OVERRIDE - Clears the display features override set with either setDeviceMetricsOverride() or setDisplayFeaturesOverride() and starts using display features from the platform again. Does nothing if no override is set.
- CLEAR_
GEOLOCATION_ OVERRIDE - Clears the overridden Geolocation Position and Error.
- CLEAR_
IDLE_ OVERRIDE - Clears Idle state overrides.
- GET_
OVERRIDDEN_ SENSOR_ INFORMATION Emulation.getOverriddenSensorInformation- GET_
SCREEN_ INFOS - Returns device’s screen configuration. In headful mode, the physical screens configuration is returned, whereas in headless mode, a virtual headless screen configuration is provided instead.
- REMOVE_
SCREEN - Remove screen from the device. Only supported in headless mode.
- RESET_
PAGE_ SCALE_ FACTOR - Requests that page scale factor is reset to initial values.
- SET_
AUTOMATION_ OVERRIDE - Allows overriding the automation flag.
- SET_
AUTO_ DARK_ MODE_ OVERRIDE - Automatically render all web contents using a dark theme.
- SET_
CPU_ PERFORMANCE_ OVERRIDE - Overrides the value of navigator.cpuPerformance
- SET_
CPU_ THROTTLING_ RATE - Enables CPU throttling to emulate slow CPUs.
- SET_
DATA_ SAVER_ OVERRIDE - Override the value of navigator.connection.saveData
- SET_
DEFAULT_ BACKGROUND_ COLOR_ OVERRIDE - Sets or clears an override of the default background color of the frame. This override is used if the content does not specify one.
- SET_
DEVICE_ METRICS_ OVERRIDE - Overrides the values of device screen dimensions (window.screen.width, window.screen.height, window.innerWidth, window.innerHeight, and “device-width”/“device-height”-related CSS media query results).
- SET_
DEVICE_ POSTURE_ OVERRIDE - Start reporting the given posture value to the Device Posture API. This override can also be set in setDeviceMetricsOverride().
- SET_
DISABLED_ IMAGE_ TYPES Emulation.setDisabledImageTypes- SET_
DISPLAY_ FEATURES_ OVERRIDE - Start using the given display features to pupulate the Viewport Segments API. This override can also be set in setDeviceMetricsOverride().
- SET_
DOCUMENT_ COOKIE_ DISABLED Emulation.setDocumentCookieDisabled- SET_
EMIT_ TOUCH_ EVENTS_ FOR_ MOUSE Emulation.setEmitTouchEventsForMouse- SET_
EMULATED_ MEDIA - Emulates the given media type or media feature for CSS media queries.
- SET_
EMULATED_ OS_ TEXT_ SCALE - Emulates the given OS text scale.
- SET_
EMULATED_ VISION_ DEFICIENCY - Emulates the given vision deficiency.
- SET_
FOCUS_ EMULATION_ ENABLED - Enables or disables simulating a focused and active page.
- SET_
GEOLOCATION_ OVERRIDE - Overrides the Geolocation Position or Error. Omitting latitude, longitude or accuracy emulates position unavailable.
- SET_
HARDWARE_ CONCURRENCY_ OVERRIDE Emulation.setHardwareConcurrencyOverride- SET_
IDLE_ OVERRIDE - Overrides the Idle state.
- SET_
LOCALE_ OVERRIDE - Overrides default host system locale with the specified one.
- SET_
NAVIGATOR_ OVERRIDES - Overrides value returned by the javascript navigator object.
- SET_
PAGE_ SCALE_ FACTOR - Sets a specified page scale factor.
- SET_
PRESSURE_ SOURCE_ OVERRIDE_ ENABLED - Overrides a pressure source of a given type, as used by the Compute Pressure API, so that updates to PressureObserver.observe() are provided via setPressureStateOverride instead of being retrieved from platform-provided telemetry data.
- SET_
PRESSURE_ STATE_ OVERRIDE - Provides a given pressure state that will be processed and eventually be delivered to PressureObserver users. |source| must have been previously overridden by setPressureSourceOverrideEnabled.
- SET_
PRIMARY_ SCREEN - Set primary screen. Only supported in headless mode. Note that this changes the coordinate system origin to the top-left of the new primary screen, updating the bounds and work areas of all existing screens accordingly.
- SET_
SAFE_ AREA_ INSETS_ OVERRIDE - Overrides the values for env(safe-area-inset-) and env(safe-area-max-inset-). Unset values will cause the respective variables to be undefined, even if previously overridden.
- SET_
SCRIPT_ EXECUTION_ DISABLED - Switches script execution in the page.
- SET_
SCROLLBARS_ HIDDEN Emulation.setScrollbarsHidden- SET_
SENSOR_ OVERRIDE_ ENABLED - Overrides a platform sensor of a given type. If |enabled| is true, calls to Sensor.start() will use a virtual sensor as backend rather than fetching data from a real hardware sensor. Otherwise, existing virtual sensor-backend Sensor objects will fire an error event and new calls to Sensor.start() will attempt to use a real sensor instead.
- SET_
SENSOR_ OVERRIDE_ READINGS - Updates the sensor readings reported by a sensor type previously overridden by setSensorOverrideEnabled.
- SET_
SMALL_ VIEWPORT_ HEIGHT_ DIFFERENCE_ OVERRIDE - Allows overriding the difference between the small and large viewport
sizes, which determine the value of the
svhandlvhunit, respectively. Only supported for top-level frames. - SET_
TIMEZONE_ OVERRIDE - Overrides default host system timezone with the specified one.
- SET_
TOUCH_ EMULATION_ ENABLED - Enables touch on platforms which do not support them.
- SET_
USER_ AGENT_ OVERRIDE - Allows overriding user agent with the given string.
userAgentMetadatamust be set for Client Hint headers to be sent. - SET_
VIRTUAL_ KEYBOARD_ GEOMETRY_ OVERRIDE - Overrides virtual keyboard geometry in CSS pixels, relative to the top-level viewport. The provided rect is used for navigator.virtualKeyboard.boundingRect, geometrychange events, and env(keyboard-inset-*) values on the inspected frame. The override applies independently of navigator.virtualKeyboard.overlaysContent so clients can preview overlay geometry without mutating page state. Values are rounded to the nearest CSS pixel. Omitting the rect clears the override.
- SET_
VIRTUAL_ TIME_ POLICY - Turns on virtual time for all frames (replacing real-time with a synthetic time source) and sets the current virtual time policy. Note this supersedes any previous time budget.
- SET_
VISIBLE_ SIZE - Resizes the frame/viewport of the page. Note that this does not affect the frame’s container (e.g. browser window). Can be used to produce screenshots of the specified size. Not supported on Android.
- UPDATE_
SCREEN - Updates specified screen parameters. Only supported in headless mode.