# Comet Browser Control — Project Reference Project: `C:\Users\User\Desktop\_PROJECTS\comet-browser-control\` Python: 3.11.3, venv at `.venv/` ## Key scripts ### launcher_start.py One-click cold-start: kills existing Comet, launches with real profile + CDP + `--remote-allow-origins=*`, starts hidden agent server on `:8765`. Returns JSON with `cdp_ok`, `real_profile`, `restart_status`. ### comet_agent_app.py Hidden aiohttp server on `:8765`. Endpoints: - `GET /` — control panel HTML - `GET /api/status` — CDP status, LLM config, tabs, task state - `POST /api/task` — run browser-use agent task - `POST /api/open` — open URL in new tab - `POST /api/stop` — stop running task ### comet_gui_control.py UIA (pywinauto) fallback when CDP is down. Actions: `list`, `open-url`, `type`, `hotkey`, `screenshot`, `click`. ### cdp_scan.py Scans local ports for CDP endpoints. `--ports 9222-9245 --json`. ### playwright_attach.py Robust Playwright CDP attach for real Comet profiles. Opens disposable `ctx.new_page()` for `--goto` checks (never reuses `ctx.pages[0]` which can be YouTube/X/file tabs). All operations wrapped in timeouts. ### browser_use_cdp_check.py Browser-use CDP attach check. Includes `patch_browser_use_security_watchdog()` to prevent closing existing `file://` tabs. ### clone_to_chrome_cdp.py Clones Comet profile into a separate Chrome/Edge debug profile with CDP. Does NOT attach to live Comet. ## bat files - `START_COMET_AGENT.cmd` — runs `python launcher_start.py` - `STOP_COMET_AGENT.cmd` — kills server on `:8765` - `OPEN_COMET_AGENT_PANEL.cmd` — opens `http://127.0.0.1:8765` in browser ## Config - `comet_agent.env` — local ports/profile, no API keys - `skills/comet_tabs_skill.md` — browser-use agent behavior rules - `requirements.txt` — pinned dependencies ## Verified dependencies (2026-07-11) browser-use==0.13.3, playwright==1.61.0, pywinauto==0.6.9, psutil==7.2.2, requests==2.33.0, aiohttp==3.13.4, ruamel.yaml==0.19.1, pyperclip==1.11.0, Pillow==12.2.0 ## CDP facts - Comet version: Chrome/149.0.7827.1095 - CDP port: 9233 - Agent panel: 8765 - `--remote-allow-origins=*` REQUIRED for WebSocket CDP - Cold start only — existing Comet ignores CDP flags - Real profile: `C:\Users\User\AppData\Local\Perplexity\Comet\User Data`