Introduction¶
When running DeepSeek Harness (DSH) locally, launching the Web GUI via dsh web causes the browser to land on a plain-text authentication page prompting for a ?token= parameter. This one-time login link is passed to the Electron window via IPC, is never written to disk, and cannot be directly copied into the browser’s address bar. Developers are required to switch back to the desktop app to view and copy the link each time before opening it in the browser.
The dsh-browser-mode plugin adds a “Browser Mode” button next to the “Restart” button in the Windows desktop app’s title bar. Clicking it opens the already-authenticated Web GUI directly in the default browser, eliminating the need to copy links and manually switch between windows.
Plugin Overview¶
dsh-browser-mode is a DSH client plugin developed by maintainer Tino0713. It injects a button into the desktop title bar and leverages the host’s existing credential service to issue a browser cookie, enabling a seamless login transition from the desktop app to the Web GUI.
Core Capabilities¶
1. Button Injection¶
The plugin injects a “Browser Mode” button next to the “Restart” button in the Windows desktop title bar. The button only appears in the desktop shell; regular browser tabs have no title bar, so the login session belongs to the desktop application rather than the browser.
2. Login Flow¶
The login process is completed within the host process and does not rely on manual interaction:
- The plugin reads the
client-connection/browser-sessionpermission record, which is the credential used by the connection service to issue cookies. - It checks whether the default browser already holds a valid cookie for that domain. If so, clicking the button opens the Web GUI directly.
- If not, the plugin issues a new cookie in memory (7-day expiry, HttpOnly, SameSite=Strict) and generates a one-time login link.
- The link carries an 18-byte random nonce, is single-use, and expires after 2 minutes.
- The link only installs a cookie for the current domain, preventing cross-site contamination.
- The link is kept in memory and never written to disk. - The plugin opens the default browser and navigates to the Web GUI, which is already in a logged-in state.
- If the default browser fails to launch, the plugin displays the URL in a dialog, allowing manual opening.
3. Security Design¶
- Credential reading: Uses
ctx.credentials.readRecord, solely for a one-time HMAC signature. Credentials are not logged, echoed, or returned in responses. - Request validation:
POST /dsh-browser-mode/openmust carry thex-dsh-browser-mode: 1header. Cross-site form submissions cannot set this header, preventing CSRF. - Login link: Random nonce, single-use, 2-minute expiry, and installs cookies only for the current domain.
- Logging: Records a single line of event log to
~/.dsh/dsh-browser-mode.log, containing no keys or cookie values.
4. Login State¶
The browser-side cookie is valid for 7 days. After expiry, the user must click the button again to re-authenticate. Login itself does not alter Web GUI page content or remote connection restrictions.
Installation and Activation¶
Install from Directory¶
- Place the plugin directory locally.
- In the DSH desktop app, go to Plugins → Add plugin.
- Select the directory.
Using the Plugin Manager¶
plugin_manager install_bundle target = <path to this package>
The plugin requires no build step and has no additional dependencies. It takes effect immediately after installation.
Typical Usage¶
- Launch the DeepSeek Harness desktop application.
- Locate the “Browser Mode” button in the title bar (to the right of the “Restart” button).
- Click “Browser Mode”.
- The default browser opens the Web GUI with the page showing a logged-in state.
Use Cases and Notes¶
- Target audience: Developers who frequently switch between the desktop app and the Web GUI and want to avoid manually copying login links.
- Environment requirements: Windows desktop app only. The host must be accessed via local HTTP (e.g.,
127.0.0.1:port). Different hostnames require separate button clicks. - Permission scope: The plugin runs with the current DSH process’s permissions. It is recommended to review the source code and license before installation.
Conclusion¶
dsh-browser-mode reduces the friction of switching between the desktop app and the browser by injecting a login button into the desktop title bar, transforming the authentication flow from manually copying links to a single click. For more details or to report issues, visit the plugin directory or the GitHub repository.
- Plugin directory: https://www.skillhub.cn/plugins/Tino0713/dsh-browser-mode
- GitHub repository: https://github.com/Tino0713/dsh-browser-mode