返回目录
模型与 MCP 插件

dsh-sidepanel-web

AleixRocal/dsh-sidepanel-web

Right-sidebar browser for DeepSeek Harness Web: CDP rendering for public sites, same-origin proxy for local/dev, device emulation, and element-pick annotations into the chat.

Stars
1
Forks
0
Issues
0
更新
6 天前

PROJECT TOPICS

项目标签

INSTALL REFERENCE

安装参考

未验证
dsh plugin --profile web add github:AleixRocal/dsh-sidepanel-web

该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。

PROJECT README

README

dsh-sidepanel-web — a browser in the DSH right sidebar with DOM annotations that reach the chat

A browser in the DSH right sidebar — annotate any page in its DOM and send the annotation to the chat.

CI Latest release npm package npm downloads per week GitHub stars GitHub Packages MIT license DSH 0.2.1-rc.2 to 0.3 Node 22.19+ Market: listed

English · Català · 中文

dsh-sidepanel-web adds a Browser tab to the right sidebar of DeepSeek Harness Web. It is a real browser next to your conversation, and it can turn any element on the page into a precise message for the agent.

Pick the button, field or card you are talking about, write what should change, and insert it. The message carries your note, the element's identity and selector, the page it lives on, and one screenshot with the annotation pinned. The full DOM payload — HTML, computed styles, size and position, framework source — is written to an annotation JSON the agent opens only when it needs to reason about the layout. The agent no longer has to guess which element you mean, and you no longer have to describe it with coordinates or a pile of screenshots.

At a glance

  • What it is: a DSH Web plugin that adds a Browser tab to the right sidebar.
  • What the agent gets: your note as the headline, the element's identity and selector, the page URL, a file#n pointer to the annotation JSON (HTML excerpt, computed styles, size and position, framework source), and one screenshot with the pick pinned.
  • Why it helps: the agent can find the component in the code and make the change, instead of guessing from pixels or from “the blue button at the bottom”.
  • What it does not do: it adds no agent tools and runs no automation. You still drive the browser and send the message.

Source: github.com/AleixRocal/dsh-sidepanel-web · Package: npmjs.com/package/dsh-sidepanel-web

[!TIP] Two carriers, one flow. Pages you build — localhost, *.local, private IPs, self-signed dev servers — go through a same-origin proxy and stay fully interactive. Public pages are rendered by a real Chromium on the host over CDP, so X-Frame-Options and CSP cannot block them. The panel chooses automatically; the switch is one click away.

DSH Web with the Browser panel open next to a conversation

Mockup screenshots: the storefront, conversation and URLs are invented. No real account or customer data is shown.

Table of contents

