Liking cljdoc? Tell your friends :D

clj-chrome-devtools.commands.emulation

This domain emulates different environments for the page.

This domain emulates different environments for the page.
raw docstring

can-emulateclj

(can-emulate)
(can-emulate {:as params :keys []})
(can-emulate connection {:as params :keys []})

Tells whether emulation is supported.

Return map keys:

KeyDescription
:resultTrue if emulation is supported.
Tells whether emulation is supported.

Return map keys:


  Key     | Description 
  --------|------------ 
  :result | True if emulation is supported.
sourceraw docstring

clear-device-metrics-overrideclj

(clear-device-metrics-override)
(clear-device-metrics-override {:as params :keys []})
(clear-device-metrics-override connection {:as params :keys []})

Clears the overriden device metrics.

Clears the overriden device metrics.
sourceraw docstring

clear-geolocation-overrideclj

(clear-geolocation-override)
(clear-geolocation-override {:as params :keys []})
(clear-geolocation-override connection {:as params :keys []})

Clears the overriden Geolocation Position and Error.

Clears the overriden Geolocation Position and Error.
sourceraw docstring

reset-page-scale-factorclj

(reset-page-scale-factor)
(reset-page-scale-factor {:as params :keys []})
(reset-page-scale-factor connection {:as params :keys []})

Requests that page scale factor is reset to initial values.

Requests that page scale factor is reset to initial values.
sourceraw docstring

set-cpu-throttling-rateclj

(set-cpu-throttling-rate)
(set-cpu-throttling-rate {:as params :keys [rate]})
(set-cpu-throttling-rate connection {:as params :keys [rate]})

Enables CPU throttling to emulate slow CPUs.

Parameters map keys:

KeyDescription
:rateThrottling rate as a slowdown factor (1 is no throttle, 2 is 2x slowdown, etc).
Enables CPU throttling to emulate slow CPUs.

Parameters map keys:


  Key   | Description 
  ------|------------ 
  :rate | Throttling rate as a slowdown factor (1 is no throttle, 2 is 2x slowdown, etc).
sourceraw docstring

set-default-background-color-overrideclj

(set-default-background-color-override)
(set-default-background-color-override {:as params :keys [color]})
(set-default-background-color-override connection {:as params :keys [color]})

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 map keys:

KeyDescription
:colorRGBA of the default background color. If not specified, any existing override will be cleared. (optional)
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 map keys:


  Key    | Description 
  -------|------------ 
  :color | RGBA of the default background color. If not specified, any existing override will be cleared. (optional)
sourceraw docstring

set-device-metrics-overrideclj

(set-device-metrics-override)
(set-device-metrics-override {:as params
                              :keys [width height device-scale-factor mobile
                                     scale screen-width screen-height position-x
                                     position-y dont-set-visible-size
                                     screen-orientation]})
(set-device-metrics-override connection
                             {:as params
                              :keys [width height device-scale-factor mobile
                                     scale screen-width screen-height position-x
                                     position-y dont-set-visible-size
                                     screen-orientation]})

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 map keys:

KeyDescription
:widthOverriding width value in pixels (minimum 0, maximum 10000000). 0 disables the override.
:heightOverriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override.
:device-scale-factorOverriding device scale factor value. 0 disables the override.
:mobileWhether to emulate mobile device. This includes viewport meta tag, overlay scrollbars, text autosizing and more.
:scaleScale to apply to resulting view image. Ignored in
:screen-widthOverriding screen width value in pixels (minimum 0, maximum 10000000). Only used for
:screen-heightOverriding screen height value in pixels (minimum 0, maximum 10000000). Only used for
:position-xOverriding view X position on screen in pixels (minimum 0, maximum 10000000). Only used for
:position-yOverriding view Y position on screen in pixels (minimum 0, maximum 10000000). Only used for
:dont-set-visible-sizeDo not set visible view size, rely upon explicit setVisibleSize call. (optional)
:screen-orientationScreen orientation override. (optional)
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 map keys:


  Key                    | Description 
  -----------------------|------------ 
  :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.
  :device-scale-factor   | 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. Ignored in |fitWindow| mode. (optional)
  :screen-width          | Overriding screen width value in pixels (minimum 0, maximum 10000000). Only used for |mobile==true|. (optional)
  :screen-height         | Overriding screen height value in pixels (minimum 0, maximum 10000000). Only used for |mobile==true|. (optional)
  :position-x            | Overriding view X position on screen in pixels (minimum 0, maximum 10000000). Only used for |mobile==true|. (optional)
  :position-y            | Overriding view Y position on screen in pixels (minimum 0, maximum 10000000). Only used for |mobile==true|. (optional)
  :dont-set-visible-size | Do not set visible view size, rely upon explicit setVisibleSize call. (optional)
  :screen-orientation    | Screen orientation override. (optional)
