#!/usr/bin/env bash
# Quick check: is Chrome listening on the DevTools port? Run on the same machine as the Hub.
set -euo pipefail
URL="${1:-http://127.0.0.1:9222}"
echo "GET ${URL}/json/version"
if curl -sf "${URL}/json/version" | head -c 400; then
  echo ""
  echo "OK: something is answering on CDP (Chrome remote debugging)."
else
  echo ""
  echo "FAIL: nothing on ${URL} — start ./start_chrome_cdp.sh first (install xvfb on headless VPS)."
  exit 1
fi
