Update README to reflect removal of HTTP server mode
- Remove obsolete Server Mode section (removed in 3014cf9)
- Update plugin installation commands to correct syntax
- Remove startServer from programmatic usage (no longer exported)
- Remove BrowserServer API section (class removed)
- Add close tool to MCP tools reference
- Sync plugin.json version to 0.2.13-pre.0
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "browse",
|
"name": "browse",
|
||||||
"description": "Browser automation and image processing tools for Claude Code using Playwright WebKit",
|
"description": "Browser automation and image processing tools for Claude Code using Playwright WebKit",
|
||||||
"version": "0.2.10",
|
"version": "0.2.13-pre.0",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "aladac",
|
"name": "aladac",
|
||||||
"url": "https://github.com/aladac"
|
"url": "https://github.com/aladac"
|
||||||
|
|||||||
@@ -37,65 +37,19 @@ browse -c ".cookie-accept" -c "a.nav-link" -q "h1" https://example.com
|
|||||||
browse -i --headed https://example.com
|
browse -i --headed https://example.com
|
||||||
```
|
```
|
||||||
|
|
||||||
## Server Mode
|
|
||||||
|
|
||||||
Start a persistent browser server that accepts commands via HTTP:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
browse -s 3000 # headless
|
|
||||||
browse -s 3000 --headed # visible browser
|
|
||||||
```
|
|
||||||
|
|
||||||
Send commands:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Navigate
|
|
||||||
curl -X POST localhost:3000 -d '{"cmd":"goto","url":"https://example.com"}'
|
|
||||||
|
|
||||||
# Click
|
|
||||||
curl -X POST localhost:3000 -d '{"cmd":"click","selector":"button.submit"}'
|
|
||||||
|
|
||||||
# Type
|
|
||||||
curl -X POST localhost:3000 -d '{"cmd":"type","selector":"#search","text":"hello"}'
|
|
||||||
|
|
||||||
# Query elements
|
|
||||||
curl -X POST localhost:3000 -d '{"cmd":"query","selector":"a[href]"}'
|
|
||||||
|
|
||||||
# Screenshot
|
|
||||||
curl -X POST localhost:3000 -d '{"cmd":"screenshot","path":"page.png"}'
|
|
||||||
|
|
||||||
# Get current URL
|
|
||||||
curl -X POST localhost:3000 -d '{"cmd":"url"}'
|
|
||||||
|
|
||||||
# Get page HTML
|
|
||||||
curl -X POST localhost:3000 -d '{"cmd":"html"}'
|
|
||||||
|
|
||||||
# Navigation
|
|
||||||
curl -X POST localhost:3000 -d '{"cmd":"back"}'
|
|
||||||
curl -X POST localhost:3000 -d '{"cmd":"forward"}'
|
|
||||||
curl -X POST localhost:3000 -d '{"cmd":"reload"}'
|
|
||||||
|
|
||||||
# Wait
|
|
||||||
curl -X POST localhost:3000 -d '{"cmd":"wait","ms":2000}'
|
|
||||||
|
|
||||||
# Close server
|
|
||||||
curl -X POST localhost:3000 -d '{"cmd":"close"}'
|
|
||||||
```
|
|
||||||
|
|
||||||
## Claude Code Plugin (Recommended)
|
## Claude Code Plugin (Recommended)
|
||||||
|
|
||||||
Install as a Claude Code plugin for the best integration:
|
Install as a Claude Code plugin for the best integration:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Via marketplace (recommended)
|
# Install from GitHub
|
||||||
claude plugin marketplace add https://github.com/saiden-dev/claude-plugins
|
|
||||||
claude plugin install browse
|
|
||||||
|
|
||||||
# Or direct from GitHub
|
|
||||||
claude plugin install github:saiden-dev/browse
|
claude plugin install github:saiden-dev/browse
|
||||||
|
|
||||||
|
# Or load locally for development
|
||||||
|
claude --plugin-dir /path/to/claude-browse
|
||||||
```
|
```
|
||||||
|
|
||||||
**Prerequisites:** Node.js 18+ (the MCP server runs via npx)
|
**Prerequisites:** Node.js 18+, Playwright WebKit (`npx playwright install webkit`)
|
||||||
|
|
||||||
### Plugin Features
|
### Plugin Features
|
||||||
|
|
||||||
@@ -160,6 +114,7 @@ Add to Claude Code's MCP config (`~/.claude/settings.json`):
|
|||||||
| `upload` | Upload files to a file input |
|
| `upload` | Upload files to a file input |
|
||||||
| `back`, `forward`, `reload` | Browser navigation |
|
| `back`, `forward`, `reload` | Browser navigation |
|
||||||
| `wait` | Wait for a specified time |
|
| `wait` | Wait for a specified time |
|
||||||
|
| `close` | Close the browser and end session |
|
||||||
|
|
||||||
**Debugging & Inspection:**
|
**Debugging & Inspection:**
|
||||||
| Tool | Description |
|
| Tool | Description |
|
||||||
@@ -222,9 +177,8 @@ Add to Claude Code's MCP config (`~/.claude/settings.json`):
|
|||||||
## Programmatic Usage
|
## Programmatic Usage
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { ClaudeBrowser, startServer } from '@saiden/browse';
|
import { ClaudeBrowser } from '@saiden/browse';
|
||||||
|
|
||||||
// Direct browser control
|
|
||||||
const browser = new ClaudeBrowser({
|
const browser = new ClaudeBrowser({
|
||||||
headless: true,
|
headless: true,
|
||||||
width: 1280,
|
width: 1280,
|
||||||
@@ -242,10 +196,6 @@ await browser.type('#input', 'hello');
|
|||||||
await browser.screenshot('page.png');
|
await browser.screenshot('page.png');
|
||||||
|
|
||||||
await browser.close();
|
await browser.close();
|
||||||
|
|
||||||
// Or start a server
|
|
||||||
const server = await startServer({ port: 3000, headless: false });
|
|
||||||
// Server runs until closed via HTTP or SIGINT
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## API
|
## API
|
||||||
@@ -304,12 +254,6 @@ const server = await startServer({ port: 3000, headless: false });
|
|||||||
**Commands:**
|
**Commands:**
|
||||||
- `executeCommand(cmd)` - Execute a command object
|
- `executeCommand(cmd)` - Execute a command object
|
||||||
|
|
||||||
### BrowserServer
|
|
||||||
|
|
||||||
- `start()` - Start HTTP server
|
|
||||||
- `stop()` - Stop server and close browser
|
|
||||||
- `getPort()` - Get server port
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
MIT
|
MIT
|
||||||
|
|||||||
Reference in New Issue
Block a user