webengine_kiosk v0.3.0 WebengineKiosk View Source

Control a fullscreen web browser using Elixir for use in a kiosk

Link to this section Summary

Functions

Go to the previously visited page.

Blank the screen

Returns a specification to start this module under a supervisor.

Go forward in history.

Request that the browser go to the homepage.

Request that the browser go to the specified URL.

Register calling process to receive events

Reload the current page.

Run Javascript in the browser.

Set the zoom factor for displaying the page.

Stop the kiosk

Stop loading the current page.

Unblank the screen

Unregister calling process from receiving events

Link to this section Functions

Link to this function

back(server)

View Source
back(Supervisor.supervisor()) :: :ok | {:error, term()}

Go to the previously visited page.

Blank the screen

The web browser will be replaced by a screen with the blank_image. If someone clicks or taps on the screen then a wakeup message will be sent. While the screen is in the blank state, it can still accept requests to go to other URLs.

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

dispatch_event(server, event)

View Source
dispatch_event(Supervisor.supervisor(), any()) :: :ok
Link to this function

forward(server)

View Source
forward(Supervisor.supervisor()) :: :ok | {:error, term()}

Go forward in history.

Link to this function

go_home(server)

View Source
go_home(Supervisor.supervisor()) :: :ok | {:error, term()}

Request that the browser go to the homepage.

Link to this function

go_to_url(server, url)

View Source
go_to_url(Supervisor.supervisor(), String.t()) :: :ok | {:error, term()}

Request that the browser go to the specified URL.

Link to this function

register(server)

View Source
register(Supervisor.supervisor()) :: {:ok, pid()} | {:error, term()}

Register calling process to receive events

Link to this function

reload(server)

View Source
reload(Supervisor.supervisor()) :: :ok | {:error, term()}

Reload the current page.

Link to this function

run_javascript(server, code)

View Source
run_javascript(Supervisor.supervisor(), String.t()) :: :ok | {:error, term()}

Run Javascript in the browser.

Link to this function

set_zoom(server, factor)

View Source
set_zoom(Supervisor.supervisor(), number()) :: :ok | {:error, term()}

Set the zoom factor for displaying the page.

Link to this function

start_link(args, genserver_opts \\ [])

View Source
start_link(Keyword.t(), GenServer.options()) :: {:ok, pid()} | {:error, term()}

Start the kiosk.

The kiosk starts fullscreen and goes to a default local web page. To change this, set one or more options:

  • background_color: color - specify a background color as #RRGGBB or by name
  • blank_image: path - specify a path to an image for when the screen is blanked
  • data_dir: path - specify a writable path for data files
  • debug_keys: boolean - enable key combinations useful for debugging
  • fullscreen: boolean - show fullscreen
  • gid: gid - run the browser with this group id
  • homepage: url - load this page first. For local files, specify file:///path/to/index.html
  • monitor: index - select the monitor for the web browser (0, 1, etc.)
  • opengl: "gl" | "gles" | "software" | "auto" - specify the OpenGL backend. This is only a hint.
  • progress: boolean - show a progress bar when loading pages
  • run_as_root: boolean - set to true if you really want to run Chromium as root
  • sounds: boolean - play sounds on clicks
  • uid: uid - run the browser as this user

Untested:

  • clear_cache: boolean
  • proxy_enable: boolean - enable/disable proxy support
  • proxy_system: -
  • proxy_host: hostname - the host to connect to for using a proxy
  • proxy_port: port - the port to connect to on the proxy
  • proxy_username: username - a username for the proxy
  • proxy_password: password - a password for the proxy
  • stay_on_top: boolean -
  • window_clicked_sound: url - a sound to play when the window is clicked
  • link_clicked_sound: url - a sound to play when a link is clicked
  • hide_cursor: boolean - show or hide the mouse pointer
  • javascript: boolean - enable or disable Javascript support
  • javascript_can_open_windows: boolean - allow Javascript to open windows
  • width: pixels - when not fullscreen, the window is this width
  • height: pixels - when not fullscreen, the window is this height

Stop the kiosk

Link to this function

stop_loading(server)

View Source
stop_loading(Supervisor.supervisor()) :: :ok | {:error, term()}

Stop loading the current page.

Unblank the screen

Show the web browser again.

Link to this function

unregister(server)

View Source
unregister(Supervisor.supervisor()) :: :ok

Unregister calling process from receiving events