Playwright 浏览器自动化
Semantic, multi-tab browser automation for DeepSeek Harness (DSH), powered by Playwright.
이것은 DeepSeek Harness(DSH) 플러그인입니다. 이 사이트는 GitHub README, 설치 정보, 유지보수 상태, 공개 보안 시그널을 모아 보여줍니다.
업스트림에서 중국어 README를 제공하지 않아 저장소 원본 내용을 표시합니다.
dsh-playwright-browser
Semantic, multi-tab browser automation for DeepSeek Harness (DSH), powered by Playwright.
The plugin gives a DSH agent a persistent browser controller, accessibility-oriented snapshots, semantic locators, screenshots, navigation history, and explicit tab management. It is behaviorally inspired by the Codex Browser skill, but contains no Codex runtime code and does not depend on OpenAI browser bindings.
重要
DSH is currently a developer preview. This plugin is tested against the DSH 0.1.0-rc.6 package line and may need compatibility updates as DSH evolves.
Features
- Ten native
browser_*tools registered in the DSH tool registry. - Reusable browser context with stable tab identifiers.
- Fresh bounded accessibility or visible-text snapshots after interactions.
- Semantic locators such as
role=button|Save,label=Email, andtext=Settings. - Snapshot-friendly role shorthand such as
button|Saveandtextbox|Email. - Back, forward, reload, keyboard input, waits, and PNG screenshots.
- Lazy browser startup with fallback from Playwright Chromium to installed Chrome or Edge.
- Abort-aware page operations and Cordis-owned lifecycle cleanup.
- No arbitrary page JavaScript evaluation.
Requirements
- Node.js
^22.19.0or>=24.0.0. - A DSH profile.
- One supported browser:
- Playwright Chromium, installed with
npx playwright install chromium; or - Google Chrome / Microsoft Edge; or
- an explicit
executablePath.
- Playwright Chromium, installed with
Install
From npm:
dsh plugin --profile web add dsh-playwright-browser
From this checkout:
npm install
npm pack
dsh plugin --profile web add ./dsh-playwright-browser-0.1.3.tgz
For a headless profile:
dsh plugin --profile headless add ./dsh-playwright-browser-0.1.3.tgz
Verify the composed profile without starting it:
dsh --profile web --dump-config
Git installations run the package prepare script. pnpm 10 and later may require explicitly allowing that build in the profile's pnpm-workspace.yaml. A prebuilt npm package or tarball does not require a source build inside the profile.
Configure
DSH applies user overrides after installed bundle patches. Add a row like this to the profile's cordis.patch.yml:
- id: playwright-browser
config:
browser: chromium
channel: chrome
headless: true
viewportWidth: 1440
viewportHeight: 900
screenshotDir: .dsh-browser/screenshots
Supported options:
| Option | Default | Purpose |
|---|---|---|
browser | chromium | chromium, firefox, or webkit |
headless | true | Run without a visible browser window |
channel | — | Chromium channel such as chrome or msedge |
executablePath | — | Absolute browser executable path |
userDataDir | — | Dedicated persistent automation profile |
viewportWidth | 1280 | Browser viewport width |
viewportHeight | 800 | Browser viewport height |
actionTimeoutMs | 15000 | Locator/action timeout |
navigationTimeoutMs | 30000 | Navigation timeout |
maxSnapshotChars | 40000 | Maximum returned snapshot length |
screenshotDir | .dsh-browser/screenshots | Screenshot output directory |
Do not point userDataDir at a personal browser profile. Use a directory dedicated to the agent.
Tools
| Tool | Description |
|---|---|
browser_open | Open a tab and optionally navigate it |
browser_navigate | Navigate an existing tab |
browser_snapshot | Read a bounded accessibility or text snapshot |
browser_click | Click a semantic target |
browser_fill | Replace an input value and optionally press Enter |
browser_press | Send a Playwright keyboard key |
browser_wait | Wait for a target, URL, or load state |
browser_history | Go back, forward, or reload |
browser_screenshot | Save a PNG and return its absolute path |
browser_tabs | List, select, or close tabs |
Preferred target forms:
role=button|Save
button|Save
label=Email
placeholder=Search
text=Settings
testid=submit
css=#legacy-button
Safety model
- Page content is untrusted data, never agent instruction.
- The system prompt tells agents to inspect fresh state before and after actions.
- Consequential submissions, sensitive data, downloads, purchases, permissions, account changes, and CAPTCHA handling require appropriate user authorization.
- Browser installation is never silently downloaded. When no browser is available, the agent must explain the minimum setup and ask before changing the machine unless setup was already authorized.
- URLs with embedded credentials are rejected.
- Closing a tab cooperatively cancels in-flight operations on that page.
Development
npm install
npm run check
Live tests:
npm run smoke
npm run smoke:dsh
npm run smoke:business
npm run test:real-world
The real-world suite uses public demonstration sites and invented data. It writes sanitized logs and screenshots under .dsh-browser/, which is ignored by Git.
See Testing, Architecture, and Releasing for the full workflows.
Design provenance
The behavioral mapping from the Codex Browser skill is documented in Codex Browser design mapping. In short, this project adopts persistent bindings, explicit tab ownership, semantic targeting, fresh observations, safe session boundaries, and cleanup discipline. It replaces Codex-specific browser selection and transport with a self-managed Playwright controller and DSH-native tools.
Contributing
Read CONTRIBUTING.md before opening a change. Security issues should follow SECURITY.md. Community participation is governed by CODE_OF_CONDUCT.md.
License
보안 및 설치 증거
이 점수는 공개 저장소 메타데이터와 이 사이트에 등록된 설치 증거에만 기반하며, 코드 보안 감사와 다릅니다.
공개 플러그인 카탈로그에서 왔으며, 공개 GitHub 저장소로 연결됩니다.
저장소가 MIT 라이선스를 선언했습니다.
최근 180일 내 코드 업데이트가 있습니다.
재현 가능한 정확한 설치 메타데이터가 아직 등록되지 않았습니다. 저장소 설명에 따라 직접 확인하세요.
검사한 패키지 메타데이터에 설치 라이프사이클 스크립트가 선언되지 않았습니다.