Skip to content

feat: Auto-install Playwright browsers on container start#1005

Open
moortekweb-art wants to merge 1 commit intoagent0ai:mainfrom
moortekweb-art:feat/playwright-auto-install
Open

feat: Auto-install Playwright browsers on container start#1005
moortekweb-art wants to merge 1 commit intoagent0ai:mainfrom
moortekweb-art:feat/playwright-auto-install

Conversation

@moortekweb-art
Copy link

Problem

When using Playwright for browser automation in Agent Zero, browsers need to be installed separately. If the container is rebuilt or the Playwright cache is cleared, browser automation fails silently.

Solution

Add Playwright browser auto-installation to the container entrypoint script (run_A0.sh). This ensures browsers are always available without manual intervention.

Changes

File: docker/run/fs/exe/run_A0.sh

  • Check if playwright command is available
  • Only install if browsers are not already present
  • Install only Chromium by default (lightweight)
  • Silent failure does not break container startup
  • Respects PLAYWRIGHT_BROWSERS_PATH environment variable

Notes

For Playwright to work, system packages (libgstreamer, libnss3, libcups2, etc.) should be in the base image.

Testing

  1. Remove Playwright cache in container
  2. Restart container
  3. Verify browsers auto-install in logs
  4. Test browser automation works

Add automatic Playwright browser installation to the container entrypoint.
This ensures browser automation works without manual intervention, even
after container rebuilds or cache clearing.

Changes:
- Check if playwright command is available
- Only install if browsers are not already present
- Install only Chromium by default (lightweight)
- Silent failure doesn't break container startup

Note: System dependencies for Playwright (libgstreamer, libnss3, etc.)
should be installed in the base image for this to work properly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant