2.0 KiB
2.0 KiB
Web Automation CloakBrowser Migration Design
Goal
Replace all Camoufox and direct Playwright Chromium usage in web-automation with CloakBrowser, while preserving the existing feature set: one-shot extraction, persistent browsing sessions, authenticated flows, multi-step automation, and markdown scraping. After local validation, keep the repo copy and docs as the canonical published version, then commit and push.
Architecture
web-automation will become CloakBrowser-only. A single browser-launch layer in skills/web-automation/scripts/browse.ts will provide the canonical runtime for the other scripts. Stateful flows will use CloakBrowser persistent contexts; one-shot extraction will also use CloakBrowser instead of raw playwright.chromium.
Scope
- Replace
camoufox-jsinbrowse.tsand any helper/test scripts - Replace direct
playwright.chromiumlaunch inextract.js - Update shared types/imports to match the CloakBrowser Playwright-compatible API
- Remove Camoufox/Chromium-specific setup instructions from skill docs
- Update package metadata and lockfile to depend on
cloakbrowser - Keep the user-facing command surface stable where possible
Compatibility Strategy
To minimize user breakage:
- keep the script filenames and CLI interfaces stable
- support old
CAMOUFOX_*env vars as temporary aliases where practical - introduce neutral naming in docs and code for the new canonical path
Testing Strategy
- Verify launcher setup directly through
browse.ts - Verify
extract.jsstill handles: missing URL, invalid scheme, smoke extraction fromhttps://example.com - Verify one persistent-context path and one higher-level consumer (
scrape.tsorflow.ts) still works - Update docs only after the runtime is validated
Rollout
- Implement and verify locally in the repo worktree
- Update repo docs/indexes to describe CloakBrowser-based
web-automation - Commit and push the repo changes
- If needed, sync the installed OpenClaw workspace copy from the validated repo version