dsh-browser-annotate: Select Elements in the DSH Browser Panel and Send to AI

Introduction

DeepSeek Harness (DSH) allows agent developers to write code and run tools locally, but a common scenario during development is this: you ask DSH to generate an HTML file, open the preview, and notice that a certain style or layout isn’t right, so you need the AI to fix it. Previously, this meant manually copying the HTML snippet, pasting it into the chat, and going back and forth for several rounds to clearly pinpoint what needed to change. dsh-browser-annotate simplifies this workflow into “select → write feedback → send to AI.”

What Is It

dsh-browser-annotate is a client-side plugin that installs into the right-side browser panel of DSH (desktop only). By clicking or dragging a selection box, you can pick out page elements, extract DOM paths, coordinates, and text, and package this information into a message sent to the AI in the current session, so the model can adjust the corresponding HTML snippet based on your feedback.

Installation & Activation

The install command is from the official README:

dsh plugin --profile web add dsh-browser-annotate

After installation, restart dsh web or the desktop app to activate the plugin. The plugin only works with the right-side browser panel (Browser tab); the TUI has no sidebar and is not applicable.

Core Features

  • Element selection: Click to select a single element, or hold the mouse and drag a box to select all elements within the area
  • Batch selection rule: When drag-selecting, the outermost container is chosen (e.g., boxing a modal selects the entire modal rather than every button inside it)
  • Message format: The sent message includes the page URL, the number of selected elements, each element’s path, coordinates, and text, along with the user’s modification feedback
  • HTML preview mode: When a .html file is opened in the right-side “Document Preview,” the plugin starts a local loopback service to serve the file and automatically enters selection mode
  • Privacy & isolation: Annotations are routed only via the local Host to the agent in the current session; no external network access is made. HTML preview uses a temporary file server that listens solely on 127.0.0.1 with a random token

Typical Usage

Regular Web Pages

  1. Open the Browser tab in the right sidebar and load any webpage
  2. A viewfinder icon appears at the end of the address bar—click it to enter selection mode
  3. Click to select a single element, or hold the mouse and drag a box; upon release, all elements within the box are selected in batch
  4. Write your feedback and click “Send to AI”

DSH-Generated HTML (Core Scenario)

  1. Open a .html file in the right-side “Document Preview”
  2. The same viewfinder icon appears in the preview header—click it to enter selection mode
  3. The plugin serves the file via a local loopback service and automatically enters selection mode
  4. Select elements/areas, write your feedback, and send it; the AI will adjust the code, and refreshing the page will show the result

Use Cases & Notes

  • Ideal for scenarios where the AI needs to adjust HTML styles or layout based on visual feedback
  • Only works on the DSH desktop app; the Web version does not support DOM injection due to cross-origin iframe security restrictions
  • DSH version requirement: >=0.2.2-rc.5 <0.4.0
  • After page navigation, you need to re-enter annotation mode
  • The plugin runs with the current DSH process permissions; it is recommended to review the source code and license (MIT) before installing

Conclusion

dsh-browser-annotate turns the “select + AI edits HTML” step into a reusable standard action, reducing the need for manual copy-paste and back-and-forth confirmation. For more details and source code, visit GitHub: https://github.com/CIBUDAYI3906/dsh-browser-annotate

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye