开发与测试
阅读完整来源 ↗
chrome-agent
Local browser automation with structured, verified outcomes. Use for web navigation, scraping and extraction, form interaction, screenshots and downloads, network or console checks, responsive testing, or page-scoped device emulation.
sderosiaux · 已有 AI 审核记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add sderosiaux/chrome-agent --skill chrome-agent技能说明
name: chrome-agent description: Local browser automation with structured, verified outcomes. Use for web navigation, scraping and extraction, form interaction, screenshots and downloads, network or console checks, responsive testing, or page-scoped device emulation. metadata: author: sderosiaux version: "0.14.0" tags: ["browser", "automation", "scraping", "chrome", "cdp"]
chrome-agent — Browser Automation
which chrome-agent || npm install -g chrome-agent # or: cargo install chrome-agent
What this tool guarantees
- Every mutating action states what it may claim about itself —
verdict+verdict_reason+next, always present, never four different silences collapsed into one empty report. - A pointer-targeted action says who received the event —
deliverycomes from a hit test at the coordinate about to be dispatched, andintercepted_bynames the element that took it instead. - A write says what the page kept —
value.actualbesidevalue.requested, read back through a stated window (observed_after_ms). Same field and same window forfill,selectandcheck/uncheck: they are one measurement on three kinds of control.
Reading a response
ok:true means the command ran, not that the page complied. Read verdict, and read
value.verbatim whenever you filled something, before you tell anyone the action worked.
next is one token from a closed set of six — proceed inspect retry confirm dismiss
stop — so you can branch without parsing prose. Branch on next, not on the verdict word.
verdict | verdict_reason | next | What to do |
|---|---|---|---|
changed | tree_delta | proceed | The page moved; delta says how. |
changed | nodes_moved | proceed | Same nodes, reordered (a drag landed). |
changed | focus_only | proceed | Nothing moved but focus, and focus landed on a real element — on a path with no hit test that is the only sign the action arrived. focus.to names what RECEIVED focus, which is often a focusable ancestor of what you clicked (a span inside a link focuses the link), so do not read it as "the element I aimed at". Focus landing on the document does not reach this row at all: see identical_tree. |
changed | value_kept | proceed / inspect | The element held what was asked of it when it was read back, and the tree could not show it — a secret field renders as a fixed marker, so a refill of one produces no delta, and on the first action of a session there is no tree to compare at all. fill, select and check/uncheck all reach this row, and the evidence is value.verbatim on each, not the delta. This is the one row whose next depends on more than the reason: if the PAGE read failed as well, the same verdict answers inspect, because the element is confirmed and nothing else on the page was seen. Branch on next. |
changed | values_lost | confirm | It moved AND emptied a field that held a value. values_lost:[{uid,role,name,was}] names each. A form that submitted-and-cleared and a form that discarded your input look identical here. Confirm with assert text --contains on the page's own confirmation, or network, before re-filling — a re-submit may send the work twice. |
navigated | document_replaced | inspect | New document. Every stored uid is dead. |
intercepted | hit_test_receiver | dismiss | Another element occupied the aim point and got the event. intercepted_by names it (tag/id/class/uid/z_index/text/modal). Nothing is known about the target. This is the row you will actually get: 8 interceptions over 61 real sites, all of them this one. Read tag/id/class — z_index was auto on 7 of the 8 and on both local fixtures, because scrims usually stack by DOM order and position, not by z-index. |
intercepted | modal_dialog | dismiss | A <dialog> opened with showModal() (or a fullscreen element) holds the top layer and receives everything outside itself. Press Escape or click its own dismiss control first. Covered by a fixture, not yet seen in the wild: 0 occurrences over 61 real sites. modal is el.matches(':modal'), which only the top layer satisfies — the <div role="dialog"> overlays most sites ship never enter it and arrive as hit_test_receiver above. |
not_kept | value_reverted | stop | The write reached the element and it held nothing afterwards. Do not fill again — the same write produces the same answer. Read value.actual. |
not_kept | value_rewritten | stop | It holds something else — a mask, a trimmer, a normaliser. The write landed in the page's own shape. Read value.actual and decide whether that is the value you wanted. |
no_effect | delivered_no_change | confirm | Delivery proven to the target, and the tree stayed still within observed_after_ms. The strongest word available. Repeating is the one thing that cannot help. |
unchanged | identical_tree | confirm | The tree was identical while the tool watched. Delivery was not proven. |
unknown | no_baseline | inspect | First action of the session on this page; nothing to compare against. |
unknown | read_failed | inspect | The action ran; reading the page afterwards failed. |
unknown | identity_unreadable | inspect | The two trees may not belong to the same document. |
unknown | aim_point_off_target | inspect | Two readings of the aim point agreed and it still could not be aimed at — nothing was dispatched, and the miss is stable, so an identical retry misses identically. Two shapes, told apart by aim: a point on screen outside the element's own boxes (a wrapped inline box, a clipped container) → aim at a child that has a box of its own; a point outside the viewport (a position: fixed wall, a locked document scroll) → no scroll will move it, change the page's state first. |
unknown | `scrol |