src/domains/emulation

Search:
Group by:

This module provides a direct mapping of CDP events and commands for v1.3 (stable) of the Emulation Domain.

This domain emulates different environments for the page.

Procs

proc clearDeviceMetricsOverride(tab: Tab): owned(Future[void]) {.
    ...stackTrace: false, raises: [Exception],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, TimeEffect], forbids: [].}

Emulation.clearDeviceMetricsOverride

Clears the overriden device metrics.

proc clearGeolocationOverride(tab: Tab): owned(Future[void]) {.
    ...stackTrace: false, raises: [Exception],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, TimeEffect], forbids: [].}

Emulation.clearGeolocationOverride

Clears the overriden Geolocation Position and Error.

proc clearIdleOverride(tab: Tab): owned(Future[void]) {....stackTrace: false,
    raises: [Exception],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, TimeEffect], forbids: [].}

Emulation.clearIdleOverride

Clears Idle state overrides.

proc setCPUThrottlingRate(tab: Tab; rate: int | float): owned(Future[void]) {.
    ...stackTrace: false.}

Emulation.setCPUThrottlingRate

Enables CPU throttling to emulate slow CPUs.

proc setDefaultBackgroundColorOverride(tab: Tab; color: JsonNode): owned(
    Future[void]) {....stackTrace: false, raises: [Exception], tags: [RootEffect,
    WriteIOEffect, ReadIOEffect, TimeEffect], forbids: [].}

Emulation.setDefaultBackgroundColorOverride

Sets or clears an override of the default background color of the frame. This override is used if the content does not specify one.

proc setDeviceMetricsOverride(tab: Tab; width, heigh: int;
                              deviceScaleFactor: float | int; mobile: bool): owned(
    Future[void]) {....stackTrace: false.}
proc setDeviceMetricsOverride(tab: Tab; width, height: int;
                              deviceScaleFactor: float | int; mobile: bool;
                              params: JsonNode): owned(Future[void]) {.
    ...stackTrace: false.}

Emulation.setDeviceMetricsOverride

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).

proc setEmulatedMedia(tab: Tab): owned(Future[void]) {....stackTrace: false,
    raises: [Exception],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, TimeEffect], forbids: [].}
proc setEmulatedMedia(tab: Tab; params: JsonNode): owned(Future[void]) {.
    ...stackTrace: false, raises: [Exception],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, TimeEffect], forbids: [].}

Emulation.setEmulatedMedia

Emulates the given media type or media feature for CSS media queries.

proc setEmulatedVisionDeficiency(tab: Tab; type: string): owned(Future[void]) {.
    ...stackTrace: false, raises: [Exception],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, TimeEffect], forbids: [].}

Emulation.setEmulatedVisionDeficiency

Emulates the given vision deficiency.

proc setGeolocationOverride(tab: Tab): owned(Future[void]) {....stackTrace: false,
    raises: [Exception],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, TimeEffect], forbids: [].}
proc setGeolocationOverride(tab: Tab; params: JsonNode): owned(Future[void]) {.
    ...stackTrace: false, raises: [Exception],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, TimeEffect], forbids: [].}

Emulation.setGeolocationOverride

Overrides the Geolocation Position or Error. Omitting any of the parameters emulates position unavailable.

proc setIdleOverride(tab: Tab; isUserActive, isScreenUnlocked: bool): owned(
    Future[void]) {....stackTrace: false, raises: [Exception], tags: [RootEffect,
    WriteIOEffect, ReadIOEffect, TimeEffect], forbids: [].}

Emulation.setIdleOverride

Overrides the Idle state.

proc setScriptExecutionDisabled(tab: Tab; value: bool): owned(Future[void]) {.
    ...stackTrace: false, raises: [Exception],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, TimeEffect], forbids: [].}

Emulation.setScriptExecutionDisabled

Switches script execution in the page.

proc setTimezoneOverride(tab: Tab; timezoneId: string): owned(Future[void]) {.
    ...stackTrace: false, raises: [Exception],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, TimeEffect], forbids: [].}

Emulation.setTimezoneOverride

Overrides default host system timezone with the specified one.

proc setTouchEmulationEnabled(tab: Tab; enabled: bool): owned(Future[void]) {.
    ...stackTrace: false, raises: [Exception],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, TimeEffect], forbids: [].}
proc setTouchEmulationEnabled(tab: Tab; enabled: bool; params: JsonNode): owned(
    Future[void]) {....stackTrace: false, raises: [Exception], tags: [RootEffect,
    WriteIOEffect, ReadIOEffect, TimeEffect], forbids: [].}

Emulation.setTouchEmulationEnabled

Enables touch on platforms which do not support them.

proc setUserAgentOverrideEmulationDomain(tab: Tab; userAgent: string): owned(
    Future[void]) {....stackTrace: false, raises: [Exception], tags: [RootEffect,
    WriteIOEffect, ReadIOEffect, TimeEffect], forbids: [].}
proc setUserAgentOverrideEmulationDomain(tab: Tab; userAgent: string;
    params: JsonNode): owned(Future[void]) {....stackTrace: false,
    raises: [Exception],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, TimeEffect], forbids: [].}

Emulation.setUserAgentOverride

Allows overriding user agent with the given string. Allows overriding user agent with the given string. userAgentMetadata must be set for Client Hint headers to be sent.