browser_install

This module provides basic browser installation functionality, allowing you to install a local version of Google Chrome for Testing in the current directory on macOS and Linux.

Usage

You may run browser installation directly with

gleam run -m browser_install

When running directly, you can configure the browser version to install by setting the CHROBOT_TARGET_VERSION environment variable, it will default to latest. You may also set the directory to install under, with CHROBOT_TARGET_PATH.

The browser will be installed into a directory called chrome under the target directory. There is no support for managing multiple browser installations, if an installation is already present for the same version, the script will overwrite it.

To uninstall browsers installed by this tool just remove the chrome directory created by it, or delete an individual browser installation from inside it.

Caveats

This module attempts to rudimentarily mimic the functionality of the puppeteer install script, the only goal is to have a quick and convenient way to install browsers locally, for more advanced management of browser installations, please seek out other tools.

Supported platforms are limited by what the Google Chrome for Testing distribution supports, which is currently:

Notably, this distribution unfortunately does not support ARM64 on Linux.

Linux Dependencies

The tool does not install dependencies on Linux, you must install them yourself.

On debian / ubuntu based systems you may intall dependencies with the following command:

sudo apt-get update && sudo apt-get install -y \
ca-certificates \
fonts-liberation \
libasound2 \
libatk-bridge2.0-0 \
libatk1.0-0 \
libc6 \
libcairo2 \
libcups2 \
libdbus-1-3 \
libexpat1 \
libfontconfig1 \
libgbm1 \
libgcc1 \
libglib2.0-0 \
libgtk-3-0 \
libnspr4 \
libnss3 \
libpango-1.0-0 \
libpangocairo-1.0-0 \
libstdc++6 \
libx11-6 \
libx11-xcb1 \
libxcb1 \
libxcomposite1 \
libxcursor1 \
libxdamage1 \
libxext6 \
libxfixes3 \
libxi6 \
libxrandr2 \
libxrender1 \
libxss1 \
libxtst6 \
lsb-release \
wget \
xdg-utils

Types

pub type InstallationError {
  InstallationError
}

Constructors

  • InstallationError

Functions

pub fn install() -> Result(String, InstallationError)

Install a local version of Google Chrome for Testing. This function is meant to be called in a script, it will log errors and warnings to the console. and return a generic error if installation fails.

pub fn install_with_config(
  to target_path: String,
  version target_version: String,
) -> Result(String, InstallationError)

Install a specific local version of Google Chrome for Testing to a specific directory. This function is meant to be called in a script, it will log errors and warnings to the console. and return a generic error if installation fails.

pub fn main() -> Result(String, InstallationError)
Search Document