Skip to content

Feature Request: Docker setup for isolated headful browser sessions #329

@UmutAlihan

Description

@UmutAlihan

As requested in PR #319, here are the use cases for adding a containerized browser setup to the repository.

Currently, playwright-cli runs browsers directly on the host OS. I propose adding a docker/ configuration that runs a Playwright browser server equipped with Xvfb and noVNC, allowing the local CLI to connect via remoteEndpoint.

Key Use Cases:

  1. Clean Headful Debugging (Primary): Running --headed locally steals focus, pops up windows, and clutters the desktop. This Docker setup allows live visual debugging in a background browser tab (localhost:6080) without disrupting the developer's local workflow.
  2. Agent/LLM Sandboxing: Giving AI agents access to playwright-cli directly on a host OS is a security and state-leakage risk. Running the browser in an ephemeral Docker container provides a strict sandbox that protects the host if an agent goes off-script or downloads malicious files.
  3. Corporate Proxies (Custom CAs): Corporate MITM proxies often break host-run browsers. Baking custom .crt certificates into an isolated container is significantly easier and less invasive than modifying the host OS certificate trust store.

Proposed Implementation:

PR #319 provides a ready-to-use Dockerfile (extending mcr.microsoft.com/playwright/mcp), a supervisord setup, and a helper script. Including this prevents users from having to figure out and build this complex Xvfb/noVNC stack from scratch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions