This domain emulates different environments for the page.
This domain emulates different environments for the page.
(can-emulate)
(can-emulate {:as params :keys []})
(can-emulate connection {:as params :keys []})
Tells whether emulation is supported.
Return map keys:
Key | Description |
---|---|
:result | True if emulation is supported. |
Tells whether emulation is supported. Return map keys: Key | Description --------|------------ :result | True if emulation is supported.
(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.
(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.
(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.
(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:
Key | Description |
---|---|
:rate | Throttling 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).
(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:
Key | Description |
---|---|
:color | RGBA 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)
(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:
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 |
:screen-width | Overriding screen width value in pixels (minimum 0, maximum 10000000). Only used for |
:screen-height | Overriding screen height value in pixels (minimum 0, maximum 10000000). Only used for |
:position-x | Overriding view X position on screen in pixels (minimum 0, maximum 10000000). Only used for |
:position-y | Overriding view Y position on screen in pixels (minimum 0, maximum 10000000). Only used for |
:dont-set-visible-size | Do not set visible view size, rely upon explicit setVisibleSize call. (optional) |
:screen-orientation | Screen 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)
(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:
Key | Description |
---|---|
:enabled | Whether touch emulation based on mouse input should be enabled. |
:configuration | Touch/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)
(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:
Key | Description |
---|---|
:media | Media 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.
(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:
Key | Description |
---|---|
:latitude | Mock latitude (optional) |
:longitude | Mock longitude (optional) |
:accuracy | Mock 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)
(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:
Key | Description |
---|---|
:page-scale-factor | Page scale factor. |
Sets a specified page scale factor. Parameters map keys: Key | Description -------------------|------------ :page-scale-factor | Page scale factor.
(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:
Key | Description |
---|---|
:value | Whether 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.
(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:
Key | Description |
---|---|
:enabled | Whether the touch event emulation should be enabled. |
:max-touch-points | Maximum 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)
(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:
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) |
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)
(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:
Key | Description |
---|---|
:width | Frame width (DIP). |
:height | Frame 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).
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close