While Camoufox includes patches to prevent headless detection, running in headless mode may still be detectable in the future. It's recommended to use a virtual display buffer to run Camoufox headlessly.

If you are running Linux, and would like to run Camoufox headlessly in a virtual display, install `xvfb`:

+++ Debian-based distros

```bash
sudo apt-get install xvfb
```

+++ Arch-based distros

```bash
sudo pacman -S xorg-server-xvfb
```

+++

#### Confirm `Xvfb` is installed:

```bash
$ which Xvfb
/usr/bin/Xvfb
```

---

## Usage

Passing `headless="virtual"` will spawn a new lightweight virtual display in the background for Camoufox to run in.

+++ Sync API

```python #4
from camoufox.sync_api import Camoufox

with Camoufox(
    headless="virtual"
) as browser:
    page = browser.new_page()
    page.goto("https://example.com")
```

+++ Async API

```python #4
from camoufox.async_api import AsyncCamoufox

async with AsyncCamoufox(
    headless="virtual"
) as browser:
    page = await browser.new_page()
    await page.goto("https://example.com")
```

+++
