---
title: "Chrome"
description: "Browser automation CLI for AI agents"
canonical_url: "https://agent-browser.dev/engines/chrome"
---

# Chrome

Chrome (and Chromium) is the default browser engine. agent-browser discovers, launches, and manages the Chrome process automatically via the Chrome DevTools Protocol (CDP).

## Binary Discovery

When no `--executable-path` is provided, agent-browser checks the Chrome it downloaded with `agent-browser install` first, then searches the platform locations in this order:

<table>
  <thead>
    <tr><th>Platform</th><th>Locations checked</th></tr>
  </thead>
  <tbody>
    <tr>
      <td>macOS</td>
      <td>
        <code>/Applications/Google Chrome.app</code>,
        <code>/Applications/Google Chrome Canary.app</code>,
        <code>/Applications/Chromium.app</code>,
        <code>/Applications/Brave Browser.app</code>,
        the same apps in <code>~/Applications</code>,
        Puppeteer cache (<code>~/.cache/puppeteer/chrome/</code> or <code>PUPPETEER_CACHE_DIR</code>),
        Playwright cache (<code>~/.cache/ms-playwright</code> or <code>PLAYWRIGHT_BROWSERS_PATH</code>)
      </td>
    </tr>
    <tr>
      <td>Linux</td>
      <td>
        <code>google-chrome</code>,
        <code>google-chrome-stable</code>,
        <code>chromium-browser</code>,
        <code>chromium</code> in PATH,
        Puppeteer cache (<code>~/.cache/puppeteer/chrome/</code> or <code>PUPPETEER_CACHE_DIR</code>),
        Chrome for Testing cache
      </td>
    </tr>
    <tr>
      <td>Windows</td>
      <td>
        <code>%LOCALAPPDATA%\Google\Chrome\Application\chrome.exe</code>,
        <code>C:\Program Files\Google\Chrome\Application\chrome.exe</code>,
        <code>C:\Program Files (x86)\...\chrome.exe</code>
      </td>
    </tr>
  </tbody>
</table>

If Chrome is not found, run `agent-browser install` to download Chrome from Chrome for Testing.

## Usage

Chrome is the default engine -- no `--engine` flag is needed:

```bash
agent-browser open example.com
```

To be explicit:

```bash
agent-browser --engine chrome open example.com
```

## Custom Binary

Point to any Chromium-based browser with `--executable-path`:

```bash
agent-browser --executable-path /path/to/chromium open example.com
```

Or via environment variable:

```bash
export AGENT_BROWSER_EXECUTABLE_PATH=/path/to/chromium
agent-browser open example.com
```

## Chrome-Specific Features

These features are available only with Chrome:

<table>
  <thead>
    <tr><th>Feature</th><th>Flag</th></tr>
  </thead>
  <tbody>
    <tr><td>Browser extensions</td><td><code>--extension &lt;path&gt;</code></td></tr>
    <tr><td>Persistent profiles</td><td><code>--profile &lt;path&gt;</code> (sets Chrome's <code>--user-data-dir</code>)</td></tr>
    <tr><td>Storage state</td><td><code>--state &lt;path&gt;</code></td></tr>
    <tr><td>File URL access</td><td><code>--allow-file-access</code></td></tr>
    <tr><td>Headless screenshot scrollbars</td><td><code>--hide-scrollbars false</code> keeps native scrollbars visible</td></tr>
    <tr><td>Headed mode</td><td><code>--headed</code></td></tr>
    <tr><td>Custom launch args</td><td><code>--args &lt;args&gt;</code></td></tr>
  </tbody>
</table>

## Smooth scrolling

agent-browser launches Chrome with `--disable-smooth-scrolling`. Animated scrolls that a page triggers, including CSS `scroll-behavior: smooth`, finish immediately. Add `--smooth-scrolling` on the command that launches the browser to keep Chrome's native smooth scrolling, which recordings of scroll-driven pages need:

```bash
agent-browser --smooth-scrolling open https://example.com
```

The setting is a launch option, so a change to it relaunches the session's browser.

## Containers and CI

In Docker, CI runners, or other sandboxed environments, Chrome's user namespace sandbox may need to be disabled:

```bash
agent-browser --args "--no-sandbox" open example.com
```

agent-browser automatically adds `--no-sandbox` when it detects a container environment (Docker, Podman, running as root).

Separate args with newlines, or with commas before another flag. Commas inside a value stay with that flag, so list-valued Chrome flags work:

```bash
agent-browser --args "--disable-features=Translate,HttpsUpgrades,--no-sandbox" open example.com
```

## AppArmor user namespace restriction

When `kernel.apparmor_restrict_unprivileged_userns` is `1`, AppArmor only lets binaries covered by an AppArmor profile create the user namespaces that Chrome's sandbox needs ([Chromium's notes](https://chromium.googlesource.com/chromium/src/+/main/docs/security/apparmor-userns-restrictions.md) list Ubuntu 23.10 and later). A system-wide Google Chrome install is usually covered, but the Chrome downloaded by `agent-browser install` is not, so it can exit with `No usable sandbox!`. In that case the launch error suggests a system Chrome instead. Point agent-browser at it with `--executable-path /usr/bin/google-chrome` or `AGENT_BROWSER_EXECUTABLE_PATH`. You can also add an AppArmor profile for the downloaded binary, as Chromium's notes describe.
