Chrome Remote Interface v0.4.1 ChromeRemoteInterface.RPC.Emulation View Source

This domain emulates different environments for the page.

Link to this section Summary

Functions

Tells whether emulation is supported.

Clears the overriden device metrics.

Clears the overriden Geolocation Position and Error.

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

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

Emulates the given media for CSS media queries.

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

Switches script execution in the page.

Enables touch on platforms which do not support them.

Allows overriding user agent with the given string.

Link to this section Functions

Tells whether emulation is supported.

Parameters:

Link to this function

canEmulate(page_pid, parameters) View Source

Link to this function

canEmulate(page_pid, parameters, opts) View Source

Link to this function

clearDeviceMetricsOverride(page_pid) View Source

Clears the overriden device metrics.

Parameters:

Link to this function

clearDeviceMetricsOverride(page_pid, parameters) View Source

Link to this function

clearDeviceMetricsOverride(page_pid, parameters, opts) View Source

Link to this function

clearGeolocationOverride(page_pid) View Source

Clears the overriden Geolocation Position and Error.

Parameters:

Link to this function

clearGeolocationOverride(page_pid, parameters) View Source

Link to this function

clearGeolocationOverride(page_pid, parameters, opts) View Source

Link to this function

setDefaultBackgroundColorOverride(page_pid) View Source

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

Parameters: color - - RGBA of the default background color. If not specified, any existing override will be cleared.

Link to this function

setDefaultBackgroundColorOverride(page_pid, parameters) View Source

Link to this function

setDefaultBackgroundColorOverride(page_pid, parameters, opts) View Source

Link to this function

setDeviceMetricsOverride(page_pid) View Source

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

Parameters: width - - Overriding width value in pixels (minimum 0, maximum 10000000). 0 disables the override.height - - Overriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override.deviceScaleFactor - - Overriding device scale factor value. 0 disables the override.mobile - - Whether to emulate mobile device. This includes viewport meta tag, overlay scrollbars, text autosizing and more.scale - - Scale to apply to resulting view image.screenWidth - - Overriding screen width value in pixels (minimum 0, maximum 10000000).screenHeight - - Overriding screen height value in pixels (minimum 0, maximum 10000000).positionX - - Overriding view X position on screen in pixels (minimum 0, maximum 10000000).positionY - - Overriding view Y position on screen in pixels (minimum 0, maximum 10000000).dontSetVisibleSize - - Do not set visible view size, rely upon explicit setVisibleSize call.screenOrientation - - Screen orientation override.viewport - - If set, the visible area of the page will be overridden to this viewport. This viewport change is not observed by the page, e.g. viewport-relative elements do not change positions.

Link to this function

setDeviceMetricsOverride(page_pid, parameters) View Source

Link to this function

setDeviceMetricsOverride(page_pid, parameters, opts) View Source

Link to this function

setEmulatedMedia(page_pid) View Source

Emulates the given media for CSS media queries.

Parameters: media - - Media type to emulate. Empty string disables the override.

Link to this function

setEmulatedMedia(page_pid, parameters) View Source

Link to this function

setEmulatedMedia(page_pid, parameters, opts) View Source

Link to this function

setGeolocationOverride(page_pid) View Source

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

Parameters: latitude - - Mock latitudelongitude - - Mock longitudeaccuracy - - Mock accuracy

Link to this function

setGeolocationOverride(page_pid, parameters) View Source

Link to this function

setGeolocationOverride(page_pid, parameters, opts) View Source

Link to this function

setScriptExecutionDisabled(page_pid) View Source

Switches script execution in the page.

Parameters: value - - Whether script execution should be disabled in the page.

Link to this function

setScriptExecutionDisabled(page_pid, parameters) View Source

Link to this function

setScriptExecutionDisabled(page_pid, parameters, opts) View Source

Link to this function

setTouchEmulationEnabled(page_pid) View Source

Enables touch on platforms which do not support them.

Parameters: enabled - - Whether the touch event emulation should be enabled.maxTouchPoints - - Maximum touch points supported. Defaults to one.

Link to this function

setTouchEmulationEnabled(page_pid, parameters) View Source

Link to this function

setTouchEmulationEnabled(page_pid, parameters, opts) View Source

Link to this function

setUserAgentOverride(page_pid) View Source

Allows overriding user agent with the given string.

Parameters: userAgent - - User agent to use.acceptLanguage - - Browser langugage to emulate.platform - - The platform navigator.platform should return.

Link to this function

setUserAgentOverride(page_pid, parameters) View Source

Link to this function

setUserAgentOverride(page_pid, parameters, opts) View Source