Loading...
Loading...
Connect AI agents to your live Chrome session via CDP for real-time tab interaction, screenshots, and JS evaluation without re-login
npx skill4agent add aradotso/trending-skills chrome-cdp-live-browserSkill by ara.so — Daily 2026 Skills collection
chrome://inspect/#remote-debuggingpi install git:github.com/pasky/chrome-cdp-skill@v1.0.1skills/chrome-cdp/git clone https://github.com/pasky/chrome-cdp-skill.git
# Point your agent's skill loader at skills/chrome-cdp/npm install# List all open tabs with their targetIds
scripts/cdp.mjs list
# Take a screenshot (saves to runtime dir)
scripts/cdp.mjs shot <target>
# Get accessibility tree (compact, semantic — best for understanding page structure)
scripts/cdp.mjs snap <target>
# Get full HTML or scoped to a CSS selector
scripts/cdp.mjs html <target>
scripts/cdp.mjs html <target> ".main-content"
# Evaluate JavaScript in the page
scripts/cdp.mjs eval <target> "document.title"
scripts/cdp.mjs eval <target> "window.location.href"
# Navigate to a URL and wait for load
scripts/cdp.mjs nav <target> https://example.com
# Click an element by CSS selector
scripts/cdp.mjs click <target> "button.submit"
# Click at specific pixel coordinates
scripts/cdp.mjs clickxy <target> 320 480
# Type text at the currently focused element (works in cross-origin iframes)
scripts/cdp.mjs type <target> "hello world"
# Get network resource timing
scripts/cdp.mjs net <target>
# Click "load more" repeatedly until selector disappears
scripts/cdp.mjs loadall <target> ".load-more-btn"
# Raw CDP command passthrough
scripts/cdp.mjs evalraw <target> Runtime.evaluate '{"expression":"1+1"}'
# Open a new tab (triggers Allow prompt)
scripts/cdp.mjs open https://example.com
# Stop daemon for a specific tab, or all daemons
scripts/cdp.mjs stop <target>
scripts/cdp.mjs stop<target>targetIdlistscripts/cdp.mjs list
# Output:
# abc123 https://github.com/user/repo GitHub - user/repo
# def456 https://mail.google.com Gmail
# ghi789 https://app.internal.co Internal Dashboard# Accessibility tree is fastest for understanding layout
scripts/cdp.mjs snap abc123
# Scoped HTML for a specific component
scripts/cdp.mjs html abc123 "#issue-list"// Using eval to collect structured data from a live page
scripts/cdp.mjs eval abc123 "
JSON.stringify(
Array.from(document.querySelectorAll('.issue-title'))
.map(el => ({ title: el.textContent.trim(), href: el.closest('a')?.href }))
)
"# Fill a search box and submit
scripts/cdp.mjs click abc123 "input[name='q']"
scripts/cdp.mjs type abc123 "my search query"
scripts/cdp.mjs click abc123 "button[type='submit']"
# Wait for navigation and check result
scripts/cdp.mjs snap abc123scripts/cdp.mjs shot abc123
# Saves PNG to runtime dir, path printed to stdoutDevToolsActivePortexport CDP_PORT_FILE="/path/to/your/chrome/profile/DevToolsActivePort"
scripts/cdp.mjs list~/Library/Application Support/Google/Chrome/~/.config/google-chrome/~/.config/chromium/~/.config/brave-browser/scripts/cdp.mjs stop # stop all
scripts/cdp.mjs stop abc123 # stop one tab's daemon# No login needed — uses your existing session
TARGET=$(scripts/cdp.mjs list | grep github.com | awk '{print $1}' | head -1)
scripts/cdp.mjs eval $TARGET "
JSON.stringify(
Array.from(document.querySelectorAll('.notification-list-item'))
.slice(0, 10)
.map(n => n.querySelector('a')?.textContent?.trim())
)
"# Click "load more" until the button disappears, then extract all content
scripts/cdp.mjs loadall abc123 "button.load-more"
scripts/cdp.mjs html abc123 ".results-container"TARGET=abc123
# Fill form fields
scripts/cdp.mjs click $TARGET "#first-name"
scripts/cdp.mjs type $TARGET "Jane"
scripts/cdp.mjs click $TARGET "#last-name"
scripts/cdp.mjs type $TARGET "Smith"
# Select a dropdown via JS
scripts/cdp.mjs eval $TARGET "document.querySelector('#country').value = 'US'"
# Submit
scripts/cdp.mjs click $TARGET "button[type='submit']"
# Verify result
scripts/cdp.mjs snap $TARGET# Capture full page PDF
scripts/cdp.mjs evalraw abc123 Page.printToPDF '{}'
# Get all cookies for the page
scripts/cdp.mjs evalraw abc123 Network.getCookies '{}'
# Emulate mobile viewport
scripts/cdp.mjs evalraw abc123 Emulation.setDeviceMetricsOverride \
'{"width":375,"height":812,"deviceScaleFactor":3,"mobile":true}'listchrome://inspect/#remote-debuggingDevToolsActivePortls ~/Library/Application\ Support/Google/Chrome/DevToolsActivePort # macOS
ls ~/.config/google-chrome/DevToolsActivePort # LinuxCDP_PORT_FILEnode --versionchrome-cdpevalscripts/cdp.mjs eval abc123 "
new Promise(r => {
if (document.readyState === 'complete') r();
else window.addEventListener('load', r);
})
"
scripts/cdp.mjs shot abc123typetypeDevToolsActivePort<target>