Use this skill in Bionic
Install manually with this CLI command in your terminal.
$lms get yagil/chrome-cdp-controlChrome CDP Control
Connect to and operate a user-visible Chrome session through CDP for browser inspection, navigation, and interaction.
SKILL.md
Use this skill in Bionic
Install manually with this CLI command in your terminal.
$lms get yagil/chrome-cdp-controlChrome CDP Control
Connect to and operate a user-visible Chrome session through CDP for browser inspection, navigation, and interaction.
SKILL.md
Included resources
1 files · 8.67 KB
Included resources
1 files · 8.67 KB
element.click() or assigning input.value; framework-controlled pages often ignore synthetic DOM changes.Test the standard endpoint:
If unavailable, inspect running browser processes and listening ports. A Chrome process without a remote-debugging endpoint cannot be attached in place.
If the user wants you to launch a controllable instance, call get_scratchpad_folder, create a profile folder there, and launch:
Explain that a scratchpad profile persists across immediate restarts only while that scratchpad exists. For durable use, offer a dedicated persistent profile and obtain permission before writing outside the workspace.
Never expose the CDP port beyond loopback.
Resolve scripts/cdp.mjs relative to this SKILL.md. It uses Node's built-in WebSocket and has no third-party dependencies.
node <skill-folder>/scripts/cdp.mjs list node <skill-folder>/scripts/cdp.mjs body --target-url 'example.com/path' node <skill-folder>/scripts/cdp.mjs navigate --target-url 'example.com' --url 'https://example.com/new' node <skill-folder>/scripts/cdp.mjs new --url 'https://example.com/' node <skill-folder>/scripts/cdp.mjs click-text --target-url 'example.com' --text 'Continue' node <skill-folder>/scripts/cdp.mjs type --target-url 'example.com' --selector 'input[name=email]' --text 'person@example.com' node <skill-folder>/scripts/cdp.mjs eval --target-url 'example.com' --expression 'document.title' node <skill-folder>/scripts/cdp.mjs screenshot --target-url 'example.com' --output '/absolute/scratchpad/page.png' node <skill-folder>/scripts/cdp.mjs clear-cookies --domains 'example.com,login.example.com'
--target-url is a case-sensitive URL substring. If it matches zero or multiple page targets, inspect list and use a more specific substring.
list and identify the exact page target.body to inspect the title, URL, and visible text. For complex controls, use eval to inspect labels, ARIA attributes, roles, inputs, and buttons without reading secret-field values.navigate, new, click-text, or type as needed.body or a focused eval to verify.Input.dispatchMouseEvent for mousePressed and mouseReleased at its center.Input.insertText or key events.[role=option], then click the exact option.new when testing a path should not disrupt the user's current page.view_images if needed.clear-cookies --domains deletes only matching-domain cookies and never prints cookie names or values.Storage.clearDataForOrigin only after explaining that it can reset an unfinished flow. Keep unrelated origins untouched.Input.insertText; follow with appropriate key events or blur./json/list shows a changed target ID after authentication, rediscover the target instead of reusing an old WebSocket URL.element.click() or assigning input.value; framework-controlled pages often ignore synthetic DOM changes.Test the standard endpoint:
If unavailable, inspect running browser processes and listening ports. A Chrome process without a remote-debugging endpoint cannot be attached in place.
If the user wants you to launch a controllable instance, call get_scratchpad_folder, create a profile folder there, and launch:
Explain that a scratchpad profile persists across immediate restarts only while that scratchpad exists. For durable use, offer a dedicated persistent profile and obtain permission before writing outside the workspace.
Never expose the CDP port beyond loopback.
Resolve scripts/cdp.mjs relative to this SKILL.md. It uses Node's built-in WebSocket and has no third-party dependencies.
node <skill-folder>/scripts/cdp.mjs list node <skill-folder>/scripts/cdp.mjs body --target-url 'example.com/path' node <skill-folder>/scripts/cdp.mjs navigate --target-url 'example.com' --url 'https://example.com/new' node <skill-folder>/scripts/cdp.mjs new --url 'https://example.com/' node <skill-folder>/scripts/cdp.mjs click-text --target-url 'example.com' --text 'Continue' node <skill-folder>/scripts/cdp.mjs type --target-url 'example.com' --selector 'input[name=email]' --text 'person@example.com' node <skill-folder>/scripts/cdp.mjs eval --target-url 'example.com' --expression 'document.title' node <skill-folder>/scripts/cdp.mjs screenshot --target-url 'example.com' --output '/absolute/scratchpad/page.png' node <skill-folder>/scripts/cdp.mjs clear-cookies --domains 'example.com,login.example.com'
--target-url is a case-sensitive URL substring. If it matches zero or multiple page targets, inspect list and use a more specific substring.
list and identify the exact page target.body to inspect the title, URL, and visible text. For complex controls, use eval to inspect labels, ARIA attributes, roles, inputs, and buttons without reading secret-field values.navigate, new, click-text, or type as needed.body or a focused eval to verify.Input.dispatchMouseEvent for mousePressed and mouseReleased at its center.Input.insertText or key events.[role=option], then click the exact option.new when testing a path should not disrupt the user's current page.view_images if needed.clear-cookies --domains deletes only matching-domain cookies and never prints cookie names or values.Storage.clearDataForOrigin only after explaining that it can reset an unfinished flow. Keep unrelated origins untouched.Input.insertText; follow with appropriate key events or blur./json/list shows a changed target ID after authentication, rediscover the target instead of reusing an old WebSocket URL.curl -fsS http://127.0.0.1:9222/json/version
open -na "Google Chrome" --args \
--remote-debugging-address=127.0.0.1 \
--remote-debugging-port=9222 \
--user-data-dir="<scratchpad>/chrome-cdp-profile" \
"<requested-url>"
curl -fsS http://127.0.0.1:9222/json/version
open -na "Google Chrome" --args \
--remote-debugging-address=127.0.0.1 \
--remote-debugging-port=9222 \
--user-data-dir="<scratchpad>/chrome-cdp-profile" \
"<requested-url>"