Introduction¶
DeepSeek Harness (DSH) adopts an “everything is a plugin” architecture, allowing developers to mount capabilities into conversations and toolchains on demand. In agent development, frontend pages often require iterative changes and repeated visual inspection, and switching back and forth to a browser window or local server disrupts the context flow. This article introduces dsh-html-render: a client-side plugin that renders HTML, enables interaction, and exports images or PDFs directly within a DSH session.
What Is This¶
dsh-html-render is an HTML rendering plugin for DeepSeek Harness, maintained by lrzda. It renders HTML code blocks into sandboxed iframes so that pages can be previewed directly in the conversation, while also providing an html_render tool that uses local Edge in headless mode to export PNG/JPG/PDF/SVG. The plugin attaches as a client-side component, requires no complex build process, and is well-suited for quickly verifying frontend results within DSH sessions.
Core Capabilities¶
- In-conversation preview: Uses the official slot
conversation.chat.markdown.fence(with keyhtml). Code blocks are rendered as sandboxed iframes. Their position is determined by where they appear in the response, and a single reply can contain multiple iframes. - Interaction preserved: JS / CSS / forms / animations inside the iframe all run natively;
sandboxpermits scripts but does not grantallow-same-origin, so the page cannot access the host DOM. - Streaming-safe: During streaming output, incomplete HTML is not rendered; rendering only takes over the code block after output is complete.
- Source available: A collapsible “View Source” section is kept below the rendered result, allowing you to expand and inspect the original HTML code at any time.
- Offline export: Calls local Edge + CDP via the
html_rendertool to export PNG / JPG / PDF / SVG. Artifacts are saved to%DSH_HOME%\html-render\artifacts. - Result echo-back: When an image is produced via the tool in a given turn, a result image is appended at the end of that turn. Detection is based on the turn’s time window, so other conversations are not affected.
Typical Usage¶
To preview HTML in the conversation, simply use fenced syntax with the language tag html:
<h1>Hello</h1>
To export as an image or PDF, invoke the html_render tool. Example:
{
"source": { "kind": "html", "content": "<h1>hi</h1>" },
"format": "png",
"viewport": { "width": 1280, "height": 800, "deviceScaleFactor": 2 },
"options": { "fullPage": true },
"actions": [{ "type": "click", "selector": "#tab2" }]
}
format options: png / jpeg / pdf / svg. actions is optional and can be used to adjust page state (e.g., via clicks) before taking the screenshot.
Notes¶
- The plugin runs with the current DSH process privileges. Review the source code and license (MIT) before installing.
- On Windows, running
npm installandnode build.mjsrequires full permissions (npm writes to its cache directory; esbuild spawns child processes). - After modifying client code, you must restart DSH for changes to take effect (Ctrl+F5 inside the Electron window does not work).
In Short¶
dsh-html-render brings frontend pages directly into DSH conversations. Combined with the html_render tool, you can complete previewing, interaction, and offline export—all within the conversation—reducing the overhead of constant window switching. See the links below for the catalog page and source repository.
Related Links¶
- Catalog page: https://www.skillhub.cn/plugins/lrzda/dsh-html-render
- GitHub: https://github.com/lrzda/dsh-html-render