How it feels

  1. Open the page. Expand the right sidebar and choose Browser. Type localhost:5173, shop.local or example.com — the scheme is added for you (http:// for local hosts, https:// for public ones).
  2. Point at the element. Click Annotate, hover the page, and click the button, field or card you mean. A note card shows what you picked. Write what should change: make this primary action sticky on mobile, this field should be required, match this card to the design.
  3. Send it to the chat. Choose Add to list to keep annotating, then Insert. The composer receives the annotation text and one annotated screenshot. Send it to the agent.

No coordinates and no “the blue button at the bottom”. The annotation names the element, shows where it lives, and carries the note that says what you want.

What reaches the chat

Each annotation is one block of text, followed by one image with every pick pinned:

[Annotation 1] "Make this primary action sticky on mobile"
· Element: button#save (Save changes)
· Selector: #save
· Page: Settings — localhost:5173/settings
· Details JSON: ~/.dsh/data/dsh-sidepanel-web/annotations/2026-11-16-localhost_5173.json#1
  • The note is the message; the rest is a pointer. Your note headlines the block, then the element's identity, its selector, the page and a file#n pointer to the structured detail. The JSON holds the HTML excerpt, the computed styles that usually matter (display, position, colors, font, padding, radius), the size and position, the parent chain and the framework source. The agent reads it only when it needs to reason about layout, so the chat stays readable and no context is wasted on a dump you did not ask for.
  • The image is the context, and it comes from the page you are looking at. Insert captures one viewport screenshot with every pick numbered and outlined. Local pages are captured through the proxy, so a dev server that redirects to another path or port is shown exactly as the iframe renders it; CDP pages are captured from the live page. DSH shows a lone image at 240px on its long edge (and several images in one message as 64px squares), so one image per Insert is deliberate: you see the page, the pins and what surrounds them, and you can open the original full size.
  • Several picks, one message. Add as many elements as you need to the list; Insert sends all the annotation blocks plus a single image with all the pins.

Why annotate in the DOM

A screenshot shows what the page looks like. A DOM annotation says what the element is.

Only a screenshot A DOM annotation
The agent sees pixels and guesses which element you mean. The agent gets the tag, id, classes, selector and an HTML excerpt.
You describe the location in words. The agent gets computed styles, size and position.
The visual context is clear. The visual context is still there, with numbered pins.

Both matter. The image tells the agent where the element sits and what surrounds it; the DOM payload tells it what the element is, so it can find the code, make the change, and reason about the layout without a round of “which button?”. The note adds intent — what you want changed, not just what exists.

The two carriers

The panel can render a page in two ways. You normally do not need to think about it: the choice follows the URL and is remembered per origin.

URL Carrier What it gives you
localhost, *.localhost, *.local, private/loopback/link-local IPs Native — same-origin proxy The real page and its DOM, fully interactive, with the annotation overlay; self-signed certificates are accepted; cookies live in a per-origin host jar.
Any other http(s) page Remote — CDP A real Chromium on the host renders the page; frames and input are streamed into the panel. Works with X-Frame-Options, CSP and logins from the browser profile.

Native carrier. DSH fetches the page, rewrites its URLs and injects a small shim plus the annotation overlay, so the page is same-origin with DSH and can be inspected and clicked like a normal tab. HTML, CSS, JS, images and API calls stay on the proxy; fetch, XMLHttpRequest, history.pushState/replaceState and window.open are kept on it; <script type="importmap"> URLs are rewritten; data-action="family"-style action names are left alone. WebSockets/HMR are not proxied.

Remote carrier. The host Chromium loads the page for real and streams frames into the panel; clicks, wheel, typing and drags are forwarded. It is the carrier for public sites, pages that refuse to be framed, and sites behind a login.

Switching. The native view has a Remote view (CDP) button. The remote view offers Native view (proxy) for local hosts and Force native view (unsafe) for any other origin, remembered per origin. Forcing a public page through the proxy shares DSH's origin with that page — only do it for sites you trust.

Features

In the sidebar

  • A real browser tab (kind: "browser"), so the chat's “open link in sidebar” preference lands here; params.url is navigated on arrival.
  • Automatic address-bar scheme. example.com becomes https://example.com/; shop.local:5173, 127.0.0.1:5173 or 192.168.1.20:8080 use http://. Non-web schemes (mailto:, file:, javascript:, data:) are refused.
  • Bring your own browser. Point cdpUrl/wsUrl at any Chrome started with --remote-debugging-port, let the plugin discover one, or let it launch its own with a persistent profile.
  • Device emulation. Responsive (fits the panel), desktop 1280×800, laptop 1440×900, tablet 768×1024 (iPad UA), phone 390×844 (iPhone UA) and Android 412×915, with touch and matching devicePixelRatio.
  • English and Spanish UI through ctx.locale; other locales fall back to English.

Annotating

  • Hover inspector: tag#id.class 240×44 [role], so you can see what you are about to pick.
  • Element pick with selector, text, classes, an HTML excerpt, computed styles, size/position and page URL, collected into the annotation JSON.
  • Numbered pins and notes. Keep several picks in the list, then insert them together.
  • Composer hand-off with InputActions.insertText, so the annotation is added at the caret without replacing your draft.
  • One annotated image per Insert, with every pick pinned — not one tiny crop per element.
  • Esc leaves annotate mode from the page or the toolbar; an open note card closes first.

Quick start

Requirements

  • DSH 0.2.1-rc.2 or newer, below 0.3.0 (Web profile).
  • Node.js 22.19+.
  • A Chromium-based browser on the host. The plugin auto-detects Chrome/Chromium; the Playwright Chromium cache also works.

Install

# from npm
dsh plugin --profile web add dsh-sidepanel-web

# from GitHub
dsh plugin --profile web add github:AleixRocal/dsh-sidepanel-web

# or from a local clone, while developing
git clone https://github.com/AleixRocal/dsh-sidepanel-web
dsh plugin --profile web add link:/absolute/path/to/dsh-sidepanel-web

Restart dsh web once and refresh the GUI. The Browser tab appears in the right-sidebar guide.

A scoped copy (@aleixrocal/dsh-sidepanel-web) is also published to GitHub Packages; the canonical package is the npmjs one. Installing the mirror needs a token with read:packages and @aleixrocal:registry=https://npm.pkg.github.com.

First page

  1. Expand the right sidebar and choose Browser.
  2. Type example.com and press Enter. The panel opens https://example.com/; the scheme is added for you.
  3. Click Annotate, hover the page, click an element, write the note and choose Insert.

[!NOTE] If no browser is found on the usual CDP ports, the plugin launches a dedicated headless Chromium with a persistent profile. Set chromePath only when auto-detection misses your binary.

Use your own browser

To reuse the browser you already run (same cookies and logins), expose its CDP port and point the plugin at it — no separate install:

google-chrome --remote-debugging-port=9222 --user-data-dir="$HOME/.config/chrome-dsh" &
- id: dsh-sidepanel-web
  config:
    cdpUrl: http://127.0.0.1:9222   # or wsUrl: ws://127.0.0.1:9222/devtools/browser/…

Chrome 136+ refuses /json/version on the default profile, hence the separate --user-data-dir. Without cdpUrl/wsUrl the plugin probes 9222–9225 and 9333, then ~/.local/state/dsh-sidepanel-web/browser.json, then the ego bridge file.

Usage

  1. Open a session, expand the right sidebar, and choose Browser.
  2. Enter a URL in the address bar.
    • example.com → https://example.com/ (scheme added for you).
    • localhost:3000, shop.local, 192.168.1.20:8080 → http://, because local dev servers rarely have TLS.
    • A local/dev host is proxied through DSH and stays fully interactive; a public host is rendered by the host Chromium and streamed into the panel.
  3. Click Annotate and hover the page. The inspector shows the element type and size.
  4. Click the element, write the note, and choose Add to list. Repeat for every element you want to include.
  5. Choose Insert to place the annotations and the annotated image in the composer; send the message.
  6. Use the ⋯ menu for device presets, to clear pins, or to switch between Native view (proxy) and Remote view (CDP). The choice is remembered per origin.
URL Carrier Why
example.com, any public site CDP screencast Works even when the site sends X-Frame-Options/CSP.
localhost, *.local, private/loopback/link-local IPs Same-origin proxy Native rendering, DOM access and annotation without a screencast.

Configuration

Set options in the profile patch, under the plugin's row:

# ~/.dsh/profiles/web/cordis.patch.yml
- id: dsh-sidepanel-web
  config:
    chromePath: /path/to/chrome
    headless: true
Key Default Meaning
chromePath auto-detect Absolute path to a Chromium-based browser.
headless true Launch the host browser without a window.
autoLaunch true Start a browser when no CDP endpoint is available.
wsUrl empty Explicit CDP endpoint (ws://127.0.0.1:port/devtools/browser/…).
cdpUrl empty HTTP debugging endpoint of an existing browser, e.g. http://127.0.0.1:9222; resolved through /json/version.
profileDir ~/.local/share/dsh-sidepanel-web/profile Browser profile directory (persistent: logins survive restarts).
homeUrl https://www.deepseek.com First page when the browser starts.
device responsive Emulation preset: responsive, desktop, laptop, tablet, mobile, android.
pollMs 1200 Screenshot polling interval for the legacy stream mode.
quality 82 JPEG quality for the legacy stream mode.
streamMode screencast screencast or poll (legacy stream mode).
streamFps 15 Frame-rate cap for the legacy stream mode.

How it works

DSH Web GUI
  └─ Browser tab (sidebar.right.pane.tab)
       ├─ Carrier A · native (local/dev)
       │    proxy iframe ──► /api/sidepanel-web/p/<origin>/<path>
       │                         └─ rewriting proxy (HTML/CSS/JS/API)
       │                              └─ overlay: element pick → note → composite image
       └─ Carrier B · remote (any page)
            CDP Chromium (host) ──► screencast frames + forwarded input
                 └─ same panel, same annotation flow

  annotations + one pinned screenshot ──► composer (InputActions.insertText)

The host half owns the Chromium, the proxy, the screenshots and the composite render; the client half is the tab you see. The native carrier keeps the page same-origin so the overlay can read its DOM and you can click it; the remote carrier streams a real browser and forwards your input. Both feed the same annotation payload, so the chat does not care which carrier you used.

On Insert, the host captures one viewport screenshot and re-applies every pick's pin (by selector for a native page, from the live page for CDP) and returns a single PNG. Local pages are loaded through the same proxy path the iframe shows — one canonical redirect first, so a dev server that moves the page to another path or port is captured exactly as it renders — using a short-lived cookie the proxy route accepts for that render only. If the proxy capture fails, the service falls back to a direct render, so the message still has its image and all the text.

  • Host half (lib/index.js, lib/service.js, lib/cdp.js, lib/launcher.js): routes, Chromium lifecycle, CDP, screenshots, crops, composite render.
  • Proxy (lib/proxy.js): fetches local/dev pages, rewrites URLs, injects the shim and overlay, keeps a per-origin cookie jar.
  • Page/overlay (lib/page.js): rendered-page carrier and the annotation overlay.
  • URL rules (lib/url.js): scheme detection shared with the client (mirrored inside lib/client.js and enforced by test/url-smoke.mjs).
  • Client half (lib/client.js): the sidebar tab, address bar, native/remote carriers, annotation note card, composer insertion, EN/ES dictionaries.

A deeper write-up of the DSH Web integration (slots, tab registry, carriers, browser discovery) is in docs/browser-integration.md (Catalan).

FAQ

I typed example.com and it opened https://example.com/. Can I force http://?

Yes — type the scheme explicitly (http://example.com). Local/dev hosts (localhost, *.local, private, loopback and link-local addresses) already default to http:// because dev servers rarely have TLS. Non-web schemes are rejected.

The public page shows a connection error or refuses to load.

Public pages use the CDP carrier, not an iframe, so X-Frame-Options is not the cause. Check that the host Chromium is running and reachable (cdpUrl/wsUrl or the auto-launch), and that the host has network access to the site. The panel's status line names the CDP error.

Can I force the native view for a public site?

Yes, explicitly: open the site, click the ⋯ menu and choose Force native view (unsafe). The choice is remembered per origin, so every later tab to that origin opens in the native carrier, and the page becomes proxied and annotatable like a local one. Only do it for sites you trust: the proxied page shares DSH's origin and can read the panel DOM and call the DSH API with your session. The default policy is unchanged — local/dev goes native, public goes to CDP.

Why does the chat show one image instead of a crop per annotation?

Because DSH sizes images by how many arrive together: a lone image is shown at 240px on its long edge and is never upscaled past its natural size, while several images in one message become 64px squares. A crop of a small button would look tiny either way. Insert therefore sends one viewport screenshot with every pick pinned, and leaves the crop and the HTML excerpt in the annotation JSON instead of the text.

The local page is blank in the native view.

The rewriting proxy drives most apps, but WebSockets/HMR are not proxied and some heavy JavaScript apps need a real browser. Use Remote view (CDP) for that site; the choice is remembered per origin.

Chrome 136+ refuses to expose /json/version.

Start it with a separate profile: --user-data-dir="$HOME/.config/chrome-dsh". The default profile is protected from CDP since Chrome 136.

Where are cookies and logins stored?

The plugin's own Chromium uses the persistent profileDir (~/.local/share/dsh-sidepanel-web/profile by default). When you point it at your own browser via cdpUrl/wsUrl, that browser keeps its own profile and cookies.

Does it work in DSH Desktop?

No. This is a Web-profile plugin; DSH Desktop uses an Electron <webview> and a different profile.

Can I annotate cross-origin iframes or closed shadow DOM?

Only their container. The overlay cannot pierce a cross-origin frame or a closed shadow root.

How are the screenshots generated, and is any real data used?

With npm run mockups, from the real client and a mock backend. Every image uses invented content (fictional storefront, reserved example.com, invented conversation); no real DSH window, account, customer, file path or token is captured. See Screenshots and privacy.

Screenshots

Annotating the place-order button Phone emulation preset
Pick, note, send. The pin lands on the element and the note card prepares the composer payload. Device emulation. Desktop, laptop, tablet, iPhone and Android with touch and DPR.

How the two carriers and the annotation path work

The diagram: a local/dev page through the same-origin proxy, a public page through CDP, and both feeding the same annotation payload.

All screenshots are mockups generated from test/preview/shell.html and test/preview/diagram.html: the panel is the real client, the storefront is the fictional Northwind Supply on the reserved example.com domain, and no real account, page or customer data is used. See Screenshots and privacy.

Screenshots and privacy

Screenshots are part of the deliverable, so they follow a hard rule: no real user data.

  • The panel is the real lib/client.js; the shell around it (conversation, workspace, session) is static HTML in test/preview/shell.html.
  • The storefront is Northwind Supply, a fictional shop on the reserved example.com domain.
  • No real DSH window, account, page, customer, file path or token appears in any image.
  • screenshots.json declares the four storefront images for plugin marketplaces.
  • Regenerate with npm run mockups; the banner is rendered from test/preview/banner.html.

Security

  • Every host route calls connection.requestRejection(req); the web server is loopback-bound. The one exception is the proxy route accepting the per-process render cookie below, which cannot reach any other route.
  • The rewriting proxy only accepts local/dev hosts (localhost, *.local, private, loopback and link-local ranges). Public URLs are refused and handled by the CDP carrier, unless the origin was explicitly forced into the native view.
  • The native iframe runs sandboxed (allow-scripts allow-forms allow-same-origin allow-popups for local proxy pages). allow-same-origin is required for the proxy document to keep its cookies and APIs; it also means a proxied page shares the DSH origin. Only proxy pages you trust.
  • Force native view is an explicit override. It lets a public origin through the same-origin proxy; that page then shares the DSH origin (DOM, cookies, API calls). The default policy still refuses public hosts. Only force sites you trust.
  • Screenshot renderer credential. The plugin's Chromium has no DSH browser session, so the host sets a sidepanel_render cookie for the DSH origin, scoped to /api/sidepanel-web/p/, HttpOnly, random per process and deleted after the capture. It unlocks that proxy route only; page JS cannot read it and it is never sent to a non-DSH origin.
  • The host browser uses a dedicated profile and ignores certificate errors for local self-signed dev servers. The CDP carrier has the capabilities of the browser you point it at.
  • Annotation text and page content are treated as untrusted data by the agent.
  • Report vulnerabilities privately through SECURITY.md; do not open a public issue.

Known limitations

  • Web only. DSH Desktop uses Electron <webview> and a different profile; this plugin does not replace it.
  • The proxy is local/dev only by default. Public sites are not proxied; they run in the CDP browser. Force native view is the deliberate per-origin override, with the same-origin warning above.
  • WebSocket/HMR is not proxied in the native carrier. Dev servers still serve the page, but hot reload may not work; switch to the CDP view for HMR.
  • Cookies in the native carrier live in a per-origin host jar; some login flows may still fail. The CDP carrier uses the browser's own profile.
  • Cross-origin iframes and closed shadow DOM cannot be annotated; only their container.
  • The annotated image is a fresh capture (a 1200px-wide viewport that grows to fit the picks, or the live CDP page). Local pages are captured through the proxy with the same cookies the iframe uses, but state that lived only in the iframe — an open modal, a half-filled form — may not appear. Every pick's HTML excerpt, styles and crop path stay in the annotation JSON.
  • CDP latency depends on the host and the page; the screencast caps at 15 fps by default.
  • Alpha: APIs and behaviour may change.

Development

lib/
  index.js        host plugin: routes, settings, proxy registration
  service.js      CDP service: status, navigation, screenshots, crop, composite
  cdp.js          zero-dependency CDP client
  launcher.js     Chromium discovery/launch (container-safe, cert errors ignored)
  page.js         rendered-page carrier + annotation overlay
  proxy.js        local/dev rewriting reverse proxy
  url.js          address-bar normalisation (mirrored in client.js)
  client.js       sidebar tab, carriers, overlay bridge, composer
assets/           icon.svg, icon.png, icon-180.png, banner.png, screenshots/
test/             smoke tests and the preview/mockup harness
docs/             DSH Web integration research and the collaboration model (Catalan)
npm run check          # node --check on every source file
npm test               # URL rules + proxy rewrite smoke tests
npm run test:ui        # Esc, native Insert and composite attachments (needs Chromium)
npm run test:composite # real Chromium composite render with pins (needs Chromium)
npm run smoke          # host CDP smoke test (needs Chromium)
npm run mockups        # re-render assets/banner.png and assets/screenshots
dsh plugin --profile web add link:"$PWD"

Release notes live in CHANGELOG.md.

The preview harness renders the real lib/client.js with a mock backend:

node test/preview/server.mjs
# http://127.0.0.1:7788/harness.html?state=ready&w=360&h=780

See test/preview/README.md for every state, the full-window shell, the behaviour test and the mockup pipeline.

Market

Listed in awesome-dsh-plugin (PR #12641, merged 2026-11-08):

Contributing

Contributions are welcome: bug reports, carrier fixes, documentation and mockup improvements. Start with CONTRIBUTING.md, run npm run check and npm test, and read the screenshot privacy rule before adding images. main is protected: changes land through a pull request with one review and green CI. Why the rules look like that, which other projects they borrow from and how conflicts are settled is in docs/collaboracio.md (Catalan). This project follows the Code of Conduct. Security reports go through SECURITY.md, not public issues.

Credits

Forked from zengxiaolou/dsh-annotate-browser (MIT): the CDP client, launcher, element picker and crop flow started there. This fork adds the official right-sidebar integration, the local/dev rewriting proxy, the two-carrier switch, the annotation overlay, device emulation, EN/ES copy, the composite annotated image and the composer hand-off.

License

MIT. See LICENSE; the original copyright notice is preserved.


English · Català · 中文 · Back to top ↑

CLASSIFICATION EVIDENCE

分类依据

项目类型插件
功能分类模型与 MCP
规则置信度高

系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek、deepseek-harness。