dsh-browser-service: DSH Browser Backend in Non-Root Containers

Introduction

When performing web scraping, form operations, or document previews in DSH, a browser layer is often required. The built-in dsh-builtin-browser uses self-hosted Electron: it has no binaries, no GUI libraries, or frequently encounters No usable sandbox! errors in seccomp containers. Playwright-like solutions tend to spawn a separate process for each consumer, and if the CDP port is exposed externally, it can expose cookies to any local process.

Below is an introduction to the community plugin dsh-browser-service (maintainer lyp88997). A single dsh plugin add command integrates a singleton CDP daemon, the cdp-daemon provider for ctx.browser, the complete browser_* tool surface, and a floating web window into the web profile, targeting server and container environments without root or GUI requirements.

What is this

dsh-browser-service is a web connectivity tool plugin for DeepSeek Harness. Both the npm package name and plugin ID are dsh-browser-service. A single tarball delivers:

  • A userspace chrome-headless-shell singleton CDP daemon (the kernel binds only to 127.0.0.1; external access is exposed via a local loopback proxy requiring a Bearer token for /devtools);
  • 33 browser_* tools exported via this package’s shim (the tool surface originates from the dsh-builtin-browser dependency, hooked into tool-browser via a composite patch);
  • cdp-daemon browser provider, which uses the package’s bin/browsersvc.mjs start as the default command to launch the daemon when the browser is first used;
  • Web Panel: A draggable capsule entry at the top left, containing an embedded, clickable, scrollable, and editable live view, along with Operations / Console / Network / Settings;
  • Two global skills included with the package: browser and browser-runtime (displayed as “System Built-in” in the Skill Center).

It also provides a wrapper script concept compatible with dsh-univer-office: since Univer only recognizes a “browser executable path,” you can configure a wrapper outside the same binary as browserExecutablePath (without sharing the CDP daemon; analysis is available in the repository’s docs/design-notes.md).

License MIT; Runtime environment requires Node >= 22.19 (see package.json engines).

Core Features

Singleton CDP and Multi-session Isolation

Multiple clients connect to the same daemon via CDP, with sessions separated by isolated BrowserContexts, avoiding the memory consumption of launching a separate Chromium instance for every plugin or skill.

Security Boundary

CDP does not listen directly to the outside. It uses a random internal port plus a loopback proxy. Reading metadata and /devtools requires Authorization: Bearer <token> (since v0.3.0). The proxy side can count connections.

Trade-offs with Built-in Solutions

The composite patch (plugin/cordis.patch.yml) performs the following: selects cdp-daemon, inserts tool-browser and the browser-cdp provider, and disables the built-in browser-electron and dsh-playwright-browser (the latter cannot coexist with dual providers as it contains 10 browser_* tools with the same names as the built-in ones).

Daemon Lifecycle

browsersvc exits after approximately 15 minutes of inactivity by default (--idle-ms, max 24 hours); the plugin’s auto-start idleMs defaults to 5 minutes. After the last session closes, the plugin actively disconnects from the CDP so the daemon can truly become idle; the next browser call will automatically restart it.

When the endpoint is unreachable, there is no need to manually write autoStartCommand: the plugin executes this package’s bin/browsersvc.mjs start by default. To fix a port or kernel, override the entire browser-cdp config line in the profile’s cordis.patch.yml (you must restate cdpUrl).

Installation and Activation

Recommended command (can be executed repeatedly):

dsh plugin --profile web add dsh-browser-service@latest

For pinned versions or offline distribution, the README examples use Release assets or local tgz files, for example:

dsh plugin --profile web add https://github.com/lyp88997/dsh-browser-service/releases/download/v0.8.2/dsh-browser-service-0.8.2.tgz

You must restart DSH after installation (the plugin is imported at boot; hot reload is unreliable). Verify that the composition is effective:

dsh --profile web --dump-config | grep -E 'browserProvider|# == dsh-browser-service|not found'

Expect to see browserProvider: cdp-daemon and the # == dsh-browser-service layer; when only this package is installed, the guard lines for browser-electron / playwright-browser printing not found is normal.

