[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-browser-use-cdp":3,"mdc-932dom-key":32,"related-repo-browser-use-cdp":3915,"related-org-browser-use-cdp":3923},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":22,"repoUrl":23,"updatedAt":24,"license":25,"forks":26,"topics":27,"repo":28,"sourceUrl":23,"mdContent":31},"cdp","drive Chrome via DevTools Protocol","Drive Chrome via the DevTools Protocol from JavaScript. Run JS snippets through the `browser-harness-js` CLI — it auto-spawns a long-lived bun HTTP server holding a fully-typed CDP `Session`, and every call (`browser-harness-js 'await session.Page.navigate(...)'`) executes against the same persistent connection. Session, active target, and globals survive across calls. Use when the user wants to automate, script, or inspect a Chrome browser via CDP — single tab or multi-tab, attach to existing Chrome or to a new one launched with --remote-debugging-port.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},"browser-use","Browser-use","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fbrowser-use.png",[12,16,19],{"name":13,"slug":14,"type":15},"JavaScript","javascript","tag",{"name":17,"slug":18,"type":15},"Testing","testing",{"name":20,"slug":21,"type":15},"Browser Automation","browser-automation",473,"https:\u002F\u002Fgithub.com\u002Fbrowser-use\u002Fbrowser-harness-js","2026-04-21T04:55:40.331082",null,33,[],{"repoUrl":23,"stars":22,"forks":26,"topics":29,"description":30},[],"Self-healing browser harness that enables LLMs to complete any task","---\nname: cdp\ndescription: Drive Chrome via the DevTools Protocol from JavaScript. Run JS snippets through the `browser-harness-js` CLI — it auto-spawns a long-lived bun HTTP server holding a fully-typed CDP `Session`, and every call (`browser-harness-js 'await session.Page.navigate(...)'`) executes against the same persistent connection. Session, active target, and globals survive across calls. Use when the user wants to automate, script, or inspect a Chrome browser via CDP — single tab or multi-tab, attach to existing Chrome or to a new one launched with --remote-debugging-port.\n---\n\n# CDP — `browser-harness-js` skill\n\nCustom codegen'd CDP SDK (every method from browser_protocol.json + js_protocol.json gets a typed wrapper) plus a tiny HTTP server that holds one persistent CDP `Session`. The `browser-harness-js` CLI auto-starts the server on first use and forwards JS snippets to it.\n\nThe SDK lives in the skill's `sdk\u002F` directory. In the rest of this doc, `\u003Cskill-dir>` refers to wherever `npx skills add` installed the skill (Claude Code: `~\u002F.claude\u002Fskills\u002Fcdp`; Cursor: `~\u002F.cursor\u002Fskills\u002Fcdp`; other agents vary). The CLI should be on PATH as `browser-harness-js`.\n\n## Setup (once, first use)\n\n`npx skills add` drops the skill into your agent's skills directory but does NOT put the CLI on PATH. Before the first call, verify it's reachable and symlink it into any directory on your PATH if not:\n\n```bash\n# macOS (Apple Silicon + Homebrew)\ncommand -v browser-harness-js >\u002Fdev\u002Fnull || ln -sf \u003Cskill-dir>\u002Fsdk\u002Fbrowser-harness-js \u002Fopt\u002Fhomebrew\u002Fbin\u002Fbrowser-harness-js\n\n# macOS (Intel) \u002F most Linux — may need sudo\ncommand -v browser-harness-js >\u002Fdev\u002Fnull || ln -sf \u003Cskill-dir>\u002Fsdk\u002Fbrowser-harness-js \u002Fusr\u002Flocal\u002Fbin\u002Fbrowser-harness-js\n\n# Linux without sudo (ensure ~\u002F.local\u002Fbin is on PATH)\ncommand -v browser-harness-js >\u002Fdev\u002Fnull || { mkdir -p ~\u002F.local\u002Fbin && ln -sf \u003Cskill-dir>\u002Fsdk\u002Fbrowser-harness-js ~\u002F.local\u002Fbin\u002Fbrowser-harness-js; }\n```\n\nThe CLI auto-installs `bun` on first run if it's missing (the server is Bun-native). Set `BROWSER_HARNESS_SKIP_BUN_INSTALL=1` to opt out.\n\n## How to use\n\nJust run `browser-harness-js '\u003CJS>'`. The first call spawns the server in the background; subsequent calls hit the same process and so reuse the same `session`, the same WebSocket to Chrome, and any globals you set.\n\n```bash\nbrowser-harness-js 'await session.connect()'\nbrowser-harness-js 'await session.Page.navigate({url:\"https:\u002F\u002Fexample.com\"})'\nbrowser-harness-js '(await session.Runtime.evaluate({expression:\"document.title\",returnByValue:true})).result.value'\n```\n\nOutput is the **raw result content** — no `{ok,result}` envelope.\n\n| Result type | stdout |\n|---|---|\n| string                       | bare text, no JSON quotes (e.g. `Example Domain`) |\n| number \u002F boolean             | `42`, `true` |\n| object \u002F array (non-empty)   | compact JSON (e.g. `{\"frameId\":\"...\"}`, `[1,2,3]`) |\n| `undefined` \u002F `null` \u002F `\"\"` \u002F `{}` \u002F `[]` | empty (no output) |\n\n**Errors** go to **stderr**, exit code `1`. The CDP error message and JS stack are printed verbatim, e.g.:\n```\nError: CDP -32602: invalid params\n    at _call (...\u002Fsession.ts:117:33)\n    ...\n```\nDetect failure with `if browser-harness-js '...'; then ...; else handle_error; fi` or by checking `$?`.\n\n**Multi-line snippets via stdin (heredoc).** Important: a multi-statement snippet does NOT auto-return the last expression — write `return X` explicitly. Single-expression snippets passed as the first argument DO auto-return.\n\n```bash\nbrowser-harness-js \u003C\u003C'EOF'\nconst tabs = await listPageTargets();\nglobalThis.tid = tabs[0].targetId;\nawait session.use(globalThis.tid);\nreturn globalThis.tid;\nEOF\n```\n\n## CLI commands\n\n| Command | Behavior |\n|---|---|\n| `browser-harness-js '\u003Cjs>'`     | Auto-start server if needed, eval the JS, print result. |\n| `browser-harness-js \u003C\u003CEOF…EOF`  | Same, code from stdin. |\n| `browser-harness-js --status`   | Print health JSON (uptime, connected, sessionId) or exit 1 if down. |\n| `browser-harness-js --start`    | Explicit start (no-op if already running). |\n| `browser-harness-js --stop`     | Graceful shutdown. Drops session state. |\n| `browser-harness-js --restart`  | Stop + start fresh. |\n| `browser-harness-js --logs`     | `tail -f` the server log (`\u002Ftmp\u002Fbrowser-harness-js.log`). |\n\nEnv vars: `CDP_REPL_PORT` (default `9876`), `CDP_REPL_LOG` (default `\u002Ftmp\u002Fbrowser-harness-js.log`).\n\n## API surface inside snippets\n\nThese globals are pre-loaded — no imports needed:\n\n- `session` — the persistent `Session`. Has every CDP domain mounted: `session.Page`, `session.DOM`, `session.Runtime`, `session.Network`, … 56 domains, 652 methods total.\n- `listPageTargets()` — list real page targets via CDP's `Target.getTargets` (works on Chrome 144+ too), with `chrome:\u002F\u002F` and `devtools:\u002F\u002F` URLs filtered out. No args — uses the connected session.\n- `detectBrowsers()` — scan OS-specific profile dirs for running Chromium-based browsers with remote debugging on. Returns `[{name, profileDir, port, wsPath, wsUrl, mtimeMs}]`, sorted by most recently launched.\n- `resolveWsUrl(opts)` — resolve a WS URL from `{wsUrl}` | `{port, host?}` | `{profileDir}`. For the no-args auto-detect flow, call `session.connect()` directly instead.\n- `CDP` — the generated namespaces (`CDP.Page`, `CDP.Runtime`, …) for type-name reference.\n\n### Calling a CDP method\n\nEvery method takes a single object argument matching the CDP wire params; it resolves to the typed return value (no `result` envelope, no `id` correlation — handled for you).\n\n```js\n\u002F\u002F no params\nawait session.DOM.enable()\n\n\u002F\u002F required params\nawait session.Page.navigate({ url: 'https:\u002F\u002Fexample.com' })\n\n\u002F\u002F all-optional params (object also optional)\nawait session.Page.captureScreenshot()\nawait session.Page.captureScreenshot({ format: 'png', quality: 80 })\n\n\u002F\u002F returns are stripped to the typed shape\nconst { root } = await session.DOM.getDocument()\nconst { nodeId } = await session.DOM.querySelector({ nodeId: root.nodeId, selector: 'h1' })\n```\n\n### Connecting\n\n**Default: just call `session.connect()` with no args.** It auto-detects running Chromium-based browsers (Chrome, Chromium, Edge, Brave, Arc, Vivaldi, Opera, Comet, Canary) by scanning OS-specific profile dirs for a `DevToolsActivePort` file, ordered by most-recently-launched, and picks the first one whose WebSocket accepts. OS-agnostic — works on macOS, Linux, Windows.\n\n```js\nawait session.connect()   \u002F\u002F auto-detect\n```\n\nUse `detectBrowsers()` first if you want to see what's available (or let the user pick) before connecting:\n\n```js\nconst found = await detectBrowsers()\n\u002F\u002F [{ name: 'Google Chrome', profileDir, port, wsPath, wsUrl, mtimeMs }, ...]\n```\n\n**Explicit forms** — use these only when auto-detect picks the wrong browser, or when you already know where to connect:\n\n| Form | When to use |\n|---|---|\n| `{ profileDir }` | Target a specific browser when several are running. Reads `\u003CprofileDir>\u002FDevToolsActivePort` directly. |\n| `{ wsUrl }` | You already have `ws:\u002F\u002F…\u002Fdevtools\u002Fbrowser\u002F\u003Cuuid>` (e.g. piped from elsewhere). |\n\n```js\nawait session.connect({ profileDir: '\u002FUsers\u002F\u003Cyou>\u002FLibrary\u002FApplication Support\u002FGoogle\u002FChrome' })\nawait session.connect({ wsUrl: 'ws:\u002F\u002F127.0.0.1:9222\u002Fdevtools\u002Fbrowser\u002F\u003Cuuid>' })\n```\n\nProfile paths by OS — use these with `{ profileDir }`:\n- macOS: `~\u002FLibrary\u002FApplication Support\u002F\u003CBrowser>` (e.g. `Google\u002FChrome`, `Comet`, `BraveSoftware\u002FBrave-Browser`, `Arc\u002FUser Data`)\n- Linux: `~\u002F.config\u002F\u003Cbrowser>` (e.g. `google-chrome`, `chromium`, `BraveSoftware\u002FBrave-Browser`)\n- Windows: `%LOCALAPPDATA%\\\u003CBrowser>\\User Data` (e.g. `Google\\Chrome`, `Microsoft\\Edge`, `BraveSoftware\\Brave-Browser`)\n\nPer-candidate WS-open timeout defaults to **5s** — live browsers answer with open\u002Fclose within ~100ms, so 5s is already generous. The only case where 5s is too short is when Chrome is showing the **Allow** popup and waiting on the user to click. If you expect that, pass `timeoutMs: 30000`:\n\n```js\nawait session.connect({ profileDir: '\u002FUsers\u002F\u003Cyou>\u002FLibrary\u002FApplication Support\u002FGoogle\u002FChrome', timeoutMs: 30_000 })\n```\n\n**If you see `No detected browser accepted a connection`** — the browsers have `DevToolsActivePort` files but none are currently serving WS. Most common cause: remote-debugging is enabled but the user hasn't clicked **Allow** on the prompt yet. Tell them to click Allow, then retry (or bump `timeoutMs`).\n\n### Picking a target (tab)\n\nAfter `connect()`, call `session.use(targetId)` once; subsequent page-level calls (Page\u002FDOM\u002FRuntime\u002FNetwork\u002Fetc.) auto-route to that target's sessionId. `Browser.*` and `Target.*` calls always hit the browser endpoint.\n\n```js\nconst tabs = await listPageTargets()                     \u002F\u002F no args; uses the connected session\nconst sid  = await session.use(tabs[0].targetId)\nawait session.Page.enable()\nawait session.Page.navigate({ url: 'https:\u002F\u002Fexample.com' })\n```\n\n`listPageTargets()` uses CDP's `Target.getTargets` (not `\u002Fjson`), so it works on Chrome 144+ too. It already filters out `chrome:\u002F\u002F` and `devtools:\u002F\u002F` URLs. Equivalent raw call:\n\n```js\nconst { targetInfos } = await session.Target.getTargets({})\nconst tabs = targetInfos.filter(t => t.type === 'page' && !t.url.startsWith('chrome:\u002F\u002F') && !t.url.startsWith('devtools:\u002F\u002F'))\n```\n\nTo switch tabs: `session.use(otherTargetId)`. To detach: `session.setActiveSession(undefined)`.\n\n### Events\n\n```js\n\u002F\u002F Subscribe (returns an unsubscribe fn)\nconst off = session.onEvent((method, params, sessionId) => { ... })\n\n\u002F\u002F Or wait for a single matching event with optional predicate + timeout\nawait session.Network.enable()\nconst ev = await session.waitFor(\n  'Page.frameNavigated',\n  (p) => p.frame.url.includes('example.com'),\n  10_000\n)\n```\n\n### Persisting state across calls\n\nEach snippet runs inside its own async wrapper, so its `let`\u002F`const` declarations vanish when it returns. To carry data forward, attach to `globalThis`:\n\n```bash\nbrowser-harness-js '(await listPageTargets()).forEach((t,i)=>globalThis[\"tab\"+i]=t.targetId)'\nbrowser-harness-js 'await session.use(globalThis.tab0)'\nbrowser-harness-js 'await session.Page.navigate({url:\"https:\u002F\u002Fexample.com\"})'\n```\n\n`session` itself, the active sessionId, and event subscribers are already preserved by the server — globals are only needed for ad-hoc data.\n\n## Connecting to a running Chrome (chrome:\u002F\u002Finspect flow)\n\nWhen attaching to the user's already-running browser:\n\n1. **Try `await session.connect()` first** (no args) — auto-detect handles every Chromium-based browser via `DevToolsActivePort`. If it returns, you're done.\n2. **If auto-detect fails** with `No running browser with remote debugging detected`, the user needs to turn it on. Open the inspect page:\n   ```bash\n   # macOS — prefer AppleScript over `open -a` (reuses current profile, avoids the profile picker)\n   osascript -e 'open location \"chrome:\u002F\u002Finspect\u002F#remote-debugging\"'\n\n   # Linux\n   google-chrome 'chrome:\u002F\u002Finspect\u002F#remote-debugging'     # or: chromium, google-chrome-stable\n\n   # Windows (PowerShell)\n   Start-Process chrome 'chrome:\u002F\u002Finspect\u002F#remote-debugging'\n   ```\n   Only macOS's AppleScript path avoids the profile picker; Linux\u002FWindows may prompt the user to pick a profile first.\n3. **Tick \"Discover network targets\"** in chrome:\u002F\u002Finspect, then click **Allow** when Chrome prompts.\n4. **If auto-detect picks the wrong browser** (multiple running, you want a specific one): list them with `await detectBrowsers()`, then `await session.connect({ profileDir: \u003Cthe one you want> })`.\n5. **If `session.connect()` returns `No detected browser accepted a connection`**, the user has remote-debugging on but hasn't clicked **Allow** yet. Tell them to click it and retry, or pass `timeoutMs: 30000` to wait for the click.\n\n## Working with targets (tabs)\n\n- **Filter Chrome internals.** `listPageTargets()` already drops `chrome:\u002F\u002F` and `devtools:\u002F\u002F` URLs. If you call `Target.getTargets()` directly, filter manually.\n- **CDP target order ≠ visible tab-strip order.** When the user says \"the first tab I can see\", use a screenshot or page title to identify it — `Target.activateTarget` only switches to a known targetId.\n\n## Looking up a method\n\nThe full typed surface is in `\u003Cskill-dir>\u002Fsdk\u002Fgenerated.ts` (~655 KB, only loaded if you read it). Each method has its CDP description as a JSDoc comment plus typed `*Params` \u002F `*Return` interfaces in per-domain namespaces.\n\n```bash\ngrep -n \"navigate\" \u003Cskill-dir>\u002Fsdk\u002Fgenerated.ts | head\n```\n\n## Regenerating the SDK\n\nWhen the upstream protocol JSONs change, replace `sdk\u002Fbrowser_protocol.json` and\u002For `sdk\u002Fjs_protocol.json` and re-run:\n\n```bash\ncd \u003Cskill-dir>\u002Fsdk && bun gen.ts\nbrowser-harness-js --restart   # pick up the new bindings\n```\n\n## Files\n\nAll paths are relative to `\u003Cskill-dir>` (the install path — see top of this doc).\n\n- `\u002Fusr\u002Flocal\u002Fbin\u002Fbrowser-harness-js` → `\u003Cskill-dir>\u002Fsdk\u002Fbrowser-harness-js` (the CLI)\n- `sdk\u002Frepl.ts` — HTTP server (`Bun.serve` on `127.0.0.1:9876`)\n- `sdk\u002Fsession.ts` — `Session` class (transport, connect, target routing, events)\n- `sdk\u002Fgenerated.ts` — codegen output: every CDP method as a typed wrapper\n- `sdk\u002Fgen.ts` — codegen script\n- `sdk\u002F{browser,js}_protocol.json` — upstream protocol (vendored)\n",{"data":33,"body":34},{"name":4,"description":6},{"type":35,"children":36},"root",[37,55,76,128,135,145,440,461,467,488,557,578,725,750,760,780,798,862,868,1023,1057,1063,1068,1241,1248,1269,1735,1741,1766,1803,1815,1860,1870,1942,2063,2074,2183,2209,2289,2325,2331,2367,2560,2598,2845,2865,2871,3169,3175,3202,3268,3278,3284,3289,3534,3540,3599,3605,3633,3698,3704,3725,3792,3798,3810,3909],{"type":38,"tag":39,"props":40,"children":42},"element","h1",{"id":41},"cdp-browser-harness-js-skill",[43,46,53],{"type":44,"value":45},"text","CDP — ",{"type":38,"tag":47,"props":48,"children":50},"code",{"className":49},[],[51],{"type":44,"value":52},"browser-harness-js",{"type":44,"value":54}," skill",{"type":38,"tag":56,"props":57,"children":58},"p",{},[59,61,67,69,74],{"type":44,"value":60},"Custom codegen'd CDP SDK (every method from browser_protocol.json + js_protocol.json gets a typed wrapper) plus a tiny HTTP server that holds one persistent CDP ",{"type":38,"tag":47,"props":62,"children":64},{"className":63},[],[65],{"type":44,"value":66},"Session",{"type":44,"value":68},". The ",{"type":38,"tag":47,"props":70,"children":72},{"className":71},[],[73],{"type":44,"value":52},{"type":44,"value":75}," CLI auto-starts the server on first use and forwards JS snippets to it.",{"type":38,"tag":56,"props":77,"children":78},{},[79,81,87,89,95,97,103,105,111,113,119,121,126],{"type":44,"value":80},"The SDK lives in the skill's ",{"type":38,"tag":47,"props":82,"children":84},{"className":83},[],[85],{"type":44,"value":86},"sdk\u002F",{"type":44,"value":88}," directory. In the rest of this doc, ",{"type":38,"tag":47,"props":90,"children":92},{"className":91},[],[93],{"type":44,"value":94},"\u003Cskill-dir>",{"type":44,"value":96}," refers to wherever ",{"type":38,"tag":47,"props":98,"children":100},{"className":99},[],[101],{"type":44,"value":102},"npx skills add",{"type":44,"value":104}," installed the skill (Claude Code: ",{"type":38,"tag":47,"props":106,"children":108},{"className":107},[],[109],{"type":44,"value":110},"~\u002F.claude\u002Fskills\u002Fcdp",{"type":44,"value":112},"; Cursor: ",{"type":38,"tag":47,"props":114,"children":116},{"className":115},[],[117],{"type":44,"value":118},"~\u002F.cursor\u002Fskills\u002Fcdp",{"type":44,"value":120},"; other agents vary). The CLI should be on PATH as ",{"type":38,"tag":47,"props":122,"children":124},{"className":123},[],[125],{"type":44,"value":52},{"type":44,"value":127},".",{"type":38,"tag":129,"props":130,"children":132},"h2",{"id":131},"setup-once-first-use",[133],{"type":44,"value":134},"Setup (once, first use)",{"type":38,"tag":56,"props":136,"children":137},{},[138,143],{"type":38,"tag":47,"props":139,"children":141},{"className":140},[],[142],{"type":44,"value":102},{"type":44,"value":144}," drops the skill into your agent's skills directory but does NOT put the CLI on PATH. Before the first call, verify it's reachable and symlink it into any directory on your PATH if not:",{"type":38,"tag":146,"props":147,"children":152},"pre",{"className":148,"code":149,"language":150,"meta":151,"style":151},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","# macOS (Apple Silicon + Homebrew)\ncommand -v browser-harness-js >\u002Fdev\u002Fnull || ln -sf \u003Cskill-dir>\u002Fsdk\u002Fbrowser-harness-js \u002Fopt\u002Fhomebrew\u002Fbin\u002Fbrowser-harness-js\n\n# macOS (Intel) \u002F most Linux — may need sudo\ncommand -v browser-harness-js >\u002Fdev\u002Fnull || ln -sf \u003Cskill-dir>\u002Fsdk\u002Fbrowser-harness-js \u002Fusr\u002Flocal\u002Fbin\u002Fbrowser-harness-js\n\n# Linux without sudo (ensure ~\u002F.local\u002Fbin is on PATH)\ncommand -v browser-harness-js >\u002Fdev\u002Fnull || { mkdir -p ~\u002F.local\u002Fbin && ln -sf \u003Cskill-dir>\u002Fsdk\u002Fbrowser-harness-js ~\u002F.local\u002Fbin\u002Fbrowser-harness-js; }\n","bash","",[153],{"type":38,"tag":47,"props":154,"children":155},{"__ignoreMap":151},[156,168,247,257,266,327,335,344],{"type":38,"tag":157,"props":158,"children":161},"span",{"class":159,"line":160},"line",1,[162],{"type":38,"tag":157,"props":163,"children":165},{"style":164},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[166],{"type":44,"value":167},"# macOS (Apple Silicon + Homebrew)\n",{"type":38,"tag":157,"props":169,"children":171},{"class":159,"line":170},2,[172,178,184,189,195,200,205,211,216,221,226,232,237,242],{"type":38,"tag":157,"props":173,"children":175},{"style":174},"--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF",[176],{"type":44,"value":177},"command",{"type":38,"tag":157,"props":179,"children":181},{"style":180},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[182],{"type":44,"value":183}," -v",{"type":38,"tag":157,"props":185,"children":186},{"style":180},[187],{"type":44,"value":188}," browser-harness-js",{"type":38,"tag":157,"props":190,"children":192},{"style":191},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[193],{"type":44,"value":194}," >",{"type":38,"tag":157,"props":196,"children":197},{"style":180},[198],{"type":44,"value":199},"\u002Fdev\u002Fnull",{"type":38,"tag":157,"props":201,"children":202},{"style":191},[203],{"type":44,"value":204}," ||",{"type":38,"tag":157,"props":206,"children":208},{"style":207},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[209],{"type":44,"value":210}," ln",{"type":38,"tag":157,"props":212,"children":213},{"style":180},[214],{"type":44,"value":215}," -sf",{"type":38,"tag":157,"props":217,"children":218},{"style":191},[219],{"type":44,"value":220}," \u003C",{"type":38,"tag":157,"props":222,"children":223},{"style":180},[224],{"type":44,"value":225},"skill-di",{"type":38,"tag":157,"props":227,"children":229},{"style":228},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[230],{"type":44,"value":231},"r",{"type":38,"tag":157,"props":233,"children":234},{"style":191},[235],{"type":44,"value":236},">",{"type":38,"tag":157,"props":238,"children":239},{"style":180},[240],{"type":44,"value":241},"\u002Fsdk\u002Fbrowser-harness-js",{"type":38,"tag":157,"props":243,"children":244},{"style":180},[245],{"type":44,"value":246}," \u002Fopt\u002Fhomebrew\u002Fbin\u002Fbrowser-harness-js\n",{"type":38,"tag":157,"props":248,"children":250},{"class":159,"line":249},3,[251],{"type":38,"tag":157,"props":252,"children":254},{"emptyLinePlaceholder":253},true,[255],{"type":44,"value":256},"\n",{"type":38,"tag":157,"props":258,"children":260},{"class":159,"line":259},4,[261],{"type":38,"tag":157,"props":262,"children":263},{"style":164},[264],{"type":44,"value":265},"# macOS (Intel) \u002F most Linux — may need sudo\n",{"type":38,"tag":157,"props":267,"children":269},{"class":159,"line":268},5,[270,274,278,282,286,290,294,298,302,306,310,314,318,322],{"type":38,"tag":157,"props":271,"children":272},{"style":174},[273],{"type":44,"value":177},{"type":38,"tag":157,"props":275,"children":276},{"style":180},[277],{"type":44,"value":183},{"type":38,"tag":157,"props":279,"children":280},{"style":180},[281],{"type":44,"value":188},{"type":38,"tag":157,"props":283,"children":284},{"style":191},[285],{"type":44,"value":194},{"type":38,"tag":157,"props":287,"children":288},{"style":180},[289],{"type":44,"value":199},{"type":38,"tag":157,"props":291,"children":292},{"style":191},[293],{"type":44,"value":204},{"type":38,"tag":157,"props":295,"children":296},{"style":207},[297],{"type":44,"value":210},{"type":38,"tag":157,"props":299,"children":300},{"style":180},[301],{"type":44,"value":215},{"type":38,"tag":157,"props":303,"children":304},{"style":191},[305],{"type":44,"value":220},{"type":38,"tag":157,"props":307,"children":308},{"style":180},[309],{"type":44,"value":225},{"type":38,"tag":157,"props":311,"children":312},{"style":228},[313],{"type":44,"value":231},{"type":38,"tag":157,"props":315,"children":316},{"style":191},[317],{"type":44,"value":236},{"type":38,"tag":157,"props":319,"children":320},{"style":180},[321],{"type":44,"value":241},{"type":38,"tag":157,"props":323,"children":324},{"style":180},[325],{"type":44,"value":326}," \u002Fusr\u002Flocal\u002Fbin\u002Fbrowser-harness-js\n",{"type":38,"tag":157,"props":328,"children":330},{"class":159,"line":329},6,[331],{"type":38,"tag":157,"props":332,"children":333},{"emptyLinePlaceholder":253},[334],{"type":44,"value":256},{"type":38,"tag":157,"props":336,"children":338},{"class":159,"line":337},7,[339],{"type":38,"tag":157,"props":340,"children":341},{"style":164},[342],{"type":44,"value":343},"# Linux without sudo (ensure ~\u002F.local\u002Fbin is on PATH)\n",{"type":38,"tag":157,"props":345,"children":347},{"class":159,"line":346},8,[348,352,356,360,364,368,372,377,382,387,392,397,401,405,409,413,417,421,425,430,435],{"type":38,"tag":157,"props":349,"children":350},{"style":174},[351],{"type":44,"value":177},{"type":38,"tag":157,"props":353,"children":354},{"style":180},[355],{"type":44,"value":183},{"type":38,"tag":157,"props":357,"children":358},{"style":180},[359],{"type":44,"value":188},{"type":38,"tag":157,"props":361,"children":362},{"style":191},[363],{"type":44,"value":194},{"type":38,"tag":157,"props":365,"children":366},{"style":180},[367],{"type":44,"value":199},{"type":38,"tag":157,"props":369,"children":370},{"style":191},[371],{"type":44,"value":204},{"type":38,"tag":157,"props":373,"children":374},{"style":191},[375],{"type":44,"value":376}," {",{"type":38,"tag":157,"props":378,"children":379},{"style":207},[380],{"type":44,"value":381}," mkdir",{"type":38,"tag":157,"props":383,"children":384},{"style":180},[385],{"type":44,"value":386}," -p",{"type":38,"tag":157,"props":388,"children":389},{"style":180},[390],{"type":44,"value":391}," ~\u002F.local\u002Fbin",{"type":38,"tag":157,"props":393,"children":394},{"style":191},[395],{"type":44,"value":396}," &&",{"type":38,"tag":157,"props":398,"children":399},{"style":207},[400],{"type":44,"value":210},{"type":38,"tag":157,"props":402,"children":403},{"style":180},[404],{"type":44,"value":215},{"type":38,"tag":157,"props":406,"children":407},{"style":191},[408],{"type":44,"value":220},{"type":38,"tag":157,"props":410,"children":411},{"style":180},[412],{"type":44,"value":225},{"type":38,"tag":157,"props":414,"children":415},{"style":228},[416],{"type":44,"value":231},{"type":38,"tag":157,"props":418,"children":419},{"style":191},[420],{"type":44,"value":236},{"type":38,"tag":157,"props":422,"children":423},{"style":180},[424],{"type":44,"value":241},{"type":38,"tag":157,"props":426,"children":427},{"style":180},[428],{"type":44,"value":429}," ~\u002F.local\u002Fbin\u002Fbrowser-harness-js",{"type":38,"tag":157,"props":431,"children":432},{"style":191},[433],{"type":44,"value":434},";",{"type":38,"tag":157,"props":436,"children":437},{"style":191},[438],{"type":44,"value":439}," }\n",{"type":38,"tag":56,"props":441,"children":442},{},[443,445,451,453,459],{"type":44,"value":444},"The CLI auto-installs ",{"type":38,"tag":47,"props":446,"children":448},{"className":447},[],[449],{"type":44,"value":450},"bun",{"type":44,"value":452}," on first run if it's missing (the server is Bun-native). Set ",{"type":38,"tag":47,"props":454,"children":456},{"className":455},[],[457],{"type":44,"value":458},"BROWSER_HARNESS_SKIP_BUN_INSTALL=1",{"type":44,"value":460}," to opt out.",{"type":38,"tag":129,"props":462,"children":464},{"id":463},"how-to-use",[465],{"type":44,"value":466},"How to use",{"type":38,"tag":56,"props":468,"children":469},{},[470,472,478,480,486],{"type":44,"value":471},"Just run ",{"type":38,"tag":47,"props":473,"children":475},{"className":474},[],[476],{"type":44,"value":477},"browser-harness-js '\u003CJS>'",{"type":44,"value":479},". The first call spawns the server in the background; subsequent calls hit the same process and so reuse the same ",{"type":38,"tag":47,"props":481,"children":483},{"className":482},[],[484],{"type":44,"value":485},"session",{"type":44,"value":487},", the same WebSocket to Chrome, and any globals you set.",{"type":38,"tag":146,"props":489,"children":491},{"className":148,"code":490,"language":150,"meta":151,"style":151},"browser-harness-js 'await session.connect()'\nbrowser-harness-js 'await session.Page.navigate({url:\"https:\u002F\u002Fexample.com\"})'\nbrowser-harness-js '(await session.Runtime.evaluate({expression:\"document.title\",returnByValue:true})).result.value'\n",[492],{"type":38,"tag":47,"props":493,"children":494},{"__ignoreMap":151},[495,517,537],{"type":38,"tag":157,"props":496,"children":497},{"class":159,"line":160},[498,502,507,512],{"type":38,"tag":157,"props":499,"children":500},{"style":207},[501],{"type":44,"value":52},{"type":38,"tag":157,"props":503,"children":504},{"style":191},[505],{"type":44,"value":506}," '",{"type":38,"tag":157,"props":508,"children":509},{"style":180},[510],{"type":44,"value":511},"await session.connect()",{"type":38,"tag":157,"props":513,"children":514},{"style":191},[515],{"type":44,"value":516},"'\n",{"type":38,"tag":157,"props":518,"children":519},{"class":159,"line":170},[520,524,528,533],{"type":38,"tag":157,"props":521,"children":522},{"style":207},[523],{"type":44,"value":52},{"type":38,"tag":157,"props":525,"children":526},{"style":191},[527],{"type":44,"value":506},{"type":38,"tag":157,"props":529,"children":530},{"style":180},[531],{"type":44,"value":532},"await session.Page.navigate({url:\"https:\u002F\u002Fexample.com\"})",{"type":38,"tag":157,"props":534,"children":535},{"style":191},[536],{"type":44,"value":516},{"type":38,"tag":157,"props":538,"children":539},{"class":159,"line":249},[540,544,548,553],{"type":38,"tag":157,"props":541,"children":542},{"style":207},[543],{"type":44,"value":52},{"type":38,"tag":157,"props":545,"children":546},{"style":191},[547],{"type":44,"value":506},{"type":38,"tag":157,"props":549,"children":550},{"style":180},[551],{"type":44,"value":552},"(await session.Runtime.evaluate({expression:\"document.title\",returnByValue:true})).result.value",{"type":38,"tag":157,"props":554,"children":555},{"style":191},[556],{"type":44,"value":516},{"type":38,"tag":56,"props":558,"children":559},{},[560,562,568,570,576],{"type":44,"value":561},"Output is the ",{"type":38,"tag":563,"props":564,"children":565},"strong",{},[566],{"type":44,"value":567},"raw result content",{"type":44,"value":569}," — no ",{"type":38,"tag":47,"props":571,"children":573},{"className":572},[],[574],{"type":44,"value":575},"{ok,result}",{"type":44,"value":577}," envelope.",{"type":38,"tag":579,"props":580,"children":581},"table",{},[582,601],{"type":38,"tag":583,"props":584,"children":585},"thead",{},[586],{"type":38,"tag":587,"props":588,"children":589},"tr",{},[590,596],{"type":38,"tag":591,"props":592,"children":593},"th",{},[594],{"type":44,"value":595},"Result type",{"type":38,"tag":591,"props":597,"children":598},{},[599],{"type":44,"value":600},"stdout",{"type":38,"tag":602,"props":603,"children":604},"tbody",{},[605,627,652,679],{"type":38,"tag":587,"props":606,"children":607},{},[608,614],{"type":38,"tag":609,"props":610,"children":611},"td",{},[612],{"type":44,"value":613},"string",{"type":38,"tag":609,"props":615,"children":616},{},[617,619,625],{"type":44,"value":618},"bare text, no JSON quotes (e.g. ",{"type":38,"tag":47,"props":620,"children":622},{"className":621},[],[623],{"type":44,"value":624},"Example Domain",{"type":44,"value":626},")",{"type":38,"tag":587,"props":628,"children":629},{},[630,635],{"type":38,"tag":609,"props":631,"children":632},{},[633],{"type":44,"value":634},"number \u002F boolean",{"type":38,"tag":609,"props":636,"children":637},{},[638,644,646],{"type":38,"tag":47,"props":639,"children":641},{"className":640},[],[642],{"type":44,"value":643},"42",{"type":44,"value":645},", ",{"type":38,"tag":47,"props":647,"children":649},{"className":648},[],[650],{"type":44,"value":651},"true",{"type":38,"tag":587,"props":653,"children":654},{},[655,660],{"type":38,"tag":609,"props":656,"children":657},{},[658],{"type":44,"value":659},"object \u002F array (non-empty)",{"type":38,"tag":609,"props":661,"children":662},{},[663,665,671,672,678],{"type":44,"value":664},"compact JSON (e.g. ",{"type":38,"tag":47,"props":666,"children":668},{"className":667},[],[669],{"type":44,"value":670},"{\"frameId\":\"...\"}",{"type":44,"value":645},{"type":38,"tag":47,"props":673,"children":675},{"className":674},[],[676],{"type":44,"value":677},"[1,2,3]",{"type":44,"value":626},{"type":38,"tag":587,"props":680,"children":681},{},[682,720],{"type":38,"tag":609,"props":683,"children":684},{},[685,691,693,699,700,706,707,713,714],{"type":38,"tag":47,"props":686,"children":688},{"className":687},[],[689],{"type":44,"value":690},"undefined",{"type":44,"value":692}," \u002F ",{"type":38,"tag":47,"props":694,"children":696},{"className":695},[],[697],{"type":44,"value":698},"null",{"type":44,"value":692},{"type":38,"tag":47,"props":701,"children":703},{"className":702},[],[704],{"type":44,"value":705},"\"\"",{"type":44,"value":692},{"type":38,"tag":47,"props":708,"children":710},{"className":709},[],[711],{"type":44,"value":712},"{}",{"type":44,"value":692},{"type":38,"tag":47,"props":715,"children":717},{"className":716},[],[718],{"type":44,"value":719},"[]",{"type":38,"tag":609,"props":721,"children":722},{},[723],{"type":44,"value":724},"empty (no output)",{"type":38,"tag":56,"props":726,"children":727},{},[728,733,735,740,742,748],{"type":38,"tag":563,"props":729,"children":730},{},[731],{"type":44,"value":732},"Errors",{"type":44,"value":734}," go to ",{"type":38,"tag":563,"props":736,"children":737},{},[738],{"type":44,"value":739},"stderr",{"type":44,"value":741},", exit code ",{"type":38,"tag":47,"props":743,"children":745},{"className":744},[],[746],{"type":44,"value":747},"1",{"type":44,"value":749},". The CDP error message and JS stack are printed verbatim, e.g.:",{"type":38,"tag":146,"props":751,"children":755},{"className":752,"code":754,"language":44},[753],"language-text","Error: CDP -32602: invalid params\n    at _call (...\u002Fsession.ts:117:33)\n    ...\n",[756],{"type":38,"tag":47,"props":757,"children":758},{"__ignoreMap":151},[759],{"type":44,"value":754},{"type":38,"tag":56,"props":761,"children":762},{},[763,765,771,773,779],{"type":44,"value":764},"Detect failure with ",{"type":38,"tag":47,"props":766,"children":768},{"className":767},[],[769],{"type":44,"value":770},"if browser-harness-js '...'; then ...; else handle_error; fi",{"type":44,"value":772}," or by checking ",{"type":38,"tag":47,"props":774,"children":776},{"className":775},[],[777],{"type":44,"value":778},"$?",{"type":44,"value":127},{"type":38,"tag":56,"props":781,"children":782},{},[783,788,790,796],{"type":38,"tag":563,"props":784,"children":785},{},[786],{"type":44,"value":787},"Multi-line snippets via stdin (heredoc).",{"type":44,"value":789}," Important: a multi-statement snippet does NOT auto-return the last expression — write ",{"type":38,"tag":47,"props":791,"children":793},{"className":792},[],[794],{"type":44,"value":795},"return X",{"type":44,"value":797}," explicitly. Single-expression snippets passed as the first argument DO auto-return.",{"type":38,"tag":146,"props":799,"children":801},{"className":148,"code":800,"language":150,"meta":151,"style":151},"browser-harness-js \u003C\u003C'EOF'\nconst tabs = await listPageTargets();\nglobalThis.tid = tabs[0].targetId;\nawait session.use(globalThis.tid);\nreturn globalThis.tid;\nEOF\n",[802],{"type":38,"tag":47,"props":803,"children":804},{"__ignoreMap":151},[805,822,830,838,846,854],{"type":38,"tag":157,"props":806,"children":807},{"class":159,"line":160},[808,812,817],{"type":38,"tag":157,"props":809,"children":810},{"style":207},[811],{"type":44,"value":52},{"type":38,"tag":157,"props":813,"children":814},{"style":191},[815],{"type":44,"value":816}," \u003C\u003C",{"type":38,"tag":157,"props":818,"children":819},{"style":191},[820],{"type":44,"value":821},"'EOF'\n",{"type":38,"tag":157,"props":823,"children":824},{"class":159,"line":170},[825],{"type":38,"tag":157,"props":826,"children":827},{"style":180},[828],{"type":44,"value":829},"const tabs = await listPageTargets();\n",{"type":38,"tag":157,"props":831,"children":832},{"class":159,"line":249},[833],{"type":38,"tag":157,"props":834,"children":835},{"style":180},[836],{"type":44,"value":837},"globalThis.tid = tabs[0].targetId;\n",{"type":38,"tag":157,"props":839,"children":840},{"class":159,"line":259},[841],{"type":38,"tag":157,"props":842,"children":843},{"style":180},[844],{"type":44,"value":845},"await session.use(globalThis.tid);\n",{"type":38,"tag":157,"props":847,"children":848},{"class":159,"line":268},[849],{"type":38,"tag":157,"props":850,"children":851},{"style":180},[852],{"type":44,"value":853},"return globalThis.tid;\n",{"type":38,"tag":157,"props":855,"children":856},{"class":159,"line":329},[857],{"type":38,"tag":157,"props":858,"children":859},{"style":191},[860],{"type":44,"value":861},"EOF\n",{"type":38,"tag":129,"props":863,"children":865},{"id":864},"cli-commands",[866],{"type":44,"value":867},"CLI commands",{"type":38,"tag":579,"props":869,"children":870},{},[871,887],{"type":38,"tag":583,"props":872,"children":873},{},[874],{"type":38,"tag":587,"props":875,"children":876},{},[877,882],{"type":38,"tag":591,"props":878,"children":879},{},[880],{"type":44,"value":881},"Command",{"type":38,"tag":591,"props":883,"children":884},{},[885],{"type":44,"value":886},"Behavior",{"type":38,"tag":602,"props":888,"children":889},{},[890,907,924,941,958,975,992],{"type":38,"tag":587,"props":891,"children":892},{},[893,902],{"type":38,"tag":609,"props":894,"children":895},{},[896],{"type":38,"tag":47,"props":897,"children":899},{"className":898},[],[900],{"type":44,"value":901},"browser-harness-js '\u003Cjs>'",{"type":38,"tag":609,"props":903,"children":904},{},[905],{"type":44,"value":906},"Auto-start server if needed, eval the JS, print result.",{"type":38,"tag":587,"props":908,"children":909},{},[910,919],{"type":38,"tag":609,"props":911,"children":912},{},[913],{"type":38,"tag":47,"props":914,"children":916},{"className":915},[],[917],{"type":44,"value":918},"browser-harness-js \u003C\u003CEOF…EOF",{"type":38,"tag":609,"props":920,"children":921},{},[922],{"type":44,"value":923},"Same, code from stdin.",{"type":38,"tag":587,"props":925,"children":926},{},[927,936],{"type":38,"tag":609,"props":928,"children":929},{},[930],{"type":38,"tag":47,"props":931,"children":933},{"className":932},[],[934],{"type":44,"value":935},"browser-harness-js --status",{"type":38,"tag":609,"props":937,"children":938},{},[939],{"type":44,"value":940},"Print health JSON (uptime, connected, sessionId) or exit 1 if down.",{"type":38,"tag":587,"props":942,"children":943},{},[944,953],{"type":38,"tag":609,"props":945,"children":946},{},[947],{"type":38,"tag":47,"props":948,"children":950},{"className":949},[],[951],{"type":44,"value":952},"browser-harness-js --start",{"type":38,"tag":609,"props":954,"children":955},{},[956],{"type":44,"value":957},"Explicit start (no-op if already running).",{"type":38,"tag":587,"props":959,"children":960},{},[961,970],{"type":38,"tag":609,"props":962,"children":963},{},[964],{"type":38,"tag":47,"props":965,"children":967},{"className":966},[],[968],{"type":44,"value":969},"browser-harness-js --stop",{"type":38,"tag":609,"props":971,"children":972},{},[973],{"type":44,"value":974},"Graceful shutdown. Drops session state.",{"type":38,"tag":587,"props":976,"children":977},{},[978,987],{"type":38,"tag":609,"props":979,"children":980},{},[981],{"type":38,"tag":47,"props":982,"children":984},{"className":983},[],[985],{"type":44,"value":986},"browser-harness-js --restart",{"type":38,"tag":609,"props":988,"children":989},{},[990],{"type":44,"value":991},"Stop + start fresh.",{"type":38,"tag":587,"props":993,"children":994},{},[995,1004],{"type":38,"tag":609,"props":996,"children":997},{},[998],{"type":38,"tag":47,"props":999,"children":1001},{"className":1000},[],[1002],{"type":44,"value":1003},"browser-harness-js --logs",{"type":38,"tag":609,"props":1005,"children":1006},{},[1007,1013,1015,1021],{"type":38,"tag":47,"props":1008,"children":1010},{"className":1009},[],[1011],{"type":44,"value":1012},"tail -f",{"type":44,"value":1014}," the server log (",{"type":38,"tag":47,"props":1016,"children":1018},{"className":1017},[],[1019],{"type":44,"value":1020},"\u002Ftmp\u002Fbrowser-harness-js.log",{"type":44,"value":1022},").",{"type":38,"tag":56,"props":1024,"children":1025},{},[1026,1028,1034,1036,1042,1044,1050,1051,1056],{"type":44,"value":1027},"Env vars: ",{"type":38,"tag":47,"props":1029,"children":1031},{"className":1030},[],[1032],{"type":44,"value":1033},"CDP_REPL_PORT",{"type":44,"value":1035}," (default ",{"type":38,"tag":47,"props":1037,"children":1039},{"className":1038},[],[1040],{"type":44,"value":1041},"9876",{"type":44,"value":1043},"), ",{"type":38,"tag":47,"props":1045,"children":1047},{"className":1046},[],[1048],{"type":44,"value":1049},"CDP_REPL_LOG",{"type":44,"value":1035},{"type":38,"tag":47,"props":1052,"children":1054},{"className":1053},[],[1055],{"type":44,"value":1020},{"type":44,"value":1022},{"type":38,"tag":129,"props":1058,"children":1060},{"id":1059},"api-surface-inside-snippets",[1061],{"type":44,"value":1062},"API surface inside snippets",{"type":38,"tag":56,"props":1064,"children":1065},{},[1066],{"type":44,"value":1067},"These globals are pre-loaded — no imports needed:",{"type":38,"tag":1069,"props":1070,"children":1071},"ul",{},[1072,1119,1154,1173,1215],{"type":38,"tag":1073,"props":1074,"children":1075},"li",{},[1076,1081,1083,1088,1090,1096,1097,1103,1104,1110,1111,1117],{"type":38,"tag":47,"props":1077,"children":1079},{"className":1078},[],[1080],{"type":44,"value":485},{"type":44,"value":1082}," — the persistent ",{"type":38,"tag":47,"props":1084,"children":1086},{"className":1085},[],[1087],{"type":44,"value":66},{"type":44,"value":1089},". Has every CDP domain mounted: ",{"type":38,"tag":47,"props":1091,"children":1093},{"className":1092},[],[1094],{"type":44,"value":1095},"session.Page",{"type":44,"value":645},{"type":38,"tag":47,"props":1098,"children":1100},{"className":1099},[],[1101],{"type":44,"value":1102},"session.DOM",{"type":44,"value":645},{"type":38,"tag":47,"props":1105,"children":1107},{"className":1106},[],[1108],{"type":44,"value":1109},"session.Runtime",{"type":44,"value":645},{"type":38,"tag":47,"props":1112,"children":1114},{"className":1113},[],[1115],{"type":44,"value":1116},"session.Network",{"type":44,"value":1118},", … 56 domains, 652 methods total.",{"type":38,"tag":1073,"props":1120,"children":1121},{},[1122,1128,1130,1136,1138,1144,1146,1152],{"type":38,"tag":47,"props":1123,"children":1125},{"className":1124},[],[1126],{"type":44,"value":1127},"listPageTargets()",{"type":44,"value":1129}," — list real page targets via CDP's ",{"type":38,"tag":47,"props":1131,"children":1133},{"className":1132},[],[1134],{"type":44,"value":1135},"Target.getTargets",{"type":44,"value":1137}," (works on Chrome 144+ too), with ",{"type":38,"tag":47,"props":1139,"children":1141},{"className":1140},[],[1142],{"type":44,"value":1143},"chrome:\u002F\u002F",{"type":44,"value":1145}," and ",{"type":38,"tag":47,"props":1147,"children":1149},{"className":1148},[],[1150],{"type":44,"value":1151},"devtools:\u002F\u002F",{"type":44,"value":1153}," URLs filtered out. No args — uses the connected session.",{"type":38,"tag":1073,"props":1155,"children":1156},{},[1157,1163,1165,1171],{"type":38,"tag":47,"props":1158,"children":1160},{"className":1159},[],[1161],{"type":44,"value":1162},"detectBrowsers()",{"type":44,"value":1164}," — scan OS-specific profile dirs for running Chromium-based browsers with remote debugging on. Returns ",{"type":38,"tag":47,"props":1166,"children":1168},{"className":1167},[],[1169],{"type":44,"value":1170},"[{name, profileDir, port, wsPath, wsUrl, mtimeMs}]",{"type":44,"value":1172},", sorted by most recently launched.",{"type":38,"tag":1073,"props":1174,"children":1175},{},[1176,1182,1184,1190,1192,1198,1199,1205,1207,1213],{"type":38,"tag":47,"props":1177,"children":1179},{"className":1178},[],[1180],{"type":44,"value":1181},"resolveWsUrl(opts)",{"type":44,"value":1183}," — resolve a WS URL from ",{"type":38,"tag":47,"props":1185,"children":1187},{"className":1186},[],[1188],{"type":44,"value":1189},"{wsUrl}",{"type":44,"value":1191}," | ",{"type":38,"tag":47,"props":1193,"children":1195},{"className":1194},[],[1196],{"type":44,"value":1197},"{port, host?}",{"type":44,"value":1191},{"type":38,"tag":47,"props":1200,"children":1202},{"className":1201},[],[1203],{"type":44,"value":1204},"{profileDir}",{"type":44,"value":1206},". For the no-args auto-detect flow, call ",{"type":38,"tag":47,"props":1208,"children":1210},{"className":1209},[],[1211],{"type":44,"value":1212},"session.connect()",{"type":44,"value":1214}," directly instead.",{"type":38,"tag":1073,"props":1216,"children":1217},{},[1218,1224,1226,1232,1233,1239],{"type":38,"tag":47,"props":1219,"children":1221},{"className":1220},[],[1222],{"type":44,"value":1223},"CDP",{"type":44,"value":1225}," — the generated namespaces (",{"type":38,"tag":47,"props":1227,"children":1229},{"className":1228},[],[1230],{"type":44,"value":1231},"CDP.Page",{"type":44,"value":645},{"type":38,"tag":47,"props":1234,"children":1236},{"className":1235},[],[1237],{"type":44,"value":1238},"CDP.Runtime",{"type":44,"value":1240},", …) for type-name reference.",{"type":38,"tag":1242,"props":1243,"children":1245},"h3",{"id":1244},"calling-a-cdp-method",[1246],{"type":44,"value":1247},"Calling a CDP method",{"type":38,"tag":56,"props":1249,"children":1250},{},[1251,1253,1259,1261,1267],{"type":44,"value":1252},"Every method takes a single object argument matching the CDP wire params; it resolves to the typed return value (no ",{"type":38,"tag":47,"props":1254,"children":1256},{"className":1255},[],[1257],{"type":44,"value":1258},"result",{"type":44,"value":1260}," envelope, no ",{"type":38,"tag":47,"props":1262,"children":1264},{"className":1263},[],[1265],{"type":44,"value":1266},"id",{"type":44,"value":1268}," correlation — handled for you).",{"type":38,"tag":146,"props":1270,"children":1274},{"className":1271,"code":1272,"language":1273,"meta":151,"style":151},"language-js shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u002F\u002F no params\nawait session.DOM.enable()\n\n\u002F\u002F required params\nawait session.Page.navigate({ url: 'https:\u002F\u002Fexample.com' })\n\n\u002F\u002F all-optional params (object also optional)\nawait session.Page.captureScreenshot()\nawait session.Page.captureScreenshot({ format: 'png', quality: 80 })\n\n\u002F\u002F returns are stripped to the typed shape\nconst { root } = await session.DOM.getDocument()\nconst { nodeId } = await session.DOM.querySelector({ nodeId: root.nodeId, selector: 'h1' })\n","js",[1275],{"type":38,"tag":47,"props":1276,"children":1277},{"__ignoreMap":151},[1278,1286,1323,1330,1338,1412,1419,1427,1459,1545,1553,1562,1621],{"type":38,"tag":157,"props":1279,"children":1280},{"class":159,"line":160},[1281],{"type":38,"tag":157,"props":1282,"children":1283},{"style":164},[1284],{"type":44,"value":1285},"\u002F\u002F no params\n",{"type":38,"tag":157,"props":1287,"children":1288},{"class":159,"line":170},[1289,1295,1300,1304,1309,1313,1318],{"type":38,"tag":157,"props":1290,"children":1292},{"style":1291},"--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic",[1293],{"type":44,"value":1294},"await",{"type":38,"tag":157,"props":1296,"children":1297},{"style":228},[1298],{"type":44,"value":1299}," session",{"type":38,"tag":157,"props":1301,"children":1302},{"style":191},[1303],{"type":44,"value":127},{"type":38,"tag":157,"props":1305,"children":1306},{"style":228},[1307],{"type":44,"value":1308},"DOM",{"type":38,"tag":157,"props":1310,"children":1311},{"style":191},[1312],{"type":44,"value":127},{"type":38,"tag":157,"props":1314,"children":1315},{"style":174},[1316],{"type":44,"value":1317},"enable",{"type":38,"tag":157,"props":1319,"children":1320},{"style":228},[1321],{"type":44,"value":1322},"()\n",{"type":38,"tag":157,"props":1324,"children":1325},{"class":159,"line":249},[1326],{"type":38,"tag":157,"props":1327,"children":1328},{"emptyLinePlaceholder":253},[1329],{"type":44,"value":256},{"type":38,"tag":157,"props":1331,"children":1332},{"class":159,"line":259},[1333],{"type":38,"tag":157,"props":1334,"children":1335},{"style":164},[1336],{"type":44,"value":1337},"\u002F\u002F required params\n",{"type":38,"tag":157,"props":1339,"children":1340},{"class":159,"line":268},[1341,1345,1349,1353,1358,1362,1367,1372,1377,1383,1388,1392,1397,1402,1407],{"type":38,"tag":157,"props":1342,"children":1343},{"style":1291},[1344],{"type":44,"value":1294},{"type":38,"tag":157,"props":1346,"children":1347},{"style":228},[1348],{"type":44,"value":1299},{"type":38,"tag":157,"props":1350,"children":1351},{"style":191},[1352],{"type":44,"value":127},{"type":38,"tag":157,"props":1354,"children":1355},{"style":228},[1356],{"type":44,"value":1357},"Page",{"type":38,"tag":157,"props":1359,"children":1360},{"style":191},[1361],{"type":44,"value":127},{"type":38,"tag":157,"props":1363,"children":1364},{"style":174},[1365],{"type":44,"value":1366},"navigate",{"type":38,"tag":157,"props":1368,"children":1369},{"style":228},[1370],{"type":44,"value":1371},"(",{"type":38,"tag":157,"props":1373,"children":1374},{"style":191},[1375],{"type":44,"value":1376},"{",{"type":38,"tag":157,"props":1378,"children":1380},{"style":1379},"--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178",[1381],{"type":44,"value":1382}," url",{"type":38,"tag":157,"props":1384,"children":1385},{"style":191},[1386],{"type":44,"value":1387},":",{"type":38,"tag":157,"props":1389,"children":1390},{"style":191},[1391],{"type":44,"value":506},{"type":38,"tag":157,"props":1393,"children":1394},{"style":180},[1395],{"type":44,"value":1396},"https:\u002F\u002Fexample.com",{"type":38,"tag":157,"props":1398,"children":1399},{"style":191},[1400],{"type":44,"value":1401},"'",{"type":38,"tag":157,"props":1403,"children":1404},{"style":191},[1405],{"type":44,"value":1406}," }",{"type":38,"tag":157,"props":1408,"children":1409},{"style":228},[1410],{"type":44,"value":1411},")\n",{"type":38,"tag":157,"props":1413,"children":1414},{"class":159,"line":329},[1415],{"type":38,"tag":157,"props":1416,"children":1417},{"emptyLinePlaceholder":253},[1418],{"type":44,"value":256},{"type":38,"tag":157,"props":1420,"children":1421},{"class":159,"line":337},[1422],{"type":38,"tag":157,"props":1423,"children":1424},{"style":164},[1425],{"type":44,"value":1426},"\u002F\u002F all-optional params (object also optional)\n",{"type":38,"tag":157,"props":1428,"children":1429},{"class":159,"line":346},[1430,1434,1438,1442,1446,1450,1455],{"type":38,"tag":157,"props":1431,"children":1432},{"style":1291},[1433],{"type":44,"value":1294},{"type":38,"tag":157,"props":1435,"children":1436},{"style":228},[1437],{"type":44,"value":1299},{"type":38,"tag":157,"props":1439,"children":1440},{"style":191},[1441],{"type":44,"value":127},{"type":38,"tag":157,"props":1443,"children":1444},{"style":228},[1445],{"type":44,"value":1357},{"type":38,"tag":157,"props":1447,"children":1448},{"style":191},[1449],{"type":44,"value":127},{"type":38,"tag":157,"props":1451,"children":1452},{"style":174},[1453],{"type":44,"value":1454},"captureScreenshot",{"type":38,"tag":157,"props":1456,"children":1457},{"style":228},[1458],{"type":44,"value":1322},{"type":38,"tag":157,"props":1460,"children":1462},{"class":159,"line":1461},9,[1463,1467,1471,1475,1479,1483,1487,1491,1495,1500,1504,1508,1513,1517,1522,1527,1531,1537,1541],{"type":38,"tag":157,"props":1464,"children":1465},{"style":1291},[1466],{"type":44,"value":1294},{"type":38,"tag":157,"props":1468,"children":1469},{"style":228},[1470],{"type":44,"value":1299},{"type":38,"tag":157,"props":1472,"children":1473},{"style":191},[1474],{"type":44,"value":127},{"type":38,"tag":157,"props":1476,"children":1477},{"style":228},[1478],{"type":44,"value":1357},{"type":38,"tag":157,"props":1480,"children":1481},{"style":191},[1482],{"type":44,"value":127},{"type":38,"tag":157,"props":1484,"children":1485},{"style":174},[1486],{"type":44,"value":1454},{"type":38,"tag":157,"props":1488,"children":1489},{"style":228},[1490],{"type":44,"value":1371},{"type":38,"tag":157,"props":1492,"children":1493},{"style":191},[1494],{"type":44,"value":1376},{"type":38,"tag":157,"props":1496,"children":1497},{"style":1379},[1498],{"type":44,"value":1499}," format",{"type":38,"tag":157,"props":1501,"children":1502},{"style":191},[1503],{"type":44,"value":1387},{"type":38,"tag":157,"props":1505,"children":1506},{"style":191},[1507],{"type":44,"value":506},{"type":38,"tag":157,"props":1509,"children":1510},{"style":180},[1511],{"type":44,"value":1512},"png",{"type":38,"tag":157,"props":1514,"children":1515},{"style":191},[1516],{"type":44,"value":1401},{"type":38,"tag":157,"props":1518,"children":1519},{"style":191},[1520],{"type":44,"value":1521},",",{"type":38,"tag":157,"props":1523,"children":1524},{"style":1379},[1525],{"type":44,"value":1526}," quality",{"type":38,"tag":157,"props":1528,"children":1529},{"style":191},[1530],{"type":44,"value":1387},{"type":38,"tag":157,"props":1532,"children":1534},{"style":1533},"--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C",[1535],{"type":44,"value":1536}," 80",{"type":38,"tag":157,"props":1538,"children":1539},{"style":191},[1540],{"type":44,"value":1406},{"type":38,"tag":157,"props":1542,"children":1543},{"style":228},[1544],{"type":44,"value":1411},{"type":38,"tag":157,"props":1546,"children":1548},{"class":159,"line":1547},10,[1549],{"type":38,"tag":157,"props":1550,"children":1551},{"emptyLinePlaceholder":253},[1552],{"type":44,"value":256},{"type":38,"tag":157,"props":1554,"children":1556},{"class":159,"line":1555},11,[1557],{"type":38,"tag":157,"props":1558,"children":1559},{"style":164},[1560],{"type":44,"value":1561},"\u002F\u002F returns are stripped to the typed shape\n",{"type":38,"tag":157,"props":1563,"children":1565},{"class":159,"line":1564},12,[1566,1572,1576,1581,1586,1591,1596,1600,1604,1608,1612,1617],{"type":38,"tag":157,"props":1567,"children":1569},{"style":1568},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[1570],{"type":44,"value":1571},"const",{"type":38,"tag":157,"props":1573,"children":1574},{"style":191},[1575],{"type":44,"value":376},{"type":38,"tag":157,"props":1577,"children":1578},{"style":228},[1579],{"type":44,"value":1580}," root ",{"type":38,"tag":157,"props":1582,"children":1583},{"style":191},[1584],{"type":44,"value":1585},"}",{"type":38,"tag":157,"props":1587,"children":1588},{"style":191},[1589],{"type":44,"value":1590}," =",{"type":38,"tag":157,"props":1592,"children":1593},{"style":1291},[1594],{"type":44,"value":1595}," await",{"type":38,"tag":157,"props":1597,"children":1598},{"style":228},[1599],{"type":44,"value":1299},{"type":38,"tag":157,"props":1601,"children":1602},{"style":191},[1603],{"type":44,"value":127},{"type":38,"tag":157,"props":1605,"children":1606},{"style":228},[1607],{"type":44,"value":1308},{"type":38,"tag":157,"props":1609,"children":1610},{"style":191},[1611],{"type":44,"value":127},{"type":38,"tag":157,"props":1613,"children":1614},{"style":174},[1615],{"type":44,"value":1616},"getDocument",{"type":38,"tag":157,"props":1618,"children":1619},{"style":228},[1620],{"type":44,"value":1322},{"type":38,"tag":157,"props":1622,"children":1624},{"class":159,"line":1623},13,[1625,1629,1633,1638,1642,1646,1650,1654,1658,1662,1666,1671,1675,1679,1684,1688,1693,1697,1702,1706,1711,1715,1719,1723,1727,1731],{"type":38,"tag":157,"props":1626,"children":1627},{"style":1568},[1628],{"type":44,"value":1571},{"type":38,"tag":157,"props":1630,"children":1631},{"style":191},[1632],{"type":44,"value":376},{"type":38,"tag":157,"props":1634,"children":1635},{"style":228},[1636],{"type":44,"value":1637}," nodeId ",{"type":38,"tag":157,"props":1639,"children":1640},{"style":191},[1641],{"type":44,"value":1585},{"type":38,"tag":157,"props":1643,"children":1644},{"style":191},[1645],{"type":44,"value":1590},{"type":38,"tag":157,"props":1647,"children":1648},{"style":1291},[1649],{"type":44,"value":1595},{"type":38,"tag":157,"props":1651,"children":1652},{"style":228},[1653],{"type":44,"value":1299},{"type":38,"tag":157,"props":1655,"children":1656},{"style":191},[1657],{"type":44,"value":127},{"type":38,"tag":157,"props":1659,"children":1660},{"style":228},[1661],{"type":44,"value":1308},{"type":38,"tag":157,"props":1663,"children":1664},{"style":191},[1665],{"type":44,"value":127},{"type":38,"tag":157,"props":1667,"children":1668},{"style":174},[1669],{"type":44,"value":1670},"querySelector",{"type":38,"tag":157,"props":1672,"children":1673},{"style":228},[1674],{"type":44,"value":1371},{"type":38,"tag":157,"props":1676,"children":1677},{"style":191},[1678],{"type":44,"value":1376},{"type":38,"tag":157,"props":1680,"children":1681},{"style":1379},[1682],{"type":44,"value":1683}," nodeId",{"type":38,"tag":157,"props":1685,"children":1686},{"style":191},[1687],{"type":44,"value":1387},{"type":38,"tag":157,"props":1689,"children":1690},{"style":228},[1691],{"type":44,"value":1692}," root",{"type":38,"tag":157,"props":1694,"children":1695},{"style":191},[1696],{"type":44,"value":127},{"type":38,"tag":157,"props":1698,"children":1699},{"style":228},[1700],{"type":44,"value":1701},"nodeId",{"type":38,"tag":157,"props":1703,"children":1704},{"style":191},[1705],{"type":44,"value":1521},{"type":38,"tag":157,"props":1707,"children":1708},{"style":1379},[1709],{"type":44,"value":1710}," selector",{"type":38,"tag":157,"props":1712,"children":1713},{"style":191},[1714],{"type":44,"value":1387},{"type":38,"tag":157,"props":1716,"children":1717},{"style":191},[1718],{"type":44,"value":506},{"type":38,"tag":157,"props":1720,"children":1721},{"style":180},[1722],{"type":44,"value":39},{"type":38,"tag":157,"props":1724,"children":1725},{"style":191},[1726],{"type":44,"value":1401},{"type":38,"tag":157,"props":1728,"children":1729},{"style":191},[1730],{"type":44,"value":1406},{"type":38,"tag":157,"props":1732,"children":1733},{"style":228},[1734],{"type":44,"value":1411},{"type":38,"tag":1242,"props":1736,"children":1738},{"id":1737},"connecting",[1739],{"type":44,"value":1740},"Connecting",{"type":38,"tag":56,"props":1742,"children":1743},{},[1744,1756,1758,1764],{"type":38,"tag":563,"props":1745,"children":1746},{},[1747,1749,1754],{"type":44,"value":1748},"Default: just call ",{"type":38,"tag":47,"props":1750,"children":1752},{"className":1751},[],[1753],{"type":44,"value":1212},{"type":44,"value":1755}," with no args.",{"type":44,"value":1757}," It auto-detects running Chromium-based browsers (Chrome, Chromium, Edge, Brave, Arc, Vivaldi, Opera, Comet, Canary) by scanning OS-specific profile dirs for a ",{"type":38,"tag":47,"props":1759,"children":1761},{"className":1760},[],[1762],{"type":44,"value":1763},"DevToolsActivePort",{"type":44,"value":1765}," file, ordered by most-recently-launched, and picks the first one whose WebSocket accepts. OS-agnostic — works on macOS, Linux, Windows.",{"type":38,"tag":146,"props":1767,"children":1769},{"className":1271,"code":1768,"language":1273,"meta":151,"style":151},"await session.connect()   \u002F\u002F auto-detect\n",[1770],{"type":38,"tag":47,"props":1771,"children":1772},{"__ignoreMap":151},[1773],{"type":38,"tag":157,"props":1774,"children":1775},{"class":159,"line":160},[1776,1780,1784,1788,1793,1798],{"type":38,"tag":157,"props":1777,"children":1778},{"style":1291},[1779],{"type":44,"value":1294},{"type":38,"tag":157,"props":1781,"children":1782},{"style":228},[1783],{"type":44,"value":1299},{"type":38,"tag":157,"props":1785,"children":1786},{"style":191},[1787],{"type":44,"value":127},{"type":38,"tag":157,"props":1789,"children":1790},{"style":174},[1791],{"type":44,"value":1792},"connect",{"type":38,"tag":157,"props":1794,"children":1795},{"style":228},[1796],{"type":44,"value":1797},"()   ",{"type":38,"tag":157,"props":1799,"children":1800},{"style":164},[1801],{"type":44,"value":1802},"\u002F\u002F auto-detect\n",{"type":38,"tag":56,"props":1804,"children":1805},{},[1806,1808,1813],{"type":44,"value":1807},"Use ",{"type":38,"tag":47,"props":1809,"children":1811},{"className":1810},[],[1812],{"type":44,"value":1162},{"type":44,"value":1814}," first if you want to see what's available (or let the user pick) before connecting:",{"type":38,"tag":146,"props":1816,"children":1818},{"className":1271,"code":1817,"language":1273,"meta":151,"style":151},"const found = await detectBrowsers()\n\u002F\u002F [{ name: 'Google Chrome', profileDir, port, wsPath, wsUrl, mtimeMs }, ...]\n",[1819],{"type":38,"tag":47,"props":1820,"children":1821},{"__ignoreMap":151},[1822,1852],{"type":38,"tag":157,"props":1823,"children":1824},{"class":159,"line":160},[1825,1829,1834,1839,1843,1848],{"type":38,"tag":157,"props":1826,"children":1827},{"style":1568},[1828],{"type":44,"value":1571},{"type":38,"tag":157,"props":1830,"children":1831},{"style":228},[1832],{"type":44,"value":1833}," found ",{"type":38,"tag":157,"props":1835,"children":1836},{"style":191},[1837],{"type":44,"value":1838},"=",{"type":38,"tag":157,"props":1840,"children":1841},{"style":1291},[1842],{"type":44,"value":1595},{"type":38,"tag":157,"props":1844,"children":1845},{"style":174},[1846],{"type":44,"value":1847}," detectBrowsers",{"type":38,"tag":157,"props":1849,"children":1850},{"style":228},[1851],{"type":44,"value":1322},{"type":38,"tag":157,"props":1853,"children":1854},{"class":159,"line":170},[1855],{"type":38,"tag":157,"props":1856,"children":1857},{"style":164},[1858],{"type":44,"value":1859},"\u002F\u002F [{ name: 'Google Chrome', profileDir, port, wsPath, wsUrl, mtimeMs }, ...]\n",{"type":38,"tag":56,"props":1861,"children":1862},{},[1863,1868],{"type":38,"tag":563,"props":1864,"children":1865},{},[1866],{"type":44,"value":1867},"Explicit forms",{"type":44,"value":1869}," — use these only when auto-detect picks the wrong browser, or when you already know where to connect:",{"type":38,"tag":579,"props":1871,"children":1872},{},[1873,1889],{"type":38,"tag":583,"props":1874,"children":1875},{},[1876],{"type":38,"tag":587,"props":1877,"children":1878},{},[1879,1884],{"type":38,"tag":591,"props":1880,"children":1881},{},[1882],{"type":44,"value":1883},"Form",{"type":38,"tag":591,"props":1885,"children":1886},{},[1887],{"type":44,"value":1888},"When to use",{"type":38,"tag":602,"props":1890,"children":1891},{},[1892,1917],{"type":38,"tag":587,"props":1893,"children":1894},{},[1895,1904],{"type":38,"tag":609,"props":1896,"children":1897},{},[1898],{"type":38,"tag":47,"props":1899,"children":1901},{"className":1900},[],[1902],{"type":44,"value":1903},"{ profileDir }",{"type":38,"tag":609,"props":1905,"children":1906},{},[1907,1909,1915],{"type":44,"value":1908},"Target a specific browser when several are running. Reads ",{"type":38,"tag":47,"props":1910,"children":1912},{"className":1911},[],[1913],{"type":44,"value":1914},"\u003CprofileDir>\u002FDevToolsActivePort",{"type":44,"value":1916}," directly.",{"type":38,"tag":587,"props":1918,"children":1919},{},[1920,1929],{"type":38,"tag":609,"props":1921,"children":1922},{},[1923],{"type":38,"tag":47,"props":1924,"children":1926},{"className":1925},[],[1927],{"type":44,"value":1928},"{ wsUrl }",{"type":38,"tag":609,"props":1930,"children":1931},{},[1932,1934,1940],{"type":44,"value":1933},"You already have ",{"type":38,"tag":47,"props":1935,"children":1937},{"className":1936},[],[1938],{"type":44,"value":1939},"ws:\u002F\u002F…\u002Fdevtools\u002Fbrowser\u002F\u003Cuuid>",{"type":44,"value":1941}," (e.g. piped from elsewhere).",{"type":38,"tag":146,"props":1943,"children":1945},{"className":1271,"code":1944,"language":1273,"meta":151,"style":151},"await session.connect({ profileDir: '\u002FUsers\u002F\u003Cyou>\u002FLibrary\u002FApplication Support\u002FGoogle\u002FChrome' })\nawait session.connect({ wsUrl: 'ws:\u002F\u002F127.0.0.1:9222\u002Fdevtools\u002Fbrowser\u002F\u003Cuuid>' })\n",[1946],{"type":38,"tag":47,"props":1947,"children":1948},{"__ignoreMap":151},[1949,2006],{"type":38,"tag":157,"props":1950,"children":1951},{"class":159,"line":160},[1952,1956,1960,1964,1968,1972,1976,1981,1985,1989,1994,1998,2002],{"type":38,"tag":157,"props":1953,"children":1954},{"style":1291},[1955],{"type":44,"value":1294},{"type":38,"tag":157,"props":1957,"children":1958},{"style":228},[1959],{"type":44,"value":1299},{"type":38,"tag":157,"props":1961,"children":1962},{"style":191},[1963],{"type":44,"value":127},{"type":38,"tag":157,"props":1965,"children":1966},{"style":174},[1967],{"type":44,"value":1792},{"type":38,"tag":157,"props":1969,"children":1970},{"style":228},[1971],{"type":44,"value":1371},{"type":38,"tag":157,"props":1973,"children":1974},{"style":191},[1975],{"type":44,"value":1376},{"type":38,"tag":157,"props":1977,"children":1978},{"style":1379},[1979],{"type":44,"value":1980}," profileDir",{"type":38,"tag":157,"props":1982,"children":1983},{"style":191},[1984],{"type":44,"value":1387},{"type":38,"tag":157,"props":1986,"children":1987},{"style":191},[1988],{"type":44,"value":506},{"type":38,"tag":157,"props":1990,"children":1991},{"style":180},[1992],{"type":44,"value":1993},"\u002FUsers\u002F\u003Cyou>\u002FLibrary\u002FApplication Support\u002FGoogle\u002FChrome",{"type":38,"tag":157,"props":1995,"children":1996},{"style":191},[1997],{"type":44,"value":1401},{"type":38,"tag":157,"props":1999,"children":2000},{"style":191},[2001],{"type":44,"value":1406},{"type":38,"tag":157,"props":2003,"children":2004},{"style":228},[2005],{"type":44,"value":1411},{"type":38,"tag":157,"props":2007,"children":2008},{"class":159,"line":170},[2009,2013,2017,2021,2025,2029,2033,2038,2042,2046,2051,2055,2059],{"type":38,"tag":157,"props":2010,"children":2011},{"style":1291},[2012],{"type":44,"value":1294},{"type":38,"tag":157,"props":2014,"children":2015},{"style":228},[2016],{"type":44,"value":1299},{"type":38,"tag":157,"props":2018,"children":2019},{"style":191},[2020],{"type":44,"value":127},{"type":38,"tag":157,"props":2022,"children":2023},{"style":174},[2024],{"type":44,"value":1792},{"type":38,"tag":157,"props":2026,"children":2027},{"style":228},[2028],{"type":44,"value":1371},{"type":38,"tag":157,"props":2030,"children":2031},{"style":191},[2032],{"type":44,"value":1376},{"type":38,"tag":157,"props":2034,"children":2035},{"style":1379},[2036],{"type":44,"value":2037}," wsUrl",{"type":38,"tag":157,"props":2039,"children":2040},{"style":191},[2041],{"type":44,"value":1387},{"type":38,"tag":157,"props":2043,"children":2044},{"style":191},[2045],{"type":44,"value":506},{"type":38,"tag":157,"props":2047,"children":2048},{"style":180},[2049],{"type":44,"value":2050},"ws:\u002F\u002F127.0.0.1:9222\u002Fdevtools\u002Fbrowser\u002F\u003Cuuid>",{"type":38,"tag":157,"props":2052,"children":2053},{"style":191},[2054],{"type":44,"value":1401},{"type":38,"tag":157,"props":2056,"children":2057},{"style":191},[2058],{"type":44,"value":1406},{"type":38,"tag":157,"props":2060,"children":2061},{"style":228},[2062],{"type":44,"value":1411},{"type":38,"tag":56,"props":2064,"children":2065},{},[2066,2068,2073],{"type":44,"value":2067},"Profile paths by OS — use these with ",{"type":38,"tag":47,"props":2069,"children":2071},{"className":2070},[],[2072],{"type":44,"value":1903},{"type":44,"value":1387},{"type":38,"tag":1069,"props":2075,"children":2076},{},[2077,2118,2150],{"type":38,"tag":1073,"props":2078,"children":2079},{},[2080,2082,2088,2090,2096,2097,2103,2104,2110,2111,2117],{"type":44,"value":2081},"macOS: ",{"type":38,"tag":47,"props":2083,"children":2085},{"className":2084},[],[2086],{"type":44,"value":2087},"~\u002FLibrary\u002FApplication Support\u002F\u003CBrowser>",{"type":44,"value":2089}," (e.g. ",{"type":38,"tag":47,"props":2091,"children":2093},{"className":2092},[],[2094],{"type":44,"value":2095},"Google\u002FChrome",{"type":44,"value":645},{"type":38,"tag":47,"props":2098,"children":2100},{"className":2099},[],[2101],{"type":44,"value":2102},"Comet",{"type":44,"value":645},{"type":38,"tag":47,"props":2105,"children":2107},{"className":2106},[],[2108],{"type":44,"value":2109},"BraveSoftware\u002FBrave-Browser",{"type":44,"value":645},{"type":38,"tag":47,"props":2112,"children":2114},{"className":2113},[],[2115],{"type":44,"value":2116},"Arc\u002FUser Data",{"type":44,"value":626},{"type":38,"tag":1073,"props":2119,"children":2120},{},[2121,2123,2129,2130,2136,2137,2143,2144,2149],{"type":44,"value":2122},"Linux: ",{"type":38,"tag":47,"props":2124,"children":2126},{"className":2125},[],[2127],{"type":44,"value":2128},"~\u002F.config\u002F\u003Cbrowser>",{"type":44,"value":2089},{"type":38,"tag":47,"props":2131,"children":2133},{"className":2132},[],[2134],{"type":44,"value":2135},"google-chrome",{"type":44,"value":645},{"type":38,"tag":47,"props":2138,"children":2140},{"className":2139},[],[2141],{"type":44,"value":2142},"chromium",{"type":44,"value":645},{"type":38,"tag":47,"props":2145,"children":2147},{"className":2146},[],[2148],{"type":44,"value":2109},{"type":44,"value":626},{"type":38,"tag":1073,"props":2151,"children":2152},{},[2153,2155,2161,2162,2168,2169,2175,2176,2182],{"type":44,"value":2154},"Windows: ",{"type":38,"tag":47,"props":2156,"children":2158},{"className":2157},[],[2159],{"type":44,"value":2160},"%LOCALAPPDATA%\\\u003CBrowser>\\User Data",{"type":44,"value":2089},{"type":38,"tag":47,"props":2163,"children":2165},{"className":2164},[],[2166],{"type":44,"value":2167},"Google\\Chrome",{"type":44,"value":645},{"type":38,"tag":47,"props":2170,"children":2172},{"className":2171},[],[2173],{"type":44,"value":2174},"Microsoft\\Edge",{"type":44,"value":645},{"type":38,"tag":47,"props":2177,"children":2179},{"className":2178},[],[2180],{"type":44,"value":2181},"BraveSoftware\\Brave-Browser",{"type":44,"value":626},{"type":38,"tag":56,"props":2184,"children":2185},{},[2186,2188,2193,2195,2200,2202,2208],{"type":44,"value":2187},"Per-candidate WS-open timeout defaults to ",{"type":38,"tag":563,"props":2189,"children":2190},{},[2191],{"type":44,"value":2192},"5s",{"type":44,"value":2194}," — live browsers answer with open\u002Fclose within ~100ms, so 5s is already generous. The only case where 5s is too short is when Chrome is showing the ",{"type":38,"tag":563,"props":2196,"children":2197},{},[2198],{"type":44,"value":2199},"Allow",{"type":44,"value":2201}," popup and waiting on the user to click. If you expect that, pass ",{"type":38,"tag":47,"props":2203,"children":2205},{"className":2204},[],[2206],{"type":44,"value":2207},"timeoutMs: 30000",{"type":44,"value":1387},{"type":38,"tag":146,"props":2210,"children":2212},{"className":1271,"code":2211,"language":1273,"meta":151,"style":151},"await session.connect({ profileDir: '\u002FUsers\u002F\u003Cyou>\u002FLibrary\u002FApplication Support\u002FGoogle\u002FChrome', timeoutMs: 30_000 })\n",[2213],{"type":38,"tag":47,"props":2214,"children":2215},{"__ignoreMap":151},[2216],{"type":38,"tag":157,"props":2217,"children":2218},{"class":159,"line":160},[2219,2223,2227,2231,2235,2239,2243,2247,2251,2255,2259,2263,2267,2272,2276,2281,2285],{"type":38,"tag":157,"props":2220,"children":2221},{"style":1291},[2222],{"type":44,"value":1294},{"type":38,"tag":157,"props":2224,"children":2225},{"style":228},[2226],{"type":44,"value":1299},{"type":38,"tag":157,"props":2228,"children":2229},{"style":191},[2230],{"type":44,"value":127},{"type":38,"tag":157,"props":2232,"children":2233},{"style":174},[2234],{"type":44,"value":1792},{"type":38,"tag":157,"props":2236,"children":2237},{"style":228},[2238],{"type":44,"value":1371},{"type":38,"tag":157,"props":2240,"children":2241},{"style":191},[2242],{"type":44,"value":1376},{"type":38,"tag":157,"props":2244,"children":2245},{"style":1379},[2246],{"type":44,"value":1980},{"type":38,"tag":157,"props":2248,"children":2249},{"style":191},[2250],{"type":44,"value":1387},{"type":38,"tag":157,"props":2252,"children":2253},{"style":191},[2254],{"type":44,"value":506},{"type":38,"tag":157,"props":2256,"children":2257},{"style":180},[2258],{"type":44,"value":1993},{"type":38,"tag":157,"props":2260,"children":2261},{"style":191},[2262],{"type":44,"value":1401},{"type":38,"tag":157,"props":2264,"children":2265},{"style":191},[2266],{"type":44,"value":1521},{"type":38,"tag":157,"props":2268,"children":2269},{"style":1379},[2270],{"type":44,"value":2271}," timeoutMs",{"type":38,"tag":157,"props":2273,"children":2274},{"style":191},[2275],{"type":44,"value":1387},{"type":38,"tag":157,"props":2277,"children":2278},{"style":1533},[2279],{"type":44,"value":2280}," 30_000",{"type":38,"tag":157,"props":2282,"children":2283},{"style":191},[2284],{"type":44,"value":1406},{"type":38,"tag":157,"props":2286,"children":2287},{"style":228},[2288],{"type":44,"value":1411},{"type":38,"tag":56,"props":2290,"children":2291},{},[2292,2303,2305,2310,2312,2316,2318,2324],{"type":38,"tag":563,"props":2293,"children":2294},{},[2295,2297],{"type":44,"value":2296},"If you see ",{"type":38,"tag":47,"props":2298,"children":2300},{"className":2299},[],[2301],{"type":44,"value":2302},"No detected browser accepted a connection",{"type":44,"value":2304}," — the browsers have ",{"type":38,"tag":47,"props":2306,"children":2308},{"className":2307},[],[2309],{"type":44,"value":1763},{"type":44,"value":2311}," files but none are currently serving WS. Most common cause: remote-debugging is enabled but the user hasn't clicked ",{"type":38,"tag":563,"props":2313,"children":2314},{},[2315],{"type":44,"value":2199},{"type":44,"value":2317}," on the prompt yet. Tell them to click Allow, then retry (or bump ",{"type":38,"tag":47,"props":2319,"children":2321},{"className":2320},[],[2322],{"type":44,"value":2323},"timeoutMs",{"type":44,"value":1022},{"type":38,"tag":1242,"props":2326,"children":2328},{"id":2327},"picking-a-target-tab",[2329],{"type":44,"value":2330},"Picking a target (tab)",{"type":38,"tag":56,"props":2332,"children":2333},{},[2334,2336,2342,2344,2350,2352,2358,2359,2365],{"type":44,"value":2335},"After ",{"type":38,"tag":47,"props":2337,"children":2339},{"className":2338},[],[2340],{"type":44,"value":2341},"connect()",{"type":44,"value":2343},", call ",{"type":38,"tag":47,"props":2345,"children":2347},{"className":2346},[],[2348],{"type":44,"value":2349},"session.use(targetId)",{"type":44,"value":2351}," once; subsequent page-level calls (Page\u002FDOM\u002FRuntime\u002FNetwork\u002Fetc.) auto-route to that target's sessionId. ",{"type":38,"tag":47,"props":2353,"children":2355},{"className":2354},[],[2356],{"type":44,"value":2357},"Browser.*",{"type":44,"value":1145},{"type":38,"tag":47,"props":2360,"children":2362},{"className":2361},[],[2363],{"type":44,"value":2364},"Target.*",{"type":44,"value":2366}," calls always hit the browser endpoint.",{"type":38,"tag":146,"props":2368,"children":2370},{"className":1271,"code":2369,"language":1273,"meta":151,"style":151},"const tabs = await listPageTargets()                     \u002F\u002F no args; uses the connected session\nconst sid  = await session.use(tabs[0].targetId)\nawait session.Page.enable()\nawait session.Page.navigate({ url: 'https:\u002F\u002Fexample.com' })\n",[2371],{"type":38,"tag":47,"props":2372,"children":2373},{"__ignoreMap":151},[2374,2409,2466,2497],{"type":38,"tag":157,"props":2375,"children":2376},{"class":159,"line":160},[2377,2381,2386,2390,2394,2399,2404],{"type":38,"tag":157,"props":2378,"children":2379},{"style":1568},[2380],{"type":44,"value":1571},{"type":38,"tag":157,"props":2382,"children":2383},{"style":228},[2384],{"type":44,"value":2385}," tabs ",{"type":38,"tag":157,"props":2387,"children":2388},{"style":191},[2389],{"type":44,"value":1838},{"type":38,"tag":157,"props":2391,"children":2392},{"style":1291},[2393],{"type":44,"value":1595},{"type":38,"tag":157,"props":2395,"children":2396},{"style":174},[2397],{"type":44,"value":2398}," listPageTargets",{"type":38,"tag":157,"props":2400,"children":2401},{"style":228},[2402],{"type":44,"value":2403},"()                     ",{"type":38,"tag":157,"props":2405,"children":2406},{"style":164},[2407],{"type":44,"value":2408},"\u002F\u002F no args; uses the connected session\n",{"type":38,"tag":157,"props":2410,"children":2411},{"class":159,"line":170},[2412,2416,2421,2425,2429,2433,2437,2442,2447,2452,2457,2461],{"type":38,"tag":157,"props":2413,"children":2414},{"style":1568},[2415],{"type":44,"value":1571},{"type":38,"tag":157,"props":2417,"children":2418},{"style":228},[2419],{"type":44,"value":2420}," sid  ",{"type":38,"tag":157,"props":2422,"children":2423},{"style":191},[2424],{"type":44,"value":1838},{"type":38,"tag":157,"props":2426,"children":2427},{"style":1291},[2428],{"type":44,"value":1595},{"type":38,"tag":157,"props":2430,"children":2431},{"style":228},[2432],{"type":44,"value":1299},{"type":38,"tag":157,"props":2434,"children":2435},{"style":191},[2436],{"type":44,"value":127},{"type":38,"tag":157,"props":2438,"children":2439},{"style":174},[2440],{"type":44,"value":2441},"use",{"type":38,"tag":157,"props":2443,"children":2444},{"style":228},[2445],{"type":44,"value":2446},"(tabs[",{"type":38,"tag":157,"props":2448,"children":2449},{"style":1533},[2450],{"type":44,"value":2451},"0",{"type":38,"tag":157,"props":2453,"children":2454},{"style":228},[2455],{"type":44,"value":2456},"]",{"type":38,"tag":157,"props":2458,"children":2459},{"style":191},[2460],{"type":44,"value":127},{"type":38,"tag":157,"props":2462,"children":2463},{"style":228},[2464],{"type":44,"value":2465},"targetId)\n",{"type":38,"tag":157,"props":2467,"children":2468},{"class":159,"line":249},[2469,2473,2477,2481,2485,2489,2493],{"type":38,"tag":157,"props":2470,"children":2471},{"style":1291},[2472],{"type":44,"value":1294},{"type":38,"tag":157,"props":2474,"children":2475},{"style":228},[2476],{"type":44,"value":1299},{"type":38,"tag":157,"props":2478,"children":2479},{"style":191},[2480],{"type":44,"value":127},{"type":38,"tag":157,"props":2482,"children":2483},{"style":228},[2484],{"type":44,"value":1357},{"type":38,"tag":157,"props":2486,"children":2487},{"style":191},[2488],{"type":44,"value":127},{"type":38,"tag":157,"props":2490,"children":2491},{"style":174},[2492],{"type":44,"value":1317},{"type":38,"tag":157,"props":2494,"children":2495},{"style":228},[2496],{"type":44,"value":1322},{"type":38,"tag":157,"props":2498,"children":2499},{"class":159,"line":259},[2500,2504,2508,2512,2516,2520,2524,2528,2532,2536,2540,2544,2548,2552,2556],{"type":38,"tag":157,"props":2501,"children":2502},{"style":1291},[2503],{"type":44,"value":1294},{"type":38,"tag":157,"props":2505,"children":2506},{"style":228},[2507],{"type":44,"value":1299},{"type":38,"tag":157,"props":2509,"children":2510},{"style":191},[2511],{"type":44,"value":127},{"type":38,"tag":157,"props":2513,"children":2514},{"style":228},[2515],{"type":44,"value":1357},{"type":38,"tag":157,"props":2517,"children":2518},{"style":191},[2519],{"type":44,"value":127},{"type":38,"tag":157,"props":2521,"children":2522},{"style":174},[2523],{"type":44,"value":1366},{"type":38,"tag":157,"props":2525,"children":2526},{"style":228},[2527],{"type":44,"value":1371},{"type":38,"tag":157,"props":2529,"children":2530},{"style":191},[2531],{"type":44,"value":1376},{"type":38,"tag":157,"props":2533,"children":2534},{"style":1379},[2535],{"type":44,"value":1382},{"type":38,"tag":157,"props":2537,"children":2538},{"style":191},[2539],{"type":44,"value":1387},{"type":38,"tag":157,"props":2541,"children":2542},{"style":191},[2543],{"type":44,"value":506},{"type":38,"tag":157,"props":2545,"children":2546},{"style":180},[2547],{"type":44,"value":1396},{"type":38,"tag":157,"props":2549,"children":2550},{"style":191},[2551],{"type":44,"value":1401},{"type":38,"tag":157,"props":2553,"children":2554},{"style":191},[2555],{"type":44,"value":1406},{"type":38,"tag":157,"props":2557,"children":2558},{"style":228},[2559],{"type":44,"value":1411},{"type":38,"tag":56,"props":2561,"children":2562},{},[2563,2568,2570,2575,2577,2583,2585,2590,2591,2596],{"type":38,"tag":47,"props":2564,"children":2566},{"className":2565},[],[2567],{"type":44,"value":1127},{"type":44,"value":2569}," uses CDP's ",{"type":38,"tag":47,"props":2571,"children":2573},{"className":2572},[],[2574],{"type":44,"value":1135},{"type":44,"value":2576}," (not ",{"type":38,"tag":47,"props":2578,"children":2580},{"className":2579},[],[2581],{"type":44,"value":2582},"\u002Fjson",{"type":44,"value":2584},"), so it works on Chrome 144+ too. It already filters out ",{"type":38,"tag":47,"props":2586,"children":2588},{"className":2587},[],[2589],{"type":44,"value":1143},{"type":44,"value":1145},{"type":38,"tag":47,"props":2592,"children":2594},{"className":2593},[],[2595],{"type":44,"value":1151},{"type":44,"value":2597}," URLs. Equivalent raw call:",{"type":38,"tag":146,"props":2599,"children":2601},{"className":1271,"code":2600,"language":1273,"meta":151,"style":151},"const { targetInfos } = await session.Target.getTargets({})\nconst tabs = targetInfos.filter(t => t.type === 'page' && !t.url.startsWith('chrome:\u002F\u002F') && !t.url.startsWith('devtools:\u002F\u002F'))\n",[2602],{"type":38,"tag":47,"props":2603,"children":2604},{"__ignoreMap":151},[2605,2667],{"type":38,"tag":157,"props":2606,"children":2607},{"class":159,"line":160},[2608,2612,2616,2621,2625,2629,2633,2637,2641,2646,2650,2655,2659,2663],{"type":38,"tag":157,"props":2609,"children":2610},{"style":1568},[2611],{"type":44,"value":1571},{"type":38,"tag":157,"props":2613,"children":2614},{"style":191},[2615],{"type":44,"value":376},{"type":38,"tag":157,"props":2617,"children":2618},{"style":228},[2619],{"type":44,"value":2620}," targetInfos ",{"type":38,"tag":157,"props":2622,"children":2623},{"style":191},[2624],{"type":44,"value":1585},{"type":38,"tag":157,"props":2626,"children":2627},{"style":191},[2628],{"type":44,"value":1590},{"type":38,"tag":157,"props":2630,"children":2631},{"style":1291},[2632],{"type":44,"value":1595},{"type":38,"tag":157,"props":2634,"children":2635},{"style":228},[2636],{"type":44,"value":1299},{"type":38,"tag":157,"props":2638,"children":2639},{"style":191},[2640],{"type":44,"value":127},{"type":38,"tag":157,"props":2642,"children":2643},{"style":228},[2644],{"type":44,"value":2645},"Target",{"type":38,"tag":157,"props":2647,"children":2648},{"style":191},[2649],{"type":44,"value":127},{"type":38,"tag":157,"props":2651,"children":2652},{"style":174},[2653],{"type":44,"value":2654},"getTargets",{"type":38,"tag":157,"props":2656,"children":2657},{"style":228},[2658],{"type":44,"value":1371},{"type":38,"tag":157,"props":2660,"children":2661},{"style":191},[2662],{"type":44,"value":712},{"type":38,"tag":157,"props":2664,"children":2665},{"style":228},[2666],{"type":44,"value":1411},{"type":38,"tag":157,"props":2668,"children":2669},{"class":159,"line":170},[2670,2674,2678,2682,2687,2691,2696,2700,2706,2711,2716,2720,2725,2730,2734,2739,2743,2747,2752,2756,2760,2765,2769,2774,2778,2782,2786,2790,2795,2800,2804,2808,2812,2816,2820,2824,2828,2832,2836,2840],{"type":38,"tag":157,"props":2671,"children":2672},{"style":1568},[2673],{"type":44,"value":1571},{"type":38,"tag":157,"props":2675,"children":2676},{"style":228},[2677],{"type":44,"value":2385},{"type":38,"tag":157,"props":2679,"children":2680},{"style":191},[2681],{"type":44,"value":1838},{"type":38,"tag":157,"props":2683,"children":2684},{"style":228},[2685],{"type":44,"value":2686}," targetInfos",{"type":38,"tag":157,"props":2688,"children":2689},{"style":191},[2690],{"type":44,"value":127},{"type":38,"tag":157,"props":2692,"children":2693},{"style":174},[2694],{"type":44,"value":2695},"filter",{"type":38,"tag":157,"props":2697,"children":2698},{"style":228},[2699],{"type":44,"value":1371},{"type":38,"tag":157,"props":2701,"children":2703},{"style":2702},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic",[2704],{"type":44,"value":2705},"t",{"type":38,"tag":157,"props":2707,"children":2708},{"style":1568},[2709],{"type":44,"value":2710}," =>",{"type":38,"tag":157,"props":2712,"children":2713},{"style":228},[2714],{"type":44,"value":2715}," t",{"type":38,"tag":157,"props":2717,"children":2718},{"style":191},[2719],{"type":44,"value":127},{"type":38,"tag":157,"props":2721,"children":2722},{"style":228},[2723],{"type":44,"value":2724},"type ",{"type":38,"tag":157,"props":2726,"children":2727},{"style":191},[2728],{"type":44,"value":2729},"===",{"type":38,"tag":157,"props":2731,"children":2732},{"style":191},[2733],{"type":44,"value":506},{"type":38,"tag":157,"props":2735,"children":2736},{"style":180},[2737],{"type":44,"value":2738},"page",{"type":38,"tag":157,"props":2740,"children":2741},{"style":191},[2742],{"type":44,"value":1401},{"type":38,"tag":157,"props":2744,"children":2745},{"style":191},[2746],{"type":44,"value":396},{"type":38,"tag":157,"props":2748,"children":2749},{"style":191},[2750],{"type":44,"value":2751}," !",{"type":38,"tag":157,"props":2753,"children":2754},{"style":228},[2755],{"type":44,"value":2705},{"type":38,"tag":157,"props":2757,"children":2758},{"style":191},[2759],{"type":44,"value":127},{"type":38,"tag":157,"props":2761,"children":2762},{"style":228},[2763],{"type":44,"value":2764},"url",{"type":38,"tag":157,"props":2766,"children":2767},{"style":191},[2768],{"type":44,"value":127},{"type":38,"tag":157,"props":2770,"children":2771},{"style":174},[2772],{"type":44,"value":2773},"startsWith",{"type":38,"tag":157,"props":2775,"children":2776},{"style":228},[2777],{"type":44,"value":1371},{"type":38,"tag":157,"props":2779,"children":2780},{"style":191},[2781],{"type":44,"value":1401},{"type":38,"tag":157,"props":2783,"children":2784},{"style":180},[2785],{"type":44,"value":1143},{"type":38,"tag":157,"props":2787,"children":2788},{"style":191},[2789],{"type":44,"value":1401},{"type":38,"tag":157,"props":2791,"children":2792},{"style":228},[2793],{"type":44,"value":2794},") ",{"type":38,"tag":157,"props":2796,"children":2797},{"style":191},[2798],{"type":44,"value":2799},"&&",{"type":38,"tag":157,"props":2801,"children":2802},{"style":191},[2803],{"type":44,"value":2751},{"type":38,"tag":157,"props":2805,"children":2806},{"style":228},[2807],{"type":44,"value":2705},{"type":38,"tag":157,"props":2809,"children":2810},{"style":191},[2811],{"type":44,"value":127},{"type":38,"tag":157,"props":2813,"children":2814},{"style":228},[2815],{"type":44,"value":2764},{"type":38,"tag":157,"props":2817,"children":2818},{"style":191},[2819],{"type":44,"value":127},{"type":38,"tag":157,"props":2821,"children":2822},{"style":174},[2823],{"type":44,"value":2773},{"type":38,"tag":157,"props":2825,"children":2826},{"style":228},[2827],{"type":44,"value":1371},{"type":38,"tag":157,"props":2829,"children":2830},{"style":191},[2831],{"type":44,"value":1401},{"type":38,"tag":157,"props":2833,"children":2834},{"style":180},[2835],{"type":44,"value":1151},{"type":38,"tag":157,"props":2837,"children":2838},{"style":191},[2839],{"type":44,"value":1401},{"type":38,"tag":157,"props":2841,"children":2842},{"style":228},[2843],{"type":44,"value":2844},"))\n",{"type":38,"tag":56,"props":2846,"children":2847},{},[2848,2850,2856,2858,2864],{"type":44,"value":2849},"To switch tabs: ",{"type":38,"tag":47,"props":2851,"children":2853},{"className":2852},[],[2854],{"type":44,"value":2855},"session.use(otherTargetId)",{"type":44,"value":2857},". To detach: ",{"type":38,"tag":47,"props":2859,"children":2861},{"className":2860},[],[2862],{"type":44,"value":2863},"session.setActiveSession(undefined)",{"type":44,"value":127},{"type":38,"tag":1242,"props":2866,"children":2868},{"id":2867},"events",[2869],{"type":44,"value":2870},"Events",{"type":38,"tag":146,"props":2872,"children":2874},{"className":1271,"code":2873,"language":1273,"meta":151,"style":151},"\u002F\u002F Subscribe (returns an unsubscribe fn)\nconst off = session.onEvent((method, params, sessionId) => { ... })\n\n\u002F\u002F Or wait for a single matching event with optional predicate + timeout\nawait session.Network.enable()\nconst ev = await session.waitFor(\n  'Page.frameNavigated',\n  (p) => p.frame.url.includes('example.com'),\n  10_000\n)\n",[2875],{"type":38,"tag":47,"props":2876,"children":2877},{"__ignoreMap":151},[2878,2886,2971,2978,2986,3018,3056,3078,3154,3162],{"type":38,"tag":157,"props":2879,"children":2880},{"class":159,"line":160},[2881],{"type":38,"tag":157,"props":2882,"children":2883},{"style":164},[2884],{"type":44,"value":2885},"\u002F\u002F Subscribe (returns an unsubscribe fn)\n",{"type":38,"tag":157,"props":2887,"children":2888},{"class":159,"line":170},[2889,2893,2898,2902,2906,2910,2915,2919,2923,2928,2932,2937,2941,2946,2950,2954,2958,2963,2967],{"type":38,"tag":157,"props":2890,"children":2891},{"style":1568},[2892],{"type":44,"value":1571},{"type":38,"tag":157,"props":2894,"children":2895},{"style":228},[2896],{"type":44,"value":2897}," off ",{"type":38,"tag":157,"props":2899,"children":2900},{"style":191},[2901],{"type":44,"value":1838},{"type":38,"tag":157,"props":2903,"children":2904},{"style":228},[2905],{"type":44,"value":1299},{"type":38,"tag":157,"props":2907,"children":2908},{"style":191},[2909],{"type":44,"value":127},{"type":38,"tag":157,"props":2911,"children":2912},{"style":174},[2913],{"type":44,"value":2914},"onEvent",{"type":38,"tag":157,"props":2916,"children":2917},{"style":228},[2918],{"type":44,"value":1371},{"type":38,"tag":157,"props":2920,"children":2921},{"style":191},[2922],{"type":44,"value":1371},{"type":38,"tag":157,"props":2924,"children":2925},{"style":2702},[2926],{"type":44,"value":2927},"method",{"type":38,"tag":157,"props":2929,"children":2930},{"style":191},[2931],{"type":44,"value":1521},{"type":38,"tag":157,"props":2933,"children":2934},{"style":2702},[2935],{"type":44,"value":2936}," params",{"type":38,"tag":157,"props":2938,"children":2939},{"style":191},[2940],{"type":44,"value":1521},{"type":38,"tag":157,"props":2942,"children":2943},{"style":2702},[2944],{"type":44,"value":2945}," sessionId",{"type":38,"tag":157,"props":2947,"children":2948},{"style":191},[2949],{"type":44,"value":626},{"type":38,"tag":157,"props":2951,"children":2952},{"style":1568},[2953],{"type":44,"value":2710},{"type":38,"tag":157,"props":2955,"children":2956},{"style":191},[2957],{"type":44,"value":376},{"type":38,"tag":157,"props":2959,"children":2960},{"style":191},[2961],{"type":44,"value":2962}," ...",{"type":38,"tag":157,"props":2964,"children":2965},{"style":191},[2966],{"type":44,"value":1406},{"type":38,"tag":157,"props":2968,"children":2969},{"style":228},[2970],{"type":44,"value":1411},{"type":38,"tag":157,"props":2972,"children":2973},{"class":159,"line":249},[2974],{"type":38,"tag":157,"props":2975,"children":2976},{"emptyLinePlaceholder":253},[2977],{"type":44,"value":256},{"type":38,"tag":157,"props":2979,"children":2980},{"class":159,"line":259},[2981],{"type":38,"tag":157,"props":2982,"children":2983},{"style":164},[2984],{"type":44,"value":2985},"\u002F\u002F Or wait for a single matching event with optional predicate + timeout\n",{"type":38,"tag":157,"props":2987,"children":2988},{"class":159,"line":268},[2989,2993,2997,3001,3006,3010,3014],{"type":38,"tag":157,"props":2990,"children":2991},{"style":1291},[2992],{"type":44,"value":1294},{"type":38,"tag":157,"props":2994,"children":2995},{"style":228},[2996],{"type":44,"value":1299},{"type":38,"tag":157,"props":2998,"children":2999},{"style":191},[3000],{"type":44,"value":127},{"type":38,"tag":157,"props":3002,"children":3003},{"style":228},[3004],{"type":44,"value":3005},"Network",{"type":38,"tag":157,"props":3007,"children":3008},{"style":191},[3009],{"type":44,"value":127},{"type":38,"tag":157,"props":3011,"children":3012},{"style":174},[3013],{"type":44,"value":1317},{"type":38,"tag":157,"props":3015,"children":3016},{"style":228},[3017],{"type":44,"value":1322},{"type":38,"tag":157,"props":3019,"children":3020},{"class":159,"line":329},[3021,3025,3030,3034,3038,3042,3046,3051],{"type":38,"tag":157,"props":3022,"children":3023},{"style":1568},[3024],{"type":44,"value":1571},{"type":38,"tag":157,"props":3026,"children":3027},{"style":228},[3028],{"type":44,"value":3029}," ev ",{"type":38,"tag":157,"props":3031,"children":3032},{"style":191},[3033],{"type":44,"value":1838},{"type":38,"tag":157,"props":3035,"children":3036},{"style":1291},[3037],{"type":44,"value":1595},{"type":38,"tag":157,"props":3039,"children":3040},{"style":228},[3041],{"type":44,"value":1299},{"type":38,"tag":157,"props":3043,"children":3044},{"style":191},[3045],{"type":44,"value":127},{"type":38,"tag":157,"props":3047,"children":3048},{"style":174},[3049],{"type":44,"value":3050},"waitFor",{"type":38,"tag":157,"props":3052,"children":3053},{"style":228},[3054],{"type":44,"value":3055},"(\n",{"type":38,"tag":157,"props":3057,"children":3058},{"class":159,"line":337},[3059,3064,3069,3073],{"type":38,"tag":157,"props":3060,"children":3061},{"style":191},[3062],{"type":44,"value":3063},"  '",{"type":38,"tag":157,"props":3065,"children":3066},{"style":180},[3067],{"type":44,"value":3068},"Page.frameNavigated",{"type":38,"tag":157,"props":3070,"children":3071},{"style":191},[3072],{"type":44,"value":1401},{"type":38,"tag":157,"props":3074,"children":3075},{"style":191},[3076],{"type":44,"value":3077},",\n",{"type":38,"tag":157,"props":3079,"children":3080},{"class":159,"line":346},[3081,3086,3090,3094,3098,3103,3107,3112,3116,3120,3124,3129,3133,3137,3142,3146,3150],{"type":38,"tag":157,"props":3082,"children":3083},{"style":191},[3084],{"type":44,"value":3085},"  (",{"type":38,"tag":157,"props":3087,"children":3088},{"style":2702},[3089],{"type":44,"value":56},{"type":38,"tag":157,"props":3091,"children":3092},{"style":191},[3093],{"type":44,"value":626},{"type":38,"tag":157,"props":3095,"children":3096},{"style":1568},[3097],{"type":44,"value":2710},{"type":38,"tag":157,"props":3099,"children":3100},{"style":228},[3101],{"type":44,"value":3102}," p",{"type":38,"tag":157,"props":3104,"children":3105},{"style":191},[3106],{"type":44,"value":127},{"type":38,"tag":157,"props":3108,"children":3109},{"style":228},[3110],{"type":44,"value":3111},"frame",{"type":38,"tag":157,"props":3113,"children":3114},{"style":191},[3115],{"type":44,"value":127},{"type":38,"tag":157,"props":3117,"children":3118},{"style":228},[3119],{"type":44,"value":2764},{"type":38,"tag":157,"props":3121,"children":3122},{"style":191},[3123],{"type":44,"value":127},{"type":38,"tag":157,"props":3125,"children":3126},{"style":174},[3127],{"type":44,"value":3128},"includes",{"type":38,"tag":157,"props":3130,"children":3131},{"style":228},[3132],{"type":44,"value":1371},{"type":38,"tag":157,"props":3134,"children":3135},{"style":191},[3136],{"type":44,"value":1401},{"type":38,"tag":157,"props":3138,"children":3139},{"style":180},[3140],{"type":44,"value":3141},"example.com",{"type":38,"tag":157,"props":3143,"children":3144},{"style":191},[3145],{"type":44,"value":1401},{"type":38,"tag":157,"props":3147,"children":3148},{"style":228},[3149],{"type":44,"value":626},{"type":38,"tag":157,"props":3151,"children":3152},{"style":191},[3153],{"type":44,"value":3077},{"type":38,"tag":157,"props":3155,"children":3156},{"class":159,"line":1461},[3157],{"type":38,"tag":157,"props":3158,"children":3159},{"style":1533},[3160],{"type":44,"value":3161},"  10_000\n",{"type":38,"tag":157,"props":3163,"children":3164},{"class":159,"line":1547},[3165],{"type":38,"tag":157,"props":3166,"children":3167},{"style":228},[3168],{"type":44,"value":1411},{"type":38,"tag":1242,"props":3170,"children":3172},{"id":3171},"persisting-state-across-calls",[3173],{"type":44,"value":3174},"Persisting state across calls",{"type":38,"tag":56,"props":3176,"children":3177},{},[3178,3180,3186,3188,3193,3195,3201],{"type":44,"value":3179},"Each snippet runs inside its own async wrapper, so its ",{"type":38,"tag":47,"props":3181,"children":3183},{"className":3182},[],[3184],{"type":44,"value":3185},"let",{"type":44,"value":3187},"\u002F",{"type":38,"tag":47,"props":3189,"children":3191},{"className":3190},[],[3192],{"type":44,"value":1571},{"type":44,"value":3194}," declarations vanish when it returns. To carry data forward, attach to ",{"type":38,"tag":47,"props":3196,"children":3198},{"className":3197},[],[3199],{"type":44,"value":3200},"globalThis",{"type":44,"value":1387},{"type":38,"tag":146,"props":3203,"children":3205},{"className":148,"code":3204,"language":150,"meta":151,"style":151},"browser-harness-js '(await listPageTargets()).forEach((t,i)=>globalThis[\"tab\"+i]=t.targetId)'\nbrowser-harness-js 'await session.use(globalThis.tab0)'\nbrowser-harness-js 'await session.Page.navigate({url:\"https:\u002F\u002Fexample.com\"})'\n",[3206],{"type":38,"tag":47,"props":3207,"children":3208},{"__ignoreMap":151},[3209,3229,3249],{"type":38,"tag":157,"props":3210,"children":3211},{"class":159,"line":160},[3212,3216,3220,3225],{"type":38,"tag":157,"props":3213,"children":3214},{"style":207},[3215],{"type":44,"value":52},{"type":38,"tag":157,"props":3217,"children":3218},{"style":191},[3219],{"type":44,"value":506},{"type":38,"tag":157,"props":3221,"children":3222},{"style":180},[3223],{"type":44,"value":3224},"(await listPageTargets()).forEach((t,i)=>globalThis[\"tab\"+i]=t.targetId)",{"type":38,"tag":157,"props":3226,"children":3227},{"style":191},[3228],{"type":44,"value":516},{"type":38,"tag":157,"props":3230,"children":3231},{"class":159,"line":170},[3232,3236,3240,3245],{"type":38,"tag":157,"props":3233,"children":3234},{"style":207},[3235],{"type":44,"value":52},{"type":38,"tag":157,"props":3237,"children":3238},{"style":191},[3239],{"type":44,"value":506},{"type":38,"tag":157,"props":3241,"children":3242},{"style":180},[3243],{"type":44,"value":3244},"await session.use(globalThis.tab0)",{"type":38,"tag":157,"props":3246,"children":3247},{"style":191},[3248],{"type":44,"value":516},{"type":38,"tag":157,"props":3250,"children":3251},{"class":159,"line":249},[3252,3256,3260,3264],{"type":38,"tag":157,"props":3253,"children":3254},{"style":207},[3255],{"type":44,"value":52},{"type":38,"tag":157,"props":3257,"children":3258},{"style":191},[3259],{"type":44,"value":506},{"type":38,"tag":157,"props":3261,"children":3262},{"style":180},[3263],{"type":44,"value":532},{"type":38,"tag":157,"props":3265,"children":3266},{"style":191},[3267],{"type":44,"value":516},{"type":38,"tag":56,"props":3269,"children":3270},{},[3271,3276],{"type":38,"tag":47,"props":3272,"children":3274},{"className":3273},[],[3275],{"type":44,"value":485},{"type":44,"value":3277}," itself, the active sessionId, and event subscribers are already preserved by the server — globals are only needed for ad-hoc data.",{"type":38,"tag":129,"props":3279,"children":3281},{"id":3280},"connecting-to-a-running-chrome-chromeinspect-flow",[3282],{"type":44,"value":3283},"Connecting to a running Chrome (chrome:\u002F\u002Finspect flow)",{"type":38,"tag":56,"props":3285,"children":3286},{},[3287],{"type":44,"value":3288},"When attaching to the user's already-running browser:",{"type":38,"tag":3290,"props":3291,"children":3292},"ol",{},[3293,3317,3458,3474,3499],{"type":38,"tag":1073,"props":3294,"children":3295},{},[3296,3308,3310,3315],{"type":38,"tag":563,"props":3297,"children":3298},{},[3299,3301,3306],{"type":44,"value":3300},"Try ",{"type":38,"tag":47,"props":3302,"children":3304},{"className":3303},[],[3305],{"type":44,"value":511},{"type":44,"value":3307}," first",{"type":44,"value":3309}," (no args) — auto-detect handles every Chromium-based browser via ",{"type":38,"tag":47,"props":3311,"children":3313},{"className":3312},[],[3314],{"type":44,"value":1763},{"type":44,"value":3316},". If it returns, you're done.",{"type":38,"tag":1073,"props":3318,"children":3319},{},[3320,3325,3327,3333,3335,3456],{"type":38,"tag":563,"props":3321,"children":3322},{},[3323],{"type":44,"value":3324},"If auto-detect fails",{"type":44,"value":3326}," with ",{"type":38,"tag":47,"props":3328,"children":3330},{"className":3329},[],[3331],{"type":44,"value":3332},"No running browser with remote debugging detected",{"type":44,"value":3334},", the user needs to turn it on. Open the inspect page:\n",{"type":38,"tag":146,"props":3336,"children":3338},{"className":148,"code":3337,"language":150,"meta":151,"style":151},"# macOS — prefer AppleScript over `open -a` (reuses current profile, avoids the profile picker)\nosascript -e 'open location \"chrome:\u002F\u002Finspect\u002F#remote-debugging\"'\n\n# Linux\ngoogle-chrome 'chrome:\u002F\u002Finspect\u002F#remote-debugging'     # or: chromium, google-chrome-stable\n\n# Windows (PowerShell)\nStart-Process chrome 'chrome:\u002F\u002Finspect\u002F#remote-debugging'\n",[3339],{"type":38,"tag":47,"props":3340,"children":3341},{"__ignoreMap":151},[3342,3350,3376,3383,3391,3416,3423,3431],{"type":38,"tag":157,"props":3343,"children":3344},{"class":159,"line":160},[3345],{"type":38,"tag":157,"props":3346,"children":3347},{"style":164},[3348],{"type":44,"value":3349},"# macOS — prefer AppleScript over `open -a` (reuses current profile, avoids the profile picker)\n",{"type":38,"tag":157,"props":3351,"children":3352},{"class":159,"line":170},[3353,3358,3363,3367,3372],{"type":38,"tag":157,"props":3354,"children":3355},{"style":207},[3356],{"type":44,"value":3357},"osascript",{"type":38,"tag":157,"props":3359,"children":3360},{"style":180},[3361],{"type":44,"value":3362}," -e",{"type":38,"tag":157,"props":3364,"children":3365},{"style":191},[3366],{"type":44,"value":506},{"type":38,"tag":157,"props":3368,"children":3369},{"style":180},[3370],{"type":44,"value":3371},"open location \"chrome:\u002F\u002Finspect\u002F#remote-debugging\"",{"type":38,"tag":157,"props":3373,"children":3374},{"style":191},[3375],{"type":44,"value":516},{"type":38,"tag":157,"props":3377,"children":3378},{"class":159,"line":249},[3379],{"type":38,"tag":157,"props":3380,"children":3381},{"emptyLinePlaceholder":253},[3382],{"type":44,"value":256},{"type":38,"tag":157,"props":3384,"children":3385},{"class":159,"line":259},[3386],{"type":38,"tag":157,"props":3387,"children":3388},{"style":164},[3389],{"type":44,"value":3390},"# Linux\n",{"type":38,"tag":157,"props":3392,"children":3393},{"class":159,"line":268},[3394,3398,3402,3407,3411],{"type":38,"tag":157,"props":3395,"children":3396},{"style":207},[3397],{"type":44,"value":2135},{"type":38,"tag":157,"props":3399,"children":3400},{"style":191},[3401],{"type":44,"value":506},{"type":38,"tag":157,"props":3403,"children":3404},{"style":180},[3405],{"type":44,"value":3406},"chrome:\u002F\u002Finspect\u002F#remote-debugging",{"type":38,"tag":157,"props":3408,"children":3409},{"style":191},[3410],{"type":44,"value":1401},{"type":38,"tag":157,"props":3412,"children":3413},{"style":164},[3414],{"type":44,"value":3415},"     # or: chromium, google-chrome-stable\n",{"type":38,"tag":157,"props":3417,"children":3418},{"class":159,"line":329},[3419],{"type":38,"tag":157,"props":3420,"children":3421},{"emptyLinePlaceholder":253},[3422],{"type":44,"value":256},{"type":38,"tag":157,"props":3424,"children":3425},{"class":159,"line":337},[3426],{"type":38,"tag":157,"props":3427,"children":3428},{"style":164},[3429],{"type":44,"value":3430},"# Windows (PowerShell)\n",{"type":38,"tag":157,"props":3432,"children":3433},{"class":159,"line":346},[3434,3439,3444,3448,3452],{"type":38,"tag":157,"props":3435,"children":3436},{"style":207},[3437],{"type":44,"value":3438},"Start-Process",{"type":38,"tag":157,"props":3440,"children":3441},{"style":180},[3442],{"type":44,"value":3443}," chrome",{"type":38,"tag":157,"props":3445,"children":3446},{"style":191},[3447],{"type":44,"value":506},{"type":38,"tag":157,"props":3449,"children":3450},{"style":180},[3451],{"type":44,"value":3406},{"type":38,"tag":157,"props":3453,"children":3454},{"style":191},[3455],{"type":44,"value":516},{"type":44,"value":3457},"\nOnly macOS's AppleScript path avoids the profile picker; Linux\u002FWindows may prompt the user to pick a profile first.",{"type":38,"tag":1073,"props":3459,"children":3460},{},[3461,3466,3468,3472],{"type":38,"tag":563,"props":3462,"children":3463},{},[3464],{"type":44,"value":3465},"Tick \"Discover network targets\"",{"type":44,"value":3467}," in chrome:\u002F\u002Finspect, then click ",{"type":38,"tag":563,"props":3469,"children":3470},{},[3471],{"type":44,"value":2199},{"type":44,"value":3473}," when Chrome prompts.",{"type":38,"tag":1073,"props":3475,"children":3476},{},[3477,3482,3484,3490,3492,3498],{"type":38,"tag":563,"props":3478,"children":3479},{},[3480],{"type":44,"value":3481},"If auto-detect picks the wrong browser",{"type":44,"value":3483}," (multiple running, you want a specific one): list them with ",{"type":38,"tag":47,"props":3485,"children":3487},{"className":3486},[],[3488],{"type":44,"value":3489},"await detectBrowsers()",{"type":44,"value":3491},", then ",{"type":38,"tag":47,"props":3493,"children":3495},{"className":3494},[],[3496],{"type":44,"value":3497},"await session.connect({ profileDir: \u003Cthe one you want> })",{"type":44,"value":127},{"type":38,"tag":1073,"props":3500,"children":3501},{},[3502,3519,3521,3525,3527,3532],{"type":38,"tag":563,"props":3503,"children":3504},{},[3505,3507,3512,3514],{"type":44,"value":3506},"If ",{"type":38,"tag":47,"props":3508,"children":3510},{"className":3509},[],[3511],{"type":44,"value":1212},{"type":44,"value":3513}," returns ",{"type":38,"tag":47,"props":3515,"children":3517},{"className":3516},[],[3518],{"type":44,"value":2302},{"type":44,"value":3520},", the user has remote-debugging on but hasn't clicked ",{"type":38,"tag":563,"props":3522,"children":3523},{},[3524],{"type":44,"value":2199},{"type":44,"value":3526}," yet. Tell them to click it and retry, or pass ",{"type":38,"tag":47,"props":3528,"children":3530},{"className":3529},[],[3531],{"type":44,"value":2207},{"type":44,"value":3533}," to wait for the click.",{"type":38,"tag":129,"props":3535,"children":3537},{"id":3536},"working-with-targets-tabs",[3538],{"type":44,"value":3539},"Working with targets (tabs)",{"type":38,"tag":1069,"props":3541,"children":3542},{},[3543,3581],{"type":38,"tag":1073,"props":3544,"children":3545},{},[3546,3551,3553,3558,3560,3565,3566,3571,3573,3579],{"type":38,"tag":563,"props":3547,"children":3548},{},[3549],{"type":44,"value":3550},"Filter Chrome internals.",{"type":44,"value":3552}," ",{"type":38,"tag":47,"props":3554,"children":3556},{"className":3555},[],[3557],{"type":44,"value":1127},{"type":44,"value":3559}," already drops ",{"type":38,"tag":47,"props":3561,"children":3563},{"className":3562},[],[3564],{"type":44,"value":1143},{"type":44,"value":1145},{"type":38,"tag":47,"props":3567,"children":3569},{"className":3568},[],[3570],{"type":44,"value":1151},{"type":44,"value":3572}," URLs. If you call ",{"type":38,"tag":47,"props":3574,"children":3576},{"className":3575},[],[3577],{"type":44,"value":3578},"Target.getTargets()",{"type":44,"value":3580}," directly, filter manually.",{"type":38,"tag":1073,"props":3582,"children":3583},{},[3584,3589,3591,3597],{"type":38,"tag":563,"props":3585,"children":3586},{},[3587],{"type":44,"value":3588},"CDP target order ≠ visible tab-strip order.",{"type":44,"value":3590}," When the user says \"the first tab I can see\", use a screenshot or page title to identify it — ",{"type":38,"tag":47,"props":3592,"children":3594},{"className":3593},[],[3595],{"type":44,"value":3596},"Target.activateTarget",{"type":44,"value":3598}," only switches to a known targetId.",{"type":38,"tag":129,"props":3600,"children":3602},{"id":3601},"looking-up-a-method",[3603],{"type":44,"value":3604},"Looking up a method",{"type":38,"tag":56,"props":3606,"children":3607},{},[3608,3610,3616,3618,3624,3625,3631],{"type":44,"value":3609},"The full typed surface is in ",{"type":38,"tag":47,"props":3611,"children":3613},{"className":3612},[],[3614],{"type":44,"value":3615},"\u003Cskill-dir>\u002Fsdk\u002Fgenerated.ts",{"type":44,"value":3617}," (~655 KB, only loaded if you read it). Each method has its CDP description as a JSDoc comment plus typed ",{"type":38,"tag":47,"props":3619,"children":3621},{"className":3620},[],[3622],{"type":44,"value":3623},"*Params",{"type":44,"value":692},{"type":38,"tag":47,"props":3626,"children":3628},{"className":3627},[],[3629],{"type":44,"value":3630},"*Return",{"type":44,"value":3632}," interfaces in per-domain namespaces.",{"type":38,"tag":146,"props":3634,"children":3636},{"className":148,"code":3635,"language":150,"meta":151,"style":151},"grep -n \"navigate\" \u003Cskill-dir>\u002Fsdk\u002Fgenerated.ts | head\n",[3637],{"type":38,"tag":47,"props":3638,"children":3639},{"__ignoreMap":151},[3640],{"type":38,"tag":157,"props":3641,"children":3642},{"class":159,"line":160},[3643,3648,3653,3658,3662,3667,3671,3675,3679,3683,3688,3693],{"type":38,"tag":157,"props":3644,"children":3645},{"style":207},[3646],{"type":44,"value":3647},"grep",{"type":38,"tag":157,"props":3649,"children":3650},{"style":180},[3651],{"type":44,"value":3652}," -n",{"type":38,"tag":157,"props":3654,"children":3655},{"style":191},[3656],{"type":44,"value":3657}," \"",{"type":38,"tag":157,"props":3659,"children":3660},{"style":180},[3661],{"type":44,"value":1366},{"type":38,"tag":157,"props":3663,"children":3664},{"style":191},[3665],{"type":44,"value":3666},"\"",{"type":38,"tag":157,"props":3668,"children":3669},{"style":191},[3670],{"type":44,"value":220},{"type":38,"tag":157,"props":3672,"children":3673},{"style":180},[3674],{"type":44,"value":225},{"type":38,"tag":157,"props":3676,"children":3677},{"style":228},[3678],{"type":44,"value":231},{"type":38,"tag":157,"props":3680,"children":3681},{"style":191},[3682],{"type":44,"value":236},{"type":38,"tag":157,"props":3684,"children":3685},{"style":180},[3686],{"type":44,"value":3687},"\u002Fsdk\u002Fgenerated.ts",{"type":38,"tag":157,"props":3689,"children":3690},{"style":191},[3691],{"type":44,"value":3692}," |",{"type":38,"tag":157,"props":3694,"children":3695},{"style":207},[3696],{"type":44,"value":3697}," head\n",{"type":38,"tag":129,"props":3699,"children":3701},{"id":3700},"regenerating-the-sdk",[3702],{"type":44,"value":3703},"Regenerating the SDK",{"type":38,"tag":56,"props":3705,"children":3706},{},[3707,3709,3715,3717,3723],{"type":44,"value":3708},"When the upstream protocol JSONs change, replace ",{"type":38,"tag":47,"props":3710,"children":3712},{"className":3711},[],[3713],{"type":44,"value":3714},"sdk\u002Fbrowser_protocol.json",{"type":44,"value":3716}," and\u002For ",{"type":38,"tag":47,"props":3718,"children":3720},{"className":3719},[],[3721],{"type":44,"value":3722},"sdk\u002Fjs_protocol.json",{"type":44,"value":3724}," and re-run:",{"type":38,"tag":146,"props":3726,"children":3728},{"className":148,"code":3727,"language":150,"meta":151,"style":151},"cd \u003Cskill-dir>\u002Fsdk && bun gen.ts\nbrowser-harness-js --restart   # pick up the new bindings\n",[3729],{"type":38,"tag":47,"props":3730,"children":3731},{"__ignoreMap":151},[3732,3775],{"type":38,"tag":157,"props":3733,"children":3734},{"class":159,"line":160},[3735,3740,3744,3748,3752,3756,3761,3765,3770],{"type":38,"tag":157,"props":3736,"children":3737},{"style":174},[3738],{"type":44,"value":3739},"cd",{"type":38,"tag":157,"props":3741,"children":3742},{"style":191},[3743],{"type":44,"value":220},{"type":38,"tag":157,"props":3745,"children":3746},{"style":180},[3747],{"type":44,"value":225},{"type":38,"tag":157,"props":3749,"children":3750},{"style":228},[3751],{"type":44,"value":231},{"type":38,"tag":157,"props":3753,"children":3754},{"style":191},[3755],{"type":44,"value":236},{"type":38,"tag":157,"props":3757,"children":3758},{"style":180},[3759],{"type":44,"value":3760},"\u002Fsdk",{"type":38,"tag":157,"props":3762,"children":3763},{"style":191},[3764],{"type":44,"value":396},{"type":38,"tag":157,"props":3766,"children":3767},{"style":207},[3768],{"type":44,"value":3769}," bun",{"type":38,"tag":157,"props":3771,"children":3772},{"style":180},[3773],{"type":44,"value":3774}," gen.ts\n",{"type":38,"tag":157,"props":3776,"children":3777},{"class":159,"line":170},[3778,3782,3787],{"type":38,"tag":157,"props":3779,"children":3780},{"style":207},[3781],{"type":44,"value":52},{"type":38,"tag":157,"props":3783,"children":3784},{"style":180},[3785],{"type":44,"value":3786}," --restart",{"type":38,"tag":157,"props":3788,"children":3789},{"style":164},[3790],{"type":44,"value":3791},"   # pick up the new bindings\n",{"type":38,"tag":129,"props":3793,"children":3795},{"id":3794},"files",[3796],{"type":44,"value":3797},"Files",{"type":38,"tag":56,"props":3799,"children":3800},{},[3801,3803,3808],{"type":44,"value":3802},"All paths are relative to ",{"type":38,"tag":47,"props":3804,"children":3806},{"className":3805},[],[3807],{"type":44,"value":94},{"type":44,"value":3809}," (the install path — see top of this doc).",{"type":38,"tag":1069,"props":3811,"children":3812},{},[3813,3832,3858,3876,3887,3898],{"type":38,"tag":1073,"props":3814,"children":3815},{},[3816,3822,3824,3830],{"type":38,"tag":47,"props":3817,"children":3819},{"className":3818},[],[3820],{"type":44,"value":3821},"\u002Fusr\u002Flocal\u002Fbin\u002Fbrowser-harness-js",{"type":44,"value":3823}," → ",{"type":38,"tag":47,"props":3825,"children":3827},{"className":3826},[],[3828],{"type":44,"value":3829},"\u003Cskill-dir>\u002Fsdk\u002Fbrowser-harness-js",{"type":44,"value":3831}," (the CLI)",{"type":38,"tag":1073,"props":3833,"children":3834},{},[3835,3841,3843,3849,3851,3857],{"type":38,"tag":47,"props":3836,"children":3838},{"className":3837},[],[3839],{"type":44,"value":3840},"sdk\u002Frepl.ts",{"type":44,"value":3842}," — HTTP server (",{"type":38,"tag":47,"props":3844,"children":3846},{"className":3845},[],[3847],{"type":44,"value":3848},"Bun.serve",{"type":44,"value":3850}," on ",{"type":38,"tag":47,"props":3852,"children":3854},{"className":3853},[],[3855],{"type":44,"value":3856},"127.0.0.1:9876",{"type":44,"value":626},{"type":38,"tag":1073,"props":3859,"children":3860},{},[3861,3867,3869,3874],{"type":38,"tag":47,"props":3862,"children":3864},{"className":3863},[],[3865],{"type":44,"value":3866},"sdk\u002Fsession.ts",{"type":44,"value":3868}," — ",{"type":38,"tag":47,"props":3870,"children":3872},{"className":3871},[],[3873],{"type":44,"value":66},{"type":44,"value":3875}," class (transport, connect, target routing, events)",{"type":38,"tag":1073,"props":3877,"children":3878},{},[3879,3885],{"type":38,"tag":47,"props":3880,"children":3882},{"className":3881},[],[3883],{"type":44,"value":3884},"sdk\u002Fgenerated.ts",{"type":44,"value":3886}," — codegen output: every CDP method as a typed wrapper",{"type":38,"tag":1073,"props":3888,"children":3889},{},[3890,3896],{"type":38,"tag":47,"props":3891,"children":3893},{"className":3892},[],[3894],{"type":44,"value":3895},"sdk\u002Fgen.ts",{"type":44,"value":3897}," — codegen script",{"type":38,"tag":1073,"props":3899,"children":3900},{},[3901,3907],{"type":38,"tag":47,"props":3902,"children":3904},{"className":3903},[],[3905],{"type":44,"value":3906},"sdk\u002F{browser,js}_protocol.json",{"type":44,"value":3908}," — upstream protocol (vendored)",{"type":38,"tag":3910,"props":3911,"children":3912},"style",{},[3913],{"type":44,"value":3914},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":3916,"total":160},[3917],{"slug":4,"name":4,"fn":5,"description":6,"org":3918,"tags":3919,"stars":22,"repoUrl":23,"updatedAt":24},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3920,3921,3922],{"name":20,"slug":21,"type":15},{"name":13,"slug":14,"type":15},{"name":17,"slug":18,"type":15},{"items":3924,"total":1623},[3925,3940,3954,3964,3975,3994,4015,4028,4045,4051,4075,4086],{"slug":8,"name":8,"fn":3926,"description":3927,"org":3928,"tags":3929,"stars":3937,"repoUrl":3938,"updatedAt":3939},"automate browser interactions","Direct browser control via CDP for web interaction: automation, scraping, testing, screenshots, and site\u002Fapp work.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3930,3933,3934],{"name":3931,"slug":3932,"type":15},"Automation","automation",{"name":20,"slug":21,"type":15},{"name":3935,"slug":3936,"type":15},"Web Scraping","web-scraping",106789,"https:\u002F\u002Fgithub.com\u002Fbrowser-use\u002Fbrowser-use","2026-07-28T05:35:58.143842",{"slug":3941,"name":3941,"fn":3942,"description":3943,"org":3944,"tags":3945,"stars":3937,"repoUrl":3938,"updatedAt":3953},"cloud","use Browser Use Cloud API","Documentation reference for using Browser Use Cloud — the hosted API and SDK for browser automation. Use this skill whenever the user needs help with the Cloud REST API (v2 or v3), browser-use-sdk (Python or TypeScript), X-Browser-Use-API-Key authentication, cloud sessions, browser profiles, profile sync, CDP WebSocket connections, stealth browsers, residential proxies, CAPTCHA handling, webhooks, workspaces, skills marketplace, liveUrl streaming, pricing, or integration patterns (chat UI, subagent, adding browser tools to existing agents). Also trigger for questions about n8n\u002FMake\u002FZapier integration, Playwright\u002F Puppeteer\u002FSelenium on cloud infrastructure, or 1Password vault integration. Do NOT use this for the open-source Python library (Agent, Browser, Tools config) — use the open-source skill instead.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3946,3947,3950],{"name":20,"slug":21,"type":15},{"name":3948,"slug":3949,"type":15},"Python","python",{"name":3951,"slug":3952,"type":15},"REST API","rest-api","2026-04-06T18:06:10.225871",{"slug":3955,"name":3955,"fn":3956,"description":3957,"org":3958,"tags":3959,"stars":3937,"repoUrl":3938,"updatedAt":3963},"open-source","write browser-use Python code","Documentation reference for writing Python code using the browser-use open-source library. Use this skill whenever the user needs help with Agent, Browser, or Tools configuration, is writing code that imports from browser_use, asks about @sandbox deployment, supported LLM models, Actor API, custom tools, lifecycle hooks, MCP server setup, or monitoring\u002Fobservability with Laminar or OpenLIT. Also trigger for questions about browser-use installation, prompting strategies, or sensitive data handling. Do NOT use this for Cloud API\u002FSDK usage or pricing — use the cloud skill instead. Do NOT use this for directly automating a browser via CLI commands — use the browser-use skill instead.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3960,3961,3962],{"name":3931,"slug":3932,"type":15},{"name":20,"slug":21,"type":15},{"name":3948,"slug":3949,"type":15},"2026-04-06T18:06:14.102374",{"slug":3965,"name":3965,"fn":3966,"description":3967,"org":3968,"tags":3969,"stars":3937,"repoUrl":3938,"updatedAt":3974},"remote-browser","control a local browser from a sandbox","Controls a local browser from a sandboxed remote machine. Use when the agent is running in a sandbox (no GUI) and needs to navigate websites, interact with web pages, fill forms, take screenshots, or expose local dev servers via tunnels.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3970,3971],{"name":20,"slug":21,"type":15},{"name":3972,"slug":3973,"type":15},"Sandboxing","sandboxing","2026-04-06T18:06:12.842351",{"slug":3976,"name":3976,"fn":3977,"description":3978,"org":3979,"tags":3980,"stars":3937,"repoUrl":3938,"updatedAt":3993},"x402","configure x402 payments for Browser Use Cloud","Set up Browser Use Cloud payments with x402 — pay per request from a crypto wallet (USDC on Base mainnet), no signup or API key. Two setups it works out up front — \"just use it\" (set up a wallet so you or Claude Code can run cloud browser tasks paid from the wallet — Claude writes and runs throwaway scripts, nothing touches your codebase) or \"build it in\" (install the SDK and write the key + code into your project). Walks through wallet setup, funding, .env, and a ~$1 test run. Use when the user asks about x402, pay-per-use, USDC payments, or wants Browser Use Cloud without an API key. For the free-tier signup (reverse-CAPTCHA → API key), use `browser-use cloud signup` or the `cloud` skill instead.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3981,3982,3985,3986,3989,3992],{"name":3931,"slug":3932,"type":15},{"name":3983,"slug":3984,"type":15},"Base","base",{"name":20,"slug":21,"type":15},{"name":3987,"slug":3988,"type":15},"Payments","payments",{"name":3990,"slug":3991,"type":15},"Web3","web3",{"name":3976,"slug":3976,"type":15},"2026-06-02T07:51:20.889935",{"slug":3995,"name":3995,"fn":3996,"description":3997,"org":3998,"tags":3999,"stars":4012,"repoUrl":4013,"updatedAt":4014},"manim-video","create technical animations with Manim","Production pipeline for mathematical and technical animations using Manim Community Edition. Creates 3Blue1Brown-style explainer videos, algorithm visualizations, equation derivations, architecture diagrams, and data stories. Use when users request: animated explanations, math animations, concept visualizations, algorithm walkthroughs, technical explainers, 3Blue1Brown style videos, or any programmatic animation with geometric\u002Fmathematical content.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[4000,4003,4006,4009],{"name":4001,"slug":4002,"type":15},"Animation","animation",{"name":4004,"slug":4005,"type":15},"Creative","creative",{"name":4007,"slug":4008,"type":15},"Mathematics","mathematics",{"name":4010,"slug":4011,"type":15},"Video","video",17171,"https:\u002F\u002Fgithub.com\u002Fbrowser-use\u002Fvideo-use","2026-04-16T05:01:44.229054",{"slug":4016,"name":4016,"fn":4017,"description":4018,"org":4019,"tags":4020,"stars":4012,"repoUrl":4013,"updatedAt":4027},"video-use","edit and process videos via conversation","Edit any video by conversation. Transcribe, cut, color grade, generate overlay animations, burn subtitles — for talking heads, montages, tutorials, travel, interviews. No presets, no menus. Ask questions, confirm the plan, execute, iterate, persist. Production-correctness rules are hard; everything else is artistic freedom.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[4021,4022,4023,4026],{"name":4001,"slug":4002,"type":15},{"name":4004,"slug":4005,"type":15},{"name":4024,"slug":4025,"type":15},"Transcription","transcription",{"name":4010,"slug":4011,"type":15},"2026-04-16T12:17:10.522375",{"slug":4029,"name":4029,"fn":4030,"description":4031,"org":4032,"tags":4033,"stars":4042,"repoUrl":4043,"updatedAt":4044},"browser-use-terminal","automate web interactions via CLI","Direct browser control via the Browser Use Terminal CLI. Use when the user wants to automate, scrape, test, or interact with web pages — you drive the browser yourself with Python helpers.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[4034,4035,4038,4039],{"name":20,"slug":21,"type":15},{"name":4036,"slug":4037,"type":15},"CLI","cli",{"name":3948,"slug":3949,"type":15},{"name":4040,"slug":4041,"type":15},"Web Development","web-development",607,"https:\u002F\u002Fgithub.com\u002Fbrowser-use\u002Fterminal","2026-06-12T08:15:38.34797",{"slug":4,"name":4,"fn":5,"description":6,"org":4046,"tags":4047,"stars":22,"repoUrl":23,"updatedAt":24},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[4048,4049,4050],{"name":20,"slug":21,"type":15},{"name":13,"slug":14,"type":15},{"name":17,"slug":18,"type":15},{"slug":4052,"name":4052,"fn":4053,"description":4054,"org":4055,"tags":4056,"stars":4072,"repoUrl":4073,"updatedAt":4074},"agents-sdk","build AI agents on Cloudflare Workers","Build AI agents on Cloudflare Workers using the Agents SDK. Load when creating stateful agents, durable workflows, real-time WebSocket apps, scheduled tasks, MCP servers, or chat applications. Covers Agent class, state management, callable RPC, Workflows integration, and React hooks.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[4057,4060,4063,4066,4069],{"name":4058,"slug":4059,"type":15},"Agents","agents",{"name":4061,"slug":4062,"type":15},"AI Infrastructure","ai-infrastructure",{"name":4064,"slug":4065,"type":15},"Cloudflare Workers","cloudflare-workers",{"name":4067,"slug":4068,"type":15},"SDK","sdk",{"name":4070,"slug":4071,"type":15},"Serverless","serverless",255,"https:\u002F\u002Fgithub.com\u002Fbrowser-use\u002Fbrowsercode","2026-04-27T05:34:19.800431",{"slug":4076,"name":4076,"fn":4077,"description":4078,"org":4079,"tags":4080,"stars":4072,"repoUrl":4073,"updatedAt":4085},"browser-execute","execute browser automation tasks","Use ONLY when calling the `browser_execute` tool or driving a real browser via the Chrome DevTools Protocol. Required reading before the first `browser_execute` call in a session. Covers the three connection methods (local Chrome with remote debugging, isolated debug-port profile, Browser Use cloud), the in-process `session` \u002F `console` snippet model, attaching to a page target, common CDP commands, the per-project `.bcode\u002Fagent-workspace\u002F` for reusable scripts, and screenshot auto-attachment.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[4081,4082],{"name":20,"slug":21,"type":15},{"name":4083,"slug":4084,"type":15},"Debugging","debugging","2026-07-31T05:55:46.960752",{"slug":4087,"name":4087,"fn":4088,"description":4089,"org":4090,"tags":4091,"stars":4072,"repoUrl":4073,"updatedAt":4102},"cloudflare","manage Cloudflare platform resources","Comprehensive Cloudflare platform skill covering Workers, Pages, storage (KV, D1, R2), AI (Workers AI, Vectorize, Agents SDK), networking (Tunnel, Spectrum), security (WAF, DDoS), and infrastructure-as-code (Terraform, Pulumi). Use for any Cloudflare development task.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[4092,4093,4095,4098,4101],{"name":4061,"slug":4062,"type":15},{"name":4094,"slug":4087,"type":15},"Cloudflare",{"name":4096,"slug":4097,"type":15},"Database","database",{"name":4099,"slug":4100,"type":15},"Security","security",{"name":4070,"slug":4071,"type":15},"2026-04-27T05:34:21.032189"]