ds-browser-tabs: Let DSH Read the Browser's Rendered Content

Preface

When processing web page content, DeepSeek Harness (DSH) typically relies on web_fetch or clash_fetch. What they retrieve is the raw HTML source returned by the server: in Single Page Applications (SPAs), the initial render is often an empty shell, with the actual content being dynamically rendered by JavaScript—or even hidden inside a canvas element or a modal dialog. As a result, the model cannot see the content of the tab the user currently has open.

ds-browser-tabs solves this problem: it allows DSH to read the already-rendered content from a tab you already have open in your browser, including dynamically rendered text, tables behind popups, and more. This requires installing a browser extension and using the /browser command to trigger the read.

What It Is

  • Name: ds-browser-tabs
  • Maintainer: kiluahh
  • Category: Web tool
  • Description: A DeepSeek Harness plugin that lets the agent read the rendered content of the currently open Firefox or Chrome tab
  • Repository: https://github.com/kiluahh/ds-browser-tabs
  • License: MIT

Core value: lets the model see “what the browser actually displays” rather than the skeleton in the source code.

Installation & Setup

Installation has two parts: the host plugin and the browser extension.

  1. Install the host plugin: Load this directory as a local bundle into the current DSH profile. In DSH, use plugin_manager → install_bundle, or go to Settings → “Plugins” → “Add Local Directory.” Restart DSH after installation.

  2. Install the browser extension:
    - Chrome / Edge: Open chrome://extensions, enable “Developer mode” in the top-right corner, click “Load unpacked extension,” and select the extension/ directory in this project.
    - Firefox: First run node scripts/build-firefox.mjs to generate dist/firefox/, then load it following the “Firefox” section below.

  3. Configure the address: Click the extension icon and confirm the “DSH Address” matches the actual DSH Web address (default: http://127.0.0.1:3080). Leave the token field empty.

The extension requires the “Read and change all your data on all websites” permission, which is necessary for cross-site injection via chrome.scripting.executeScript. The extension only reads page text and takes screenshots; it does not send data to any third party.

Firefox Loading

The same extension codebase can be built for Firefox using node scripts/build-firefox.mjs (uses an event page instead of a service worker, with a Gecko ID):

dist/firefox/                      For temporary loading
dist/ds-browser-tabs-firefox.xpi   For installation from file

Temporary loading (works on both Release and ESR, resets on restart):

  1. Open about:debugging#/runtime/this-firefox in the address bar
  2. Click Load Temporary Add-on…
  3. Select dist/firefox/manifest.json
  4. Click the extension icon and confirm the address is http://127.0.0.1:3080

After Firefox is closed, you need to reload the temporary add-on again.

Permanent installation (Developer Edition / Nightly only):

  1. In about:config, set xpinstall.signatures.required to false
  2. Go to about:addons → gear icon (top-right) → Install Add-on From File → select dist/ds-browser-tabs-firefox.xpi

This switch does not take effect on Release or ESR: Firefox requires AMO signing for permanent extension installation. Temporary loading is a viable alternative.

Typical Usage

Command list (from the README):

Command Description
/browser Reads the first readable tab, same as item #1 in /browser list; DSH’s own page is not skipped
/browser <number> Reads by the index shown in /browser list, e.g. /browser 3
/browser list Lists readable tabs with numbers (★ marks the active tab); does not wake the model
/browser <keyword> Selects a tab by title/URL keyword and reads it; if multiple match, candidates are listed
/browser status Shows extension online status, WebSocket connection count, and last-seen time

A read-only tool browser_read is also included for the model to use when prompted with follow-ups like “check that tab again”—its semantics match the command behavior.

Multi-browser scenario: the request is routed to the browser that currently has focus on the window containing the DSH page—the extension reports focus changes in real time via windows.onFocusChanged, so whichever browser you are typing in is the one used. Changes take effect within about one second after switching. If no browser has focus, it falls back to the one “with a DSH page” or the most recently active one. The top of /browser list output states which browser the results came from, and /browser status lists all connected browsers and their focus states.

How It Works

Request flow:

You type /browser
  └─ Host places the read request into an in-memory queue
        └─ Extension (on persistent WebSocket) receives the task
              └─ Extension executes the extraction function in the target tab (rendered DOM)
                    └─ Returns the body; host assembles it into a user message → wakes the model

Why WebSocket: Chrome’s MV3 service worker is reclaimed after 30 seconds of idle time, so ordinary polling won’t survive more than half a minute. Chrome 116+ explicitly states that “an active WebSocket extends the worker’s lifetime, and each message resets the idle timer.” So the extension maintains a persistent WebSocket connection, and the host sends an application-level ping every 20 seconds. HTTP long-polling is retained as a fallback: it still works if the WebSocket is blocked by the environment.

The entire pipeline only activates after you type a command; there is no continuous page scraping.

Troubleshooting

Symptom Cause & Fix
Browser extension not detected The extension is not installed/enabled, or the address in the extension popup doesn’t match the DSH port. Click the extension icon in the toolbar first to wake it up.
Browser extension is sleeping Click the extension icon in the toolbar to wake it, then retry.
You just updated the plugin code Host plugin changes require a DSH restart; extension changes require clicking “Reload” in chrome://extensions.
Extension did not respond within 8 seconds The extension is online but was put to sleep by Chrome. Click the extension icon to wake it, or reload the extension.
This page does not allow extension injection Built-in pages such as chrome:// or the extension store cannot be read. Use a regular web page instead.
Extension token does not match DSH configuration A token is set in the host’s cordis.patch.yml; enter the same value in the extension popup.

Configuration

Optional overrides in the host’s cordis.patch.yml under config:

config:
  routePrefix: /dsh-browser-tabs   # Route prefix the extension connects back to
  token: ''                        # If non-empty, the extension token will be validated
  timeoutMs: 8000                  # Timeout for a single read

Use Cases & Notes

Ideal for scenarios where the model needs to directly see “what is actually rendered in the browser,” such as:
- Analyzing currently open API documentation or internal system pages
- Extracting data from e-commerce or admin dashboard pages and passing it to the model for structuring
- Reading dynamically rendered tables and form content in SPA applications

Notes:
- Read-only: no clicking, no typing, no scrolling.
- Only visible text is captured (innerText semantics), not the accessibility tree; canvas / WebGL content has no readable text.
- Content inside cross-origin iframes and closed shadow roots is not accessible.
- No page content is persisted; the read text only enters the session log and is treated the same as content you paste in yourself.

The plugin runs with the permissions of the current DSH process. Review the source code and license before installing.

In Summary

ds-browser-tabs enables DSH to directly read the rendered output of browser tabs, eliminating the mismatch between source code and visual presentation. Full documentation and source code are available in the project directory and the GitHub repository.

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

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

Xiaoye