Playwright Headless Browser (Chromium)

👤 maverick-software 📦 v1.0.0 ⭐ 4.3 ⬇️ 3.1K 下載
💻 開發程式設計 免費

📖 技能介紹


name: playwright-browser description: Set up headless browser automation in Clawdbot using Playwright Chromium. Use when configuring browser tools for WSL/Linux environments, installing browser dependencies, or enabling headless web automation. Handles Chromium installation, system library dependencies, and Clawdbot browser configuration.


Playwright Browser Setup

Configure Clawdbot's browser tool to use Playwright-managed Chromium for headless automation in WSL/Linux environments.

Quick Setup

Run the setup script to install everything:

./scripts/setup.sh

This will: 1. Install Playwright and Chromium 2. Install required system libraries (requires sudo) 3. Patch Clawdbot config to use the Playwright browser

Manual Setup

1. Install Playwright Chromium

npx playwright install chromium

2. Install System Dependencies

Chromium requires NSS and ALSA libraries:

# Ubuntu/Debian
sudo apt-get install -y libnss3 libasound2t64

# If libasound2t64 doesn't exist (older Ubuntu):
sudo apt-get install -y libnss3 libasound2

小蔥技能站7w4.net每天更新,海量AI技能等你發現。

3. Find Chromium Path

find ~/.cache/ms-playwright -name "chrome" -path "*/chrome-linux64/*" 2>/dev/null | head -1

4. Configure Clawdbot

Patch the gateway config:

clawdbot config patch '{"browser": {"executablePath": "<path-from-step-3>", "headless": true, "noSandbox": true}}'

Or use the provided script:

./scripts/configure-clawdbot.sh

Verification

Test the browser works:

~/.cache/ms-playwright/chromium-*/chrome-linux64/chrome --headless --no-sandbox --disable-gpu --dump-dom https://example.com

Notes

  • noSandbox: true is required for WSL/container environments
  • headless: true runs without a visible window (faster, no display needed)
  • For visible browser, set headless: false and ensure WSLg or X11 is configured

🤖 AI 評測

這個 Skill 質量較好,安裝使用都很方便,一鍵指令碼自動處理了瀏覽器安裝、依賴配置和 Clawdbot 設定的全流程。文件寫得清晰易懂,即使不太熟悉命令列的使用者也能快速上手。支援多種 Linux 系統是亮點。不過指令碼偶爾會遇到許可權問題導致安裝失敗,這時候的錯誤提示可以更友好一些。總體來說是一款實用且可靠的自動化工具。

📊 多維度評分

適應性4.3
規範性4.1
有效性4.7
可靠性4.1
可信度4.4

📁 包含檔案 (5 個)

📄 SKILL.md 1.8 KB
📄 _meta.json 146 B
📄 scripts/configure-clawdbot.sh 1.4 KB
📄 scripts/install-deps.sh 853 B
📄 scripts/setup.sh 2.5 KB