pl.wendigo.chrome.api.emulation / EmulationOperations

EmulationOperations

class EmulationOperations (source)

This domain emulates different environments for the page.

Link
Protocol Emulation domain documentation.

Functions

canEmulate

fun canEmulate(): Single<CanEmulateResponse>

Tells whether emulation is supported.

clearDeviceMetricsOverride

fun clearDeviceMetricsOverride(): Single<ResponseFrame>

Clears the overriden device metrics.

clearGeolocationOverride

fun clearGeolocationOverride(): Single<ResponseFrame>

Clears the overriden Geolocation Position and Error.

events

fun events(): Flowable<Event>

Returns flowable capturing all Emulation domains events.

resetPageScaleFactor

fun resetPageScaleFactor(): Single<ResponseFrame>

Requests that page scale factor is reset to initial values.

setCPUThrottlingRate

fun setCPUThrottlingRate(input: SetCPUThrottlingRateRequest): Single<ResponseFrame>

Enables CPU throttling to emulate slow CPUs.

setDefaultBackgroundColorOverride

fun setDefaultBackgroundColorOverride(input: SetDefaultBackgroundColorOverrideRequest): Single<ResponseFrame>

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

setDeviceMetricsOverride

fun setDeviceMetricsOverride(input: SetDeviceMetricsOverrideRequest): Single<ResponseFrame>

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

setDocumentCookieDisabled

fun setDocumentCookieDisabled(input: SetDocumentCookieDisabledRequest): Single<ResponseFrame>

setEmitTouchEventsForMouse

fun setEmitTouchEventsForMouse(input: SetEmitTouchEventsForMouseRequest): Single<ResponseFrame>

setEmulatedMedia

fun setEmulatedMedia(input: SetEmulatedMediaRequest): Single<ResponseFrame>

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

setFocusEmulationEnabled

fun setFocusEmulationEnabled(input: SetFocusEmulationEnabledRequest): Single<ResponseFrame>

Enables or disables simulating a focused and active page.

setGeolocationOverride

fun setGeolocationOverride(input: SetGeolocationOverrideRequest): Single<ResponseFrame>

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

setNavigatorOverrides

fun setNavigatorOverrides(input: SetNavigatorOverridesRequest): Single<ResponseFrame>

Overrides value returned by the javascript navigator object.

setPageScaleFactor

fun setPageScaleFactor(input: SetPageScaleFactorRequest): Single<ResponseFrame>

Sets a specified page scale factor.

setScriptExecutionDisabled

fun setScriptExecutionDisabled(input: SetScriptExecutionDisabledRequest): Single<ResponseFrame>

Switches script execution in the page.

setScrollbarsHidden

fun setScrollbarsHidden(input: SetScrollbarsHiddenRequest): Single<ResponseFrame>

setTimezoneOverride

fun setTimezoneOverride(input: SetTimezoneOverrideRequest): Single<ResponseFrame>

Overrides default host system timezone with the specified one.

setTouchEmulationEnabled

fun setTouchEmulationEnabled(input: SetTouchEmulationEnabledRequest): Single<ResponseFrame>

Enables touch on platforms which do not support them.

setUserAgentOverride

fun setUserAgentOverride(input: SetUserAgentOverrideRequest): Single<ResponseFrame>

Allows overriding user agent with the given string.

setVirtualTimePolicy

fun setVirtualTimePolicy(input: SetVirtualTimePolicyRequest): Single<SetVirtualTimePolicyResponse>

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.

setVisibleSize

fun setVisibleSize(input: SetVisibleSizeRequest): Single<ResponseFrame>

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.

virtualTimeBudgetExpired

fun virtualTimeBudgetExpired(): Flowable<Event>

Notification sent after the virtual time budget for the current VirtualTimePolicy has run out.