Introduction¶
When building agents or workflows in DeepSeek Harness (DSH), reading web pages is a common requirement: checking documentation, following links, feeding page content to a model. The typical approaches are either direct HTTP fetching of HTML or installing browser automation locally. The former does not execute JavaScript, so dynamic pages often yield only the shell; the latter can render pages, but “waiting for load to complete” has multiple meanings, and choosing the wrong one can treat a loading spinner as the actual content. Even more problematic is silent fallback: when the browser fails, the system quietly switches to static fetching, leaving the caller believing it received fully rendered content.
This article introduces the community plugin dsh-tool-browser (maintainer yuehancn, GitHub: yuehancn/dsh-tool-browser). It provides four browser-related tools in DSH: first it reports whether a real browser is available, then fetches HTML, extracts readable main text, or takes PNG screenshots; when Playwright is installed it uses a real browser, otherwise it falls back to static fetching, and explicitly states this in the returned result via engine and engineNote, so you never mistake a page where “JavaScript never ran” for an empty or complete page.
What Is This¶
dsh-tool-browser is a browser tool plugin for DeepSeek Harness, with the npm package name @yuehancn/dsh-tool-browser, current version 1.0.0, MIT license. In the SkillHub directory it is categorized under “Model Inference” with the description “DeepSeek Harness plugin”.
The plugin addresses the entire chain of “open a page → wait in the way the page actually needs → extract main text → screenshot when necessary”, rather than merely providing a bare fetch.
Four Tools¶
The capabilities listed in the README are as follows:
| Tool | Purpose |
|---|---|
browser_status |
Reports whether a real browser is available, the default engine, the four wait strategies, output directory and defaults; it makes no requests and does not launch a browser |
browser_fetch |
Fetches page HTML, optionally saving to disk |
browser_extract |
Extracts only the readable main text, as plain text or Markdown |
browser_screenshot |
Takes PNG screenshots with a real browser; if Playwright is not installed it explicitly errors out instead of providing a static fallback |
Playwright is an optional dependency. When it is not installed, browser_fetch and browser_extract remain usable (static engine); browser_screenshot fails rather than returning a meaningless unrendered empty image.
Every call includes engine and engineNote in the result. For example, when the browser times out and falls back to static, it will state that the content below is “the content returned by the server when JavaScript has not been executed”.
Wait Strategies and Main Text Extraction¶
Four Kinds of “Waiting for Load to Complete”¶
The plugin supports four wait strategies, each with a different meaning:
| Strategy | What It Waits For |
|---|---|
domcontentloaded |
The DOM tree is built |
load |
All resources (images, styles, etc.) have arrived |
networkidle |
The network is quiet (no requests for 500ms) |
selector |
A certain CSS element appears |
When using selector, navigation uses domcontentloaded, then waits for the target element with waitForSelector, avoiding the situation where combining with networkidle on a page with polling requests causes “network quiet” to never arrive.
How Main Text Is Selected¶
The extractor does not choose nodes by “who has the most text” (that would almost always be <body>), but scores candidate subtrees by main-text density: proportion of main text (non-link text), degree of paragraph segmentation, punctuation density, etc. Before scoring it removes <nav>, <footer>, <aside>, <script>, <style>, etc.; class name matching supports common plural forms (such as comments). The browser engine and the static engine should extract the same main text from the same document; the README has dedicated assertions testing this.
When converting HTML to Markdown, it handles details such as the width of backtick fences, the nesting order of code and emphasis, preserving emphasis inside links, and writing empty links as [](url).
Installation and Configuration¶
Install the plugin (command from the README):
dsh plugin add dsh-tool-browser
When a real browser is needed, install Playwright as well:
npm install playwright
npx playwright install chromium
It is recommended to call browser_status first to check the current environment. The plugin can be configured in cordis.patch.yml, for example:
# cordis.patch.yml
plugins:
dsh-tool-browser:
workDir: "."
outputDir: "browser-output"
waitStrategy: domcontentloaded
The plugin requires DSH >=0.2.0-rc.2, with peer dependencies on @deepseek-ai/cordis and @deepseek-ai/dsh-tools.
Typical Usage¶
Check Status First¶
Call browser_status to confirm whether Playwright is available, the default wait strategy, and outputDir, then decide whether to use mode=auto or to force browser / static.
Fetch HTML: browser_fetch¶
| Parameter | Description |
|---|---|
url |
Required, absolute http(s) URL |
mode |
auto (default, browser first, may fall back on failure) / browser (real browser required) / static (static only) |
waitStrategy |
One of the four strategies |
waitForSelector |
CSS selector, implies waitStrategy=selector |
saveAs |
File name to save under outputDir |
maxChars |
Truncation length for the returned HTML |
mode is a commitment, not a preference: in browser mode it will error if there is no real browser, without silent fallback. The config option requireBrowser can prevent auto from falling back as well. If saveAs is specified, the full page is written to disk even if the returned body is truncated by maxChars.
Main Text Only: browser_extract¶
| Parameter | Description |
|---|---|
url |
Required |
format |
text (default) or markdown |
keepLinks |
Whether Markdown preserves link syntax, default true |
includeLinks |
Whether to attach a full-page link list, default false |
maxChars |
Truncation length for the main text |
The result includes selector (the selected subtree) and score (density score), making it easier to diagnose whether extraction results are anomalous.
Screenshots: browser_screenshot¶
| Parameter | Description |
|---|---|
url |
Required |
filename |
Saved to outputDir, default includes a timestamp |
fullPage |
Full page or viewport, default false |
width / height |
Viewport dimensions |
Only the last path segment of the file name is taken, preventing writes outside outputDir via absolute paths or ../.
Use Cases and Notes¶
Who it is for: Developers who need to reliably read web pages, extract article main text, and take screenshots in environments with Playwright within DSH agents or scripts; scenarios where “static HTML” and “browser-rendered result” need to be distinguished.
Permissions and security: The plugin runs with the permissions of the current DSH process, accesses the URLs you pass in, and may write to outputDir. Before installing, please read the GitHub repository source code and the MIT license to confirm the source and behavior comply with your environment policies. The community directory SkillHub plugin page and DeepSeek / High-Flyer have no official affiliation; the DSH ecosystem philosophy is “everything is a plugin”, and the directory is an independent community site.
Dependencies: Without installing Playwright you can still use fetch and extract; dynamic rendering and screenshots depend on Playwright. On network timeout or browser failure, pay attention to engine / engineNote in the returned result, and do not assume it is necessarily the rendered DOM.
Conclusion¶
dsh-tool-browser splits “status reporting, fetching, main text extraction, screenshots” into four tools, and clearly documents engine switches; wait strategies and density-based extraction explicitly handle common pitfalls in real web pages. If you need web page capabilities with verifiable provenance in DSH, you can install it from the directory page or GitHub and configure Playwright and cordis.patch.yml according to the README.