Loading...
Loading...
Launch Chrome with an unpacked extension and test its UI via CDP. Auto-installs Chrome for Testing if needed. Loads the extension, opens sidepanel/popup/options page, and hands off to cdp-connect for interaction (click, type, screenshot, ax-tree). Handles Chrome 137+ branded build restrictions (Extensions.loadUnpacked via pipe), sidepanel user gesture requirements, and React input quirks. Use when you need to test a Chrome extension's UI, automate extension interactions, or validate extension behavior on a target page. Triggers on: chrome extension test, test extension, load unpacked extension, extension sidepanel, extension popup, test chrome extension, extension testing, chrome extension automation, ext pilot, cdp extension.
npx skill4agent add adobe/skills cdp-ext-pilotcdp-connectcdp.js# Locate cdp-ext-pilot.mjs
if [[ -n "${CLAUDE_SKILL_DIR:-}" ]]; then
EXT_PILOT="${CLAUDE_SKILL_DIR}/scripts/cdp-ext-pilot.mjs"
else
EXT_PILOT="$(command -v cdp-ext-pilot.mjs 2>/dev/null || \
find ~/.claude -path "*/cdp-ext-pilot/scripts/cdp-ext-pilot.mjs" -type f 2>/dev/null | head -1)"
fi
# Locate cdp.js (from cdp-connect skill)
if [[ -n "${CLAUDE_SKILL_DIR:-}" ]]; then
CDP_JS="$(find "$(dirname "${CLAUDE_SKILL_DIR}")" -path "*/cdp-connect/scripts/cdp.js" -type f 2>/dev/null | head -1)"
fi
CDP_JS="${CDP_JS:-$(command -v cdp.js 2>/dev/null || \
find ~/.claude -path "*/cdp-connect/scripts/cdp.js" -type f 2>/dev/null | head -1)}"node "$EXT_PILOT" launch <path-to-extension-dist> [--port 9222]extensionIdportchromeVariantextensionIdmanifest.jsonlsof -i :9222closenode "$EXT_PILOT" open sidepanel [--port 9222] # Opens sidepanel, returns target ID
node "$EXT_PILOT" open popup [--port 9222] # Opens popup as tab
node "$EXT_PILOT" open options [--port 9222] # Opens options page as tabcdp-connect--id <target-id>node "$CDP_JS" ax-tree --id <target-id> # Understand the UI
node "$CDP_JS" screenshot /tmp/ext.png --id <tid> # Visual check
node "$CDP_JS" click "button" --id <tid> # Click elements
node "$CDP_JS" type "input" "text" --id <tid> # Type into fields
node "$CDP_JS" eval "expression" --id <tid> # Run JSnode "$EXT_PILOT" status [--port 9222] # Check session state
node "$EXT_PILOT" close [--port 9222] # Kill Chrome, remove profilecdp.js type.valuecdp.js eval "document.querySelector('input').focus()"Input.insertTextlaunchclose--port <other>