DeepSeek Harness Plugin: Yandex Browser

Preface

In the DeepSeek Harness (DSH) environment, agent operations within a browser typically rely on ephemeral profiles. Each run starts a brand-new browser instance—no cookies, no logged-in state, and no access to user-installed extensions. This leaves the agent unable to reach authenticated pages or reuse a pre-configured environment.

This plugin resolves the problem by providing a persistent Yandex Browser profile along with page-control capabilities built on the Chrome DevTools Protocol (CDP). It allows the agent to work inside a single browser instance whose login state and extensions are preserved across sessions.

What Is This

This is a DeepSeek Harness plugin maintained by user DmitPerson42. Its core function is to launch a Yandex Browser instance with a persistent profile and expose CDP communication on port 9222, so that the agent can directly read and manipulate page content.

The plugin does not depend on MCP (Model Context Protocol); instead it communicates directly with the browser via CDP. It consists of three modules: yandex_browser (lifecycle management), yandex_page (reading content), and yandex_act (performing actions).

Core Features

The plugin communicates with the browser via the CDP protocol (default port 9222), with the profile stored at %USERPROFILE%\.dsh\browsers\yandex.

  1. yandex_browser: Lifecycle Management

    • status: Check browser running state, version, endpoint address, profile path, and currently open tabs.
    • start: Launch the browser. If it is already running, this command skips the startup process.
    • open: Open a specified URL in the browser. If the browser is not running, it will be started automatically first.
    • login: Open the login page (Yandex Passport by default) for the user to manually enter credentials.
    • tabs: List all currently open tabs.
    • close: Close the browser. Note: this closes all tabs but preserves the login state in the profile.
  2. yandex_page: Reading Pages

    • text: Retrieve page text along with descriptions of interactive elements (based on aria-label, title, placeholder) to help identify complex web components.
    • eval: Execute a JavaScript expression in the page context and return the result.
    • screenshot: Save a screenshot of the page. Supports the fullPage parameter to capture the entire page.
    • tabs: Return a list of tab IDs and mark the tabs created by the plugin.
  3. yandex_act: Page Actions

    • navigate: Go to a URL.
    • click: Click an element via a CSS selector or visible text.
    • type: Enter text into an input field (supports React forms), with an option to send Enter.
    • key: Simulate key presses (Enter, Tab, Escape, arrow keys, etc.).
    • activate: Activate and bring a specific tab into view.
    • close / close_created: Close a specified tab or close all tabs automatically created by the plugin.
    • wait: Wait for a specified element to appear.

Installation and Activation

Install the plugin via CLI:

dsh plugin --profile web add github:DmitPerson42/dsh-yandex-browser

After installation, the configuration file must be modified to enable the plugin. The plugin announces itself via dsh.bundle.patch and relies on cordis.patch.yml to inject configuration.

Add the following to ~/.dsh/profiles/web/cordis.patch.yml (adjust the path according to your actual environment):

- insert:
    - id: yandex-browser
      name: "file:///<your-user-dir>/.dsh/plugins/dsh-yandex-browser/lib/index.js"
      config:
        autoStart: true

Configuration options:
* autoStart: Set to true to automatically launch the browser when the plugin loads, ensuring subsequent commands are available.
* cdpEndpoint: Defaults to http://localhost:9222 (must use localhost rather than 127.0.0.1).
* profileDir: Defaults to %USERPROFILE%\.dsh\browsers\yandex.
* tabStateFile: Records tab IDs created by the plugin for later cleanup.

Typical Usage

A typical operation flow is as follows:

  1. Check browser status: yandex_browser action: "status".
  2. Open the target page: yandex_browser action: "open" url: "https://...".
  3. Read the page content to understand the current state: yandex_page action: "text".
  4. Perform click or input actions: yandex_act action: "click" selector: "..." or yandex_act action: "type" selector: "..." value: "...".

About Login:
The plugin itself does not automatically enter passwords. The agent needs to call yandex_browser action: "login", and the user manually enters their account and password in the popped-up browser window. To maintain the session, it is recommended to check “Remember me.”

About Tab Cleanup:
Tabs created by the plugin are temporary “junk data.” After a task is completed, yandex_act action: "close_created" must be called to close all tabs opened by the agent, keeping the environment tidy.

Use Cases and Precautions

This plugin is suitable for DSH scenarios that require long-term session operations in a browser environment, reuse of logged-in state, or the use of specific extensions.

Please note the following before using:
* Permissions Required: The plugin runs with the permissions of the current DSH process. Ensure the configuration directory has write access.
* Local Loopback: CDP connections must use localhost (supports IPv4/IPv6 dual stack); directly using 127.0.0.1 may fail due to differences in browser bind addresses.
* JS Syntax Limitation: In the args of cordis.patch.yml, the !!js syntax is not parsed. MCP server configurations (such as CDP endpoints) must use string literals and cannot use environment variable concatenation.
* Source Code Review: The plugin uses the MIT license, but before using it in a production environment, it is recommended to review the source code to ensure it meets security requirements.

Conclusion

By using this plugin, DSH agents gain the ability to work within a real browser environment. Combined with a persistent profile, they can handle tasks requiring login, extensions, or complex interactions in a more natural way.

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

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

Xiaoye