By default, PinchTab launches its own isolated Chrome instance. But sometimes you want to connect to an existing Chrome instead — to share one browser across multiple agents, save memory in container environments, or integrate with external Chrome setups. That’s whatDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/pinchtab/pinchtab/llms.txt
Use this file to discover all available pages before exploring further.
CDP_URL does.
What is CDP_URL?
CDP_URL is a WebSocket URL that points to Chrome’s DevTools Protocol server:
CDP_URL, PinchTab:
- ✅ Skips launching its own Chrome
- ✅ Connects to the browser at that URL
- ✅ Creates tabs in the existing browser
- ✅ Shares that browser’s session (cookies, localStorage, etc.)
Use Cases
Multi-Agent Resource Sharing
Problem: Multiple agents on the same machine each launching their own Chrome eats memory:Typical setup:
- Agent A handles browser operations (creates/controls tabs)
- Agent B handles data processing (reads via Agent A’s HTTP API)
- Agent C handles orchestration (no browser needed)
Integration Testing
Problem: Test scripts need to control the same browser in sequence:- Persistent session across tests (log in once, reuse)
- Simpler test setup (no per-test Chrome cleanup)
- Faster iteration (no Chrome startup overhead per test)
Container/Docker Deployments
Problem: Chrome runs in one container, your application in another:- Separate scaling (one Chrome for 10 PinchTab instances)
- Simpler networking (Chrome container = stable endpoint)
- Cleaner orchestration (containers talk via service names)
How to Use
Find the CDP URL
Start Chrome with--remote-debugging-port and query the endpoint:
Connect PinchTab
- Connect to the existing Chrome
- Discover existing tabs (if any)
- Create new tabs as requested
- Serve the HTTP API normally
Multi-Agent Example
Capabilities & Limitations
What works:- ✅ Creating tabs in existing Chrome
- ✅ Navigating to URLs
- ✅ Snapshots and actions
- ✅ Session persistence (cookies are stored in Chrome’s profile)
- ✅ Multiple PinchTab instances sharing one Chrome
- ❌ Launching Chrome from scratch (you have to start Chrome separately)
- ❌ Profile management (profiles belong to the remote Chrome, not PinchTab)
- Slightly higher latency per request (WebSocket to remote Chrome instead of local IPC)
- Memory savings: ~1.3GB per agent when sharing
Troubleshooting
Connection refused or Failed to open new tab
Connection refused or Failed to open new tab
Chrome might not have any windows open yet. Solution:
Invalid memory address error
Invalid memory address error
PinchTab failed to find a valid target. Make sure:
- Chrome is running with
--remote-debugging-port - The CDP_URL is correct (test with
curl) - Chrome has at least one window/tab open
Port and networking issues
Port and networking issues
Local machine only:Docker/Kubernetes (inter-container):Remote machine:
Configuration Reference
| Env Var | Default | Effect |
|---|---|---|
CDP_URL | (none) | WebSocket URL to remote Chrome. When set, PinchTab connects instead of launching |
BRIDGE_PORT | 9867 | Local HTTP port (independent of Chrome port) |
BRIDGE_HEADLESS | true | Ignored when using CDP_URL (remote Chrome state is independent) |
BRIDGE_PROFILE | ~/.pinchtab/chrome-profile | Session storage directory (still used even with CDP_URL) |
BRIDGE_NO_RESTORE | false | Skip restoring tabs from previous session |
Security
Local Machine (Safe)
If Chrome and PinchTab run on the same local machine:- Only processes on your machine can access it
- Other users on shared systems can still access it
- Docker containers on same host can access it
Network Exposure (Critical Risk)
Safe Network Access: SSH Tunnel
If Chrome runs on a remote machine:- ✅ Communication is encrypted (SSH tunnel)
- ✅ Remote Chrome is not exposed to the network
- ✅ Only you can access it (requires SSH login)
Docker/Kubernetes Best Practices
Security Checklist
- Chrome listens on
127.0.0.1(localhost only) or is SSH-tunneled - CDP port (9222) is not exposed to the network/internet
- No
--remote-debugging-address=0.0.0.0flag - Firewall blocks external access to the port (if on a server)
- Chrome profile directory has restricted permissions
- Only trusted agents/code have access to
CDP_URL - In containers: Chrome service is
ClusterIP, notLoadBalancer
Principle: Treat Chrome’s CDP port like you’d treat:
- An SSH port (gives shell access to a machine)
- A database port (gives data access)
- An admin panel (gives system control)