Preface¶
Building Agents that can truly operate webpages inside DSH (DeepSeek Harness) typically involves exposing browser tools to the model. Injecting the entire page’s HTML directly into the context is bloated and noisy, and the model often clicks the wrong elements. Many implementations rely on CSS selectors or coordinates, which break easily when pages change or across snapshots.
dsh-browser-use-native (GitHub: AythyaCrispus/dsh-browser-use-native) is a Host-side plugin: it drives the local Chromium via Playwright inside the Host process and registers 17 browser_* tools for the model. It uses a trimmable accessibility tree (AX tree) snapshot instead of the full HTML, assigns relatively stable uids to actionable nodes across snapshots, and performs actions like click, fill, drag, and download via uid. Maintained by AythyaCrispus and categorized under networking tools; package name @local/browser-use-native, current version 0.3.0, MIT licensed.
What This Is¶
@local/browser-use-native registers tools via ctx.tools, and the configuration only includes browser parameters; Playwright is responsible for discovering available Chromium. The package name keeps the @local/ scope, installed as a local bundle via link:, and is not published to npm.
The use case can be summarized as: Agents that need to “operate real webpages”—navigation, snapshotting, interaction, observing console/network, handling multiple pages and dialogs—while aligning with the DSH session lifecycle inside the Host (one browser instance per live Agent).
Core Features¶
17 browser_* Tools¶
The tool names exposed to the model are uniformly browser_<name>, totaling 17: click, download, fill, hover, drag, press_key, upload_file, evaluate_script, navigate_page, take_snapshot, take_screenshot, wait_for, list_pages, select_page, list_console_messages, list_network_requests, handle_dialog. Capabilities cover navigation, trimmable snapshots, clicking, filling, hovering, dragging, key pressing, uploading, native downloads, script execution, multi-page management, console, network, and dialog handling.
Accessibility Snapshots and Stable uids¶
The snapshot reads the Chrome Accessibility Tree frame by frame, renders it as text, and assigns uids to actionable nodes. uids are allocated by DOM backend node id and reused across snapshots; page navigation clears uids, and navigation inside iframes clears only that frame. Expired uids return explicit errors instead of mistakenly clicking other elements. It supports focusing subtrees via selector or uid, as well as character, line, and depth limits (default approximately 20000 characters / 1200 lines; configurable via maxDepth, maxChars, maxLines, includeFrames).
Runtime and Sessions¶
Each live Agent lazily starts the browser on the first browser tool call; tool calls within the same Agent execute serially, and the browser closes when the Agent is released. Actions will sequentially try hit detection, forced click, associated label click, and script click if a normal click fails, noting the actual fallback method in the response. Native download prioritizes using context.request (shared cookies) to get the response body, falling back to in-page fetch if that fails; uid mode can capture Playwright’s download events. Screenshots can be saved to disk or returned to the model as attachments. Relative paths are resolved against the current Session working directory, and ~ is expanded to the user directory.
Dependencies and Environment¶
Requires Node.js >= 20 and locally installed Chrome or Edge; depends on playwright-core 1.64.1. Browser discovery order is: executablePath → channel → chrome → msedge → Playwright-managed Chromium.
Installation and Activation¶
The official README provides the following steps (requires a DSH version that supports Host bundle plugins).
First, clone the repository and install production dependencies:
git clone https://github.com/AythyaCrispus/dsh-browser-use-native.git
cd dsh-browser-use-native
npm install --omit=dev
In a DSH session, install this directory via the plugin manager (target is the path after cloning):
plugin_manager action=install_bundle target=<cloned directory>
The plugin registers using link: and uses its own node_modules. After installation or updates, use the application returned by plugin_manager.
Configuration¶
All adjustable items are under config in cordis.patch.yml; they are validated on activation, and invalid values will cause that line to fail loading with a reason provided. Key fields include:
| Field | Default | Description |
|---|---|---|
headless |
true |
When false, shows the browser window |
channel |
chrome |
Playwright channel, such as chrome / msedge; empty attempts auto-discovery |
executablePath |
'' |
Optional Chromium executable path |
slowMo |
0 |
Delay per step (ms) |
viewportWidth |
1280 |
Viewport width |
viewportHeight |
800 |
Viewport height |
actionTimeoutMs |
5000 |
Timeout for click/fill/hover etc. |
navigationTimeoutMs |
30000 |
Navigation timeout |
dialogPolicy |
manual |
manual / auto-dismiss / auto-accept |
dialogTimeoutMs |
5000 |
Fallback dialog handling time in manual mode |
After modifying cordis.patch.yml, HMR will reassemble and take effect; after modifying index.js or lib/*.js, you need to restart DSH, or disable then enable the plugin via the plugin manager (set_plugin enabled=false/true) to reimport.
Typical Usage and Self-Test¶
The workflow is usually: use browser_navigate_page to open the target URL, use browser_take_snapshot to get a uid-annotated snapshot, then call browser_click, browser_fill etc. by uid; use browser_wait_for when waiting is needed; use browser_list_console_messages, browser_list_network_requests to observe behavior. System prompts inject browser operation instructions only if take_snapshot is visible to the current Agent.
End-to-end self-tests that do not depend on DSH can be run at the repository root:
node selftest.mjs
The self-test starts a local HTTP server and headless Chrome, covering navigation, snapshotting, uids, filling, clicking, downloading, iframes, multi-page, dialogs, etc., totaling 49 checks, with artifacts written to artifacts/.
Use Cases and Notes¶
Suitable for developing Agents inside the DSH Host that operate webpages with a real Chromium: form filling, multi-step navigation, file upload and download, cross-frame interaction, multi-tab switching, etc. Compared with “full-page HTML + fragile selectors,” AX snapshot + uid helps control context size and reduce misclicks.
Be aware of the security boundaries: this is an in-process Host plugin with the Host’s process permissions; the launched Chromium is not constrained by the workspace file sandbox, and it accesses pages and executes JavaScript from evaluate_script based on model instructions. Only install from trusted sources and review the source code and the MIT license. Common troubleshooting includes: run npm install --omit=dev in the repo directory to resolve playwright-core is not installed; install Chrome/Edge or configure channel / executablePath to resolve Chromium launch failures; restart or disable then enable the plugin after modifying JS files.
The DSH ecosystem emphasizes “everything is a plugin”; the community directory site is not officially affiliated with DeepSeek / Hunyuan. For further details, see the directory page and repository README.
- Directory page: https://www.skillhub.cn/plugins/AythyaCrispus/dsh-browser-use-native
- GitHub: https://github.com/AythyaCrispus/dsh-browser-use-native