sourceraw docstring

set-emit-touch-events-for-mouseclj

(set-emit-touch-events-for-mouse)
(set-emit-touch-events-for-mouse {:as params :keys [enabled configuration]})
(set-emit-touch-events-for-mouse connection
                                 {:as params :keys [enabled configuration]})

Parameters map keys:

KeyDescription
:enabledWhether touch emulation based on mouse input should be enabled.
:configurationTouch/gesture events configuration. Default: current platform. (optional)

Parameters map keys:


  Key            | Description 
  ---------------|------------ 
  :enabled       | Whether touch emulation based on mouse input should be enabled.
  :configuration | Touch/gesture events configuration. Default: current platform. (optional)
sourceraw docstring

set-emulated-mediaclj

(set-emulated-media)
(set-emulated-media {:as params :keys [media]})
(set-emulated-media connection {:as params :keys [media]})

Emulates the given media for CSS media queries.

Parameters map keys:

KeyDescription
:mediaMedia type to emulate. Empty string disables the override.
Emulates the given media for CSS media queries.

Parameters map keys:


  Key    | Description 
  -------|------------ 
  :media | Media type to emulate. Empty string disables the override.
sourceraw docstring

set-geolocation-overrideclj

(set-geolocation-override)
(set-geolocation-override {:as params :keys [latitude longitude accuracy]})
(set-geolocation-override connection
                          {:as params :keys [latitude longitude accuracy]})

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

Parameters map keys:

KeyDescription
:latitudeMock latitude (optional)
:longitudeMock longitude (optional)
:accuracyMock accuracy (optional)
Overrides the Geolocation Position or Error. Omitting any of the parameters emulates position unavailable.

Parameters map keys:


  Key        | Description 
  -----------|------------ 
  :latitude  | Mock latitude (optional)
  :longitude | Mock longitude (optional)
  :accuracy  | Mock accuracy (optional)
sourceraw docstring

set-page-scale-factorclj

(set-page-scale-factor)
(set-page-scale-factor {:as params :keys [page-scale-factor]})
(set-page-scale-factor connection {:as params :keys [page-scale-factor]})

Sets a specified page scale factor.

Parameters map keys:

KeyDescription
:page-scale-factorPage scale factor.
Sets a specified page scale factor.

Parameters map keys:


  Key                | Description 
  -------------------|------------ 
  :page-scale-factor | Page scale factor.
sourceraw docstring

set-script-execution-disabledclj

(set-script-execution-disabled)
(set-script-execution-disabled {:as params :keys [value]})
(set-script-execution-disabled connection {:as params :keys [value]})

Switches script execution in the page.

Parameters map keys:

KeyDescription
:valueWhether script execution should be disabled in the page.
Switches script execution in the page.

Parameters map keys:


  Key    | Description 
  -------|------------ 
  :value | Whether script execution should be disabled in the page.
sourceraw docstring

set-touch-emulation-enabledclj

(set-touch-emulation-enabled)
(set-touch-emulation-enabled {:as params :keys [enabled max-touch-points]})
(set-touch-emulation-enabled connection
                             {:as params :keys [enabled max-touch-points]})

Enables touch on platforms which do not support them.

Parameters map keys:

KeyDescription
:enabledWhether the touch event emulation should be enabled.
:max-touch-pointsMaximum touch points supported. Defaults to one. (optional)
Enables touch on platforms which do not support them.

Parameters map keys:


  Key               | Description 
  ------------------|------------ 
  :enabled          | Whether the touch event emulation should be enabled.
  :max-touch-points | Maximum touch points supported. Defaults to one. (optional)
sourceraw docstring

set-virtual-time-policyclj

(set-virtual-time-policy)
(set-virtual-time-policy {:as params :keys [policy budget]})
(set-virtual-time-policy connection {:as params :keys [policy budget]})

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.

Parameters map keys:

KeyDescription
:policynull
:budgetIf set, after this many virtual milliseconds have elapsed virtual time will be paused and a virtualTimeBudgetExpired event is sent. (optional)
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.

Parameters map keys:


  Key     | Description 
  --------|------------ 
  :policy | null
  :budget | If set, after this many virtual milliseconds have elapsed virtual time will be paused and a virtualTimeBudgetExpired event is sent. (optional)
sourceraw docstring

set-visible-sizeclj

(set-visible-size)
(set-visible-size {:as params :keys [width height]})
(set-visible-size connection {:as params :keys [width height]})

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.

Parameters map keys:

KeyDescription
:widthFrame width (DIP).
:heightFrame height (DIP).
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.

Parameters map keys:


  Key     | Description 
  --------|------------ 
  :width  | Frame width (DIP).
  :height | Frame height (DIP).
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close