Three things to note during installation

  1. Do not install dsh-builtin-browser separately: Combining it with this package results in duplicate browser / tool-browser entries and the 33 tools being hooked twice. If already installed, run dsh plugin --profile <name> remove dsh-builtin-browser first.
  2. Do not use the old bare package name dsh-browser-cdp: The same-named package on npm belongs to another project; this repository has been published as dsh-browser-service since 2026-09-27.
  3. Do not stack the bundle patch with manual cordis.patch.yml inserts simultaneously, to avoid duplicate insertion (see repository docs/profile-patch.browser-service.yml for temporary source code modification usage).

Upgrade: dsh plugin --profile web add dsh-browser-service@latest (@latest may not upgrade if the existing version satisfies the dependency range; to switch versions, use the Release URL or a local tgz). The plugin and browsersvc must be upgraded to the same version; the recommended order is to update the plugin and restart DSH first, then browsersvc restart.

Uninstallation:

dsh plugin --profile web remove dsh-browser-service

Optionally stop the daemon (the path depends on the profile installation location; the README provides a method to locate node_modules/dsh-browser-service via dump-config and then run stop).

Typical Usage

Plugin Dependency Auto-starts Daemon

Once installed and restarted, when browser-related tools or ctx.browser are called for the first time, the plugin will use the default autoStartCommand to launch the daemon. Most scenarios require no manual steps.

Manually Start Daemon and Verify

When fixing ports, specifying wrappers, or troubleshooting environments, enter the plugin directory (node_modules/dsh-browser-service under the profile):

node bin/browsersvc.mjs detect
node bin/browsersvc.mjs start --port=9333 --idle-ms=900000
node bin/browsersvc.mjs status

Verify CDP metadata (token comes from $DSH_HOME/browser-service/service.json):

TOKEN=$(node -p 'JSON.parse(require("fs").readFileSync(process.env.DSH_HOME+"/browser-service/service.json","utf8")).token')
curl -s -H "Authorization: Bearer $TOKEN" 127.0.0.1:9333/json/version

Stop:

node bin/browsersvc.mjs stop

In DSH containers, the README test examples use --wrapper pointing to a script that injects LD_LIBRARY_PATH, FONTCONFIG_FILE, as well as --no-sandbox --disable-dev-shm-usage; without a wrapper, use --kernel to specify chrome-headless-shell, ensuring system libraries and fonts are available, otherwise screenshots may turn pure white or show Chinese square boxes.

Configure Executable Path for dsh-univer-office

Univer does not connect to remote CDP; simply maintain a “browser executable path,” for example:

- id: univer
  config:
    browserExecutablePath: /home/node/DSH/.browser/chromium-wrapper.sh

It shares the same binary and libraries as the daemon but is launched as a temporary instance by Univer itself.

Web Panel

After restarting DSH, a capsule appears at the top left (configurable position and appearance); clicking it opens the browser window (Web / Operations / Console / Network / Settings), with a live interactive view in the center. Resolution, margins, and network log clearing limits can be adjusted in the settings area.

Use Cases and Notes

Who is it for: Developers running DSH in the web profile, deployed on containers/servers without GUI, root, or under seccomp restrictions, who need a stable browser_* toolchain or visualized debugging of web automation.

Permissions and Security: The plugin runs with the same permissions as the current DSH process; before installation, you should read the GitHub Repository source code and the MIT license, and independently assess whether to introduce transitive dependencies like dsh-builtin-browser.

Environment: Requires Node >= 22.19; requires chrome-headless-shell available locally or in a userspace directory (or the binary and libraries pointed to by the wrapper described in the README).

Ecosystem Notes: DSH advocates “Everything is a plugin”; the SkillHub Directory Page is a community collection site and has no official affiliation with DeepSeek / High-Flyer. GitHub stars in the repository are based on the page (the clue at the time of writing was 0).

Conclusion

dsh-browser-service bundles “Singleton CDP + Token Gate + 33 Tools + Web Live View” into one package, specifically aligning with DSH’s browser seams in environments without Electron and without root. The installation command follows the README: dsh plugin --profile web add dsh-browser-service@latest. After restart, simply verify browserProvider: cdp-daemon to start using it.

  • Directory Page: https://www.skillhub.cn/plugins/lyp88997/dsh-browser-service
  • Source Code and Documentation: https://github.com/lyp88997/dsh-browser-service
羽毛球分组比赛记分
小程序二维码

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

Xiaoye