Tungsten v0.1.0 Tungsten.CDP.HeadlessExperimental View Source

HeadlessExperimental

This domain provides experimental commands only supported in headless mode.

Link to this section Summary

Link to this section Types

Link to this type

cdp_screenshot_params_type() View Source
cdp_screenshot_params_type() :: %{
  optional(:format) => :png | :jpeg,
  optional(:quality) => integer()
}

HeadlessExperimental.ScreenshotParams

Encoding options for a screenshot.

Link to this section Functions

Link to this function

begin_frame(session, parameters \\ %{}, options \\ []) View Source
begin_frame(
  GenServer.server(),
  %{
    optional(:frame_time_ticks) => integer() | float(),
    optional(:interval) => integer() | float(),
    optional(:no_display_updates) => boolean(),
    optional(:screenshot) => cdp_screenshot_params_type()
  },
  Tungsten.Connection.exec_options()
) ::
  {:ok, %{:has_damage => boolean(), optional(:screenshot_data) => String.t()}}
  | {:error, term()}

HeadlessExperimental.beginFrame

Sends a BeginFrame to the target and returns when the frame was completed. Optionally captures a screenshot from the resulting frame. Requires that the target was created with enabled BeginFrameControl. Designed for use with --run-all-compositor-stages-before-draw, see also https://goo.gl/3zHXhB for more background.

Link to this function

disable(session, parameters \\ %{}, options \\ []) View Source
disable(GenServer.server(), map(), Tungsten.Connection.exec_options()) ::
  {:ok, map()} | {:error, term()}

HeadlessExperimental.disable

Disables headless events for the target.

Link to this function

enable(session, parameters \\ %{}, options \\ []) View Source
enable(GenServer.server(), map(), Tungsten.Connection.exec_options()) ::
  {:ok, map()} | {:error, term()}

HeadlessExperimental.enable

Enables headless events for the target.