Module cdp::emulation
[−]
[src]
This domain emulates different environments for the page.
Emulation
Commands
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).
Emulation.clearDeviceMetricsOverride
Clears the overriden device metrics.
Emulation.resetPageScaleFactor
ExperimentalRequests that page scale factor is reset to initial values.
Emulation.setPageScaleFactor
ExperimentalSets a specified page scale factor.
Emulation.setVisibleSize
Experimental [Deprecated]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.
Emulation.setScriptExecutionDisabled
ExperimentalSwitches script execution in the page.
Emulation.setGeolocationOverride
ExperimentalOverrides the Geolocation Position or Error. Omitting any of the parameters emulates position unavailable.
Emulation.clearGeolocationOverride
ExperimentalClears the overriden Geolocation Position and Error.
Emulation.setTouchEmulationEnabled
Enables touch on platforms which do not support them.
Emulation.setEmitTouchEventsForMouse
Experimental-
Emulates the given media for CSS media queries.
Emulation.setCPUThrottlingRate
ExperimentalEnables CPU throttling to emulate slow CPUs.
Emulation.canEmulate
ExperimentalTells whether emulation is supported.
Emulation.setVirtualTimePolicy
ExperimentalTurns 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.
Emulation.setDefaultBackgroundColorOverride
ExperimentalSets or clears an override of the default background color of the frame. This override is used if the content does not specify one.
Events
Emulation.virtualTimeBudgetExpired
ExperimentalNotification sent after the virtual time budget for the current VirtualTimePolicy has run out.
Emulation.virtualTimePaused
ExperimentalNotification sent after the virtual time has paused.
Types
-
Screen orientation.
VirtualTimePolicy
Experimentaladvance: If the scheduler runs out of immediate work, the virtual time base may fast forward to allow the next delayed task (if any) to run; pause: The virtual time base may not advance; pauseIfNetworkFetchesPending: The virtual time base may not advance if there are any pending resource fetches.
Structs
CanEmulateCommand |
[Experimental] Tells whether emulation is supported. |
CanEmulateResponse |
[Experimental] Tells whether emulation is supported. |
ClearDeviceMetricsOverrideCommand |
Clears the overriden device metrics. |
ClearDeviceMetricsOverrideResponse |
Clears the overriden device metrics. |
ClearGeolocationOverrideCommand |
[Experimental] Clears the overriden Geolocation Position and Error. |
ClearGeolocationOverrideResponse |
[Experimental] Clears the overriden Geolocation Position and Error. |
ResetPageScaleFactorCommand |
[Experimental] Requests that page scale factor is reset to initial values. |
ResetPageScaleFactorResponse |
[Experimental] Requests that page scale factor is reset to initial values. |
ScreenOrientation |
Screen orientation. |
SetCpuThrottlingRateCommand |
[Experimental] Enables CPU throttling to emulate slow CPUs. |
SetCpuThrottlingRateResponse |
[Experimental] Enables CPU throttling to emulate slow CPUs. |
SetDefaultBackgroundColorOverrideCommand |
[Experimental] Sets or clears an override of the default background color of the frame. This override is used if the content does not specify one. |
SetDefaultBackgroundColorOverrideResponse |
[Experimental] Sets or clears an override of the default background color of the frame. This override is used if the content does not specify one. |
SetDeviceMetricsOverrideCommand |
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). |
SetDeviceMetricsOverrideResponse |
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). |
SetEmitTouchEventsForMouseCommand |
[Experimental] |
SetEmitTouchEventsForMouseResponse |
[Experimental] |
SetEmulatedMediaCommand |
Emulates the given media for CSS media queries. |
SetEmulatedMediaResponse |
Emulates the given media for CSS media queries. |
SetGeolocationOverrideCommand |
[Experimental] Overrides the Geolocation Position or Error. Omitting any of the parameters emulates position unavailable. |
SetGeolocationOverrideResponse |
[Experimental] Overrides the Geolocation Position or Error. Omitting any of the parameters emulates position unavailable. |
SetPageScaleFactorCommand |
[Experimental] Sets a specified page scale factor. |
SetPageScaleFactorResponse |
[Experimental] Sets a specified page scale factor. |
SetScriptExecutionDisabledCommand |
[Experimental] Switches script execution in the page. |
SetScriptExecutionDisabledResponse |
[Experimental] Switches script execution in the page. |
SetTouchEmulationEnabledCommand |
Enables touch on platforms which do not support them. |
SetTouchEmulationEnabledResponse |
Enables touch on platforms which do not support them. |
SetVirtualTimePolicyCommand |
[Experimental] 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. |
SetVirtualTimePolicyResponse |
[Experimental] 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. |
SetVisibleSizeCommand |
[ Deprecated ] [Experimental] 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. |
SetVisibleSizeResponse |
[ Deprecated ] [Experimental] 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. |
VirtualTimeBudgetExpiredEvent |
[Experimental] Notification sent after the virtual time budget for the current VirtualTimePolicy has run out. |
VirtualTimePausedEvent |
[Experimental] Notification sent after the virtual time has paused. |
Enums
ScreenOrientationType |
Used in the type of |
SetEmitTouchEventsForMouseCommandConfiguration |
[Experimental] |
VirtualTimePolicy |
[Experimental] advance: If the scheduler runs out of immediate work, the virtual time base may fast forward to allow the next delayed task (if any) to run; pause: The virtual time base may not advance; pauseIfNetworkFetchesPending: The virtual time base may not advance if there are any pending resource fetches. |