chroxy v0.7.0 Chroxy.ChromeServer

GenServer process which manages a port connection to a Chrome browser OS Process as well as a ChromeRemoteInterface.Session to the browser instance providing command and control over the instance.

The stdout and stderr messages from the os process are captured and are used to determine state transitions, namely when the browser is ready to start accepting connections, and when the browser enters a critical error state and must be terminated.

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor.

Closes all open pages in the chrome instance.

Closes the page in the chrome instance.

Lists page sessions currently open to the chrome instance.

Creates a new chrome page (tab) within the chrome instance.

Blocks and performs a poll of the underlying Chroxy.ChromeServer to determine when the chrome browser instance is ready for interaction.

Spanws a Chroxy.ChromeServer process which in turn starts an underlying chrome browser os process, which is managed by a shared lifetime allowing for managing Chrome Browser within an OTP Supervision model.

Link to this section Functions

Link to this function

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

close_all_pages(server)

Closes all open pages in the chrome instance.

Link to this function

close_page(server, page)

Closes the page in the chrome instance.

Link to this function

list_pages(server)

Lists page sessions currently open to the chrome instance.

Link to this function

new_page(server)

Creates a new chrome page (tab) within the chrome instance.

Link to this function

ready(server, opts \\ [])

Blocks and performs a poll of the underlying Chroxy.ChromeServer to determine when the chrome browser instance is ready for interaction.

Keyword opts:

  • :retries - number to times to poll for ready state.
  • :wait_ms - how long to sleep between polling calls.
  • :crash_dumps_dir - where chrome should write crash dumps.
Link to this function

start_link(args)

Spanws a Chroxy.ChromeServer process which in turn starts an underlying chrome browser os process, which is managed by a shared lifetime allowing for managing Chrome Browser within an OTP Supervision model.