Module cdp::emulation
[−]
[src]
This domain emulates different environments for the page.
Emulation
Commands
Emulation.setDeviceMetricsOverrideOverrides 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.clearDeviceMetricsOverrideClears the overriden device metrics.
Emulation.resetPageScaleFactorExperimentalRequests that page scale factor is reset to initial values.
Emulation.setPageScaleFactorExperimentalSets a specified page scale factor.
Emulation.setVisibleSizeExperimental [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.setScriptExecutionDisabledExperimentalSwitches script execution in the page.
Emulation.setGeolocationOverrideExperimentalOverrides the Geolocation Position or Error. Omitting any of the parameters emulates position unavailable.
Emulation.clearGeolocationOverrideExperimentalClears the overriden Geolocation Position and Error.
Emulation.setTouchEmulationEnabledEnables touch on platforms which do not support them.
Emulation.setEmitTouchEventsForMouseExperimental-
Emulates the given media for CSS media queries.
Emulation.setCPUThrottlingRateExperimentalEnables CPU throttling to emulate slow CPUs.
Emulation.canEmulateExperimentalTells whether emulation is supported.
Emulation.setVirtualTimePolicyExperimentalTurns 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.setDefaultBackgroundColorOverrideExperimentalSets 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.virtualTimeBudgetExpiredExperimentalNotification sent after the virtual time budget for the current VirtualTimePolicy has run out.
Emulation.virtualTimePausedExperimentalNotification sent after the virtual time has paused.
Types
-
Screen orientation.
VirtualTimePolicyExperimentaladvance: 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. |