Introduction¶
In the DSH ecosystem, browser automation is often limited to a fixed list of tools. When encountering operations that are not predefined, scripts often struggle to proceed. The dsh-tmwebdriver plugin provides a breakthrough solution: it is no longer constrained to preset actions, but allows agents to execute arbitrary JavaScript in a real, already logged-in browser tab. This means that any work a developer can accomplish in Chrome DevTools can be completed by an agent through browser_execute_js, without needing to update the plugin code.
Plugin Introduction¶
dsh-tmwebdriver is a DSH plugin maintained by chen70456-lang and belongs to the web tools category. By integrating the TMWebDriver component, it enables control of a real Chrome browser. Its core value lies in providing an “unlimited coverage” capability—through JavaScript execution, allowing agents to handle any DevTools-level operation, including reading pages, clicking, typing, taking screenshots, managing Cookies, and driving CDP.
Core Features¶
The plugin provides the following main tools:
- browser_execute_js
This is the core tool. It allows arbitrary JavaScript code to be executed in the real context of the current browser. It covers reading, clicking, typing, filling forms, navigating, taking screenshots, reading Cookies, and driving the Chrome DevTools Protocol (CDP). - browser_list_tabs
View all open tabs and returns the ID, URL, and title of each tab. - browser_snapshot
Quickly reads the text content of a page. To prevent long pages from being truncated, this tool preserves the beginning and end of the content. - browser_type
Provides reliable text input capabilities, compatible with modern frontend frameworks such as React and Vue, and supports form submission.
Installation and Enablement¶
The installation process consists of three steps:
- Install the plugin
Use the official installation command. This command fetches the plugin package and its included Python dependencies, Chrome extension, and main program.
dsh plugin --profile web add dsh-tmwebdriver
-
Restart the service
After installation, you must restart thedsh webprocess to load the new plugin. -
Load the Chrome extension
The plugin package includes a Chrome extension component. On first use, it must be manually loaded in the browser once. The plugin will print the exact path. If you forget the path, thebrowser_list_tabstool will remind you of the specific loading steps.The specific path is located in the
assets/tmwd_cdp_bridge/directory within the package.
Typical Usage¶
The plugin supports a wide range of automation scenarios, including but not limited to:
- Basic interactions: reading page content, clicking elements, entering text, submitting forms, and navigating to a new page.
- Advanced operations: taking screenshots, reading Cookies, and executing arbitrary JavaScript scripts.
- Real-world demonstration: The plugin includes a built-in demo that opens Baidu, enters a weather query, and reads the result component.
Configuration Parameters¶
After installation, the following parameters can be adjusted through the configuration file:
| Parameter | Default Value | Description |
|---|---|---|
linkUrl |
http://127.0.0.1:18766/link |
The HTTP link endpoint for TMWebDriver. |
timeoutMs |
30000 |
The timeout for a single call (milliseconds). |
snapshotMaxChars |
8000 |
The maximum number of characters returned by a single browser_snapshot. |
Applicable Scenarios and Ecosystem¶
The plugin is especially suitable for scenarios that require passing CAPTCHAs, maintaining logged-in states, or operating complex JavaScript applications. By using real browser fingerprints and native Cookies, it can effectively bypass common anti-scraping strategies of Headless Chrome (such as Baidu and Cloudflare).
The plugin integrates two components of the GenericAgent toolchain:
* TMWebDriver master (master/tmwebdriver_master.py)
* Chrome extension bridge (assets/tmwd_cdp_bridge/)
All code is released under the MIT license. The DSH plugin catalog has no official affiliation with DeepSeek or Huanfang.