rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:deqingLv/dsh-chrome-attach
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
Attach the current Chrome tab to your conversation. One pick in the composer screenshots the page you are looking at, drops it into the draft as an image attachment, and types the tab's title and URL on a line next to it — the same move as ChatGPT's + → attach browser page, except the model also learns which page it is looking at. Everything waits in the draft; nothing is sent until you press Enter.
简体中文 · a DeepSeek Harness plugin

The plugin tries three capture tiers in order and uses the first one that works. No bridge, no extension and no Chrome flags are required — only the image quality differs:
| Tier | What the image contains | Needs | Notes |
|---|---|---|---|
bridge |
tab content only | dsh-chrome-bridge + the DSH Bridge extension |
best: no focus stealing, no prompt, supports full-page |
cdp |
tab content only | Chrome's own Remote debugging switch | one approval, keeps your normal profile |
window |
the whole Chrome window (including tab strip and address bar) | macOS + Screen Recording permission | no extension; isolates Chrome without changing focus |
The default chain is bridge → cdp → window; the first tier that succeeds wins. Every response names its source, and a window shot is labelled "window shot, browser UI included".
Needs a DSH build that ships commandUi and the session-slot inputActions prop (that is what writes the page line). On older builds the screenshot still attaches; only the line is skipped, and the toast says so.
dsh plugin --profile desktop add dsh-chrome-attach # "web" for the web profile
Then refresh the window (Cmd+R) or restart DSH — new bundles are not hot-loaded.
dsh-chrome-attach-<version>.tgz from Releases.Cmd+R) or restart DSH — new bundles are not hot-loaded.git clone https://github.com/deqingLv/dsh-chrome-attach.git
Add the plugin by its absolute directory path. It installs as a link:, so edits to the code take effect after a restart:
/Users/you/WorkSpace/Github/dsh-chrome-attach
The + menu in the composer gains one row, right below Add files in the Add section:
[Chrome mark] Attach Chrome · Screenshot the page, plus its title and URL
Clicking it screenshots the active tab (or degrades to the window), puts the image into the current draft, writes the page line, and does not send. Keep typing. /attach works too.
An image only tells the model what the pixels look like, not which page it came from, so the row also inserts one line through the composer's own input facade:
Chrome tab: Kaboo — https://kaboo.bytedance.net/?section=team
That line and the image are one draft: it is plain text you can edit or delete, and both leave together when you press Enter. If the draft is mid-send or no editable draft is attached, only the image lands and the toast says the page line was skipped (已附上(页面地址未能写入输入框):…).
Attachment names carry the page title, e.g. DeepSeek-Harness-155812.png.
Full-page capture exists in the API (POST /api/chrome-attach/shot {"full":true}) but is not a separate menu row yet.
bridge — no permissions at allInstall dsh-chrome-bridge from the DSH plugin page and the DSH Bridge extension in Chrome, then connect once. The plugin shells out to the cb CLI (~/.dsh/bin/cb) and gets the bare tab content, without stealing focus.
cdp — Chrome's own Remote debugging switchThe clean-tab fallback that needs no extension and no Screen Recording. Chrome 136 changed --remote-debugging-port, but Chrome now ships a supported switch instead:
chrome://inspect/#remote-debugging and tick Remote debugging.<profile>/DevToolsActivePort, and the plugin reads it. Your profile, logins and extensions stay exactly as they are.The switch is governed by the DevToolsRemoteDebuggingAllowed policy. On a managed machine where it is disabled the checkbox is greyed out — use the window tier or bridge instead.
Already launching Chrome with a debug port? The plugin also probes 9222/9223 and any port named by DSH_CHROME_DEBUG_PORT:
"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" \
--remote-debugging-port=9222 \
--user-data-dir="$HOME/.chrome-dsh-debug"
window — macOS screen recordingNothing to install inside Chrome; DSH needs Screen Recording once:
+ menu. The shot is the whole Chrome window.Window shots are downscaled to a 2200px long edge (about 1 MB on Retina, still readable). The plugin resolves Chrome's WindowServer ID and captures that window directly, excluding overlapping apps, attached dialogs and shadows without switching focus. Chrome must not be minimized and must be on the current desktop; when no Chrome window is on screen the tier fails instead of capturing a desktop region. Window identity comes from CoreGraphics alone, so Screen Recording is the only permission it needs; the page URL is added when macOS also lets DSH script Chrome, and the shot works without it. Google Chrome only.
browser (client/client.js)
└─ menu row → POST /api/chrome-attach/shot {full}
└─ host (lib/index.js → lib/capture.js)
├─ bridge: cb shot active --out … --json
├─ cdp: /json/version → WebSocket → Page.captureScreenshot
└─ window: CoreGraphics window list → WindowServer ID → screencapture -l
← { dataUrl, title, url, source, degraded }
└─ dataUrl → File → synthetic drop → DSH's image intake → draft
└─ title + url → inputActions.insertText → same draft, one line
The host half only imports Node built-ins, so it never depends on packages the DSH profile may not resolve. The client half is the entry in the + menu; it hands the PNG to the same attachment intake a real drag-and-drop uses. The page line goes through inputActions, the façade the conversation publishes to session slots as a prop — the plugin registers one headless conversation.input.dock entry to hold on to it, so it never reaches into the session directly and inherits the façade's phase/revision guards.
| Variable | Default | Meaning |
|---|---|---|
DSH_CHROME_ATTACH_MODE |
auto |
Pin one tier: bridge, cdp, window |
DSH_CHROME_DEBUG_PORT |
— | Extra CDP port to probe |
DSH_CHROME_BRIDGE_CB |
— | Explicit path to the cb CLI |
DSH_OSASCRIPT_BIN / DSH_SCREENCAPTURE_BIN |
system paths | Overrides for testing |
bridge/cdp) or the frontmost Chrome window (window).window shot's URL/title come from the same page, so they describe the frontmost tab rather than the whole window.chrome:// pages and the Chrome Web Store cannot be captured through chrome.debugger; the window tier is unaffected.window tier needs Screen Recording; failures point at the exact System Settings pane.npm run check
npm test
Probe a single tier:
DSH_CHROME_ATTACH_MODE=window node -e "import('./lib/capture.js').then(m => m.capturePage())"
DSH_CHROME_DEBUG_PORT=9222 node -e "import('./lib/capture.js').then(m => m.capturePage({mode:'cdp'}))"
DSH_CHROME_BRIDGE_CB=/path/to/fake-cb node -e "import('./lib/capture.js').then(m => m.capturePage({mode:'bridge'}))"
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek-harness。