Browser Bridge server and CLI for controlling a Chrome extension over WebSocket
Project description
browser-agent-bridge
Browser Bridge server + CLI for controlling a Chrome extension over WebSocket.
This repository contains:
- Python package:
browser_bridge/(server + CLI) - Chrome extension:
extension/(unpacked dev-mode install)
Features
- Session-based auth with separate
agent_tokenandextension_token - FastAPI server with HTTP command API + extension WebSocket endpoint
- CLI for session creation, status checks, and command execution
- Replay protection via
X-Request-ID
Install (Recommended: pipx)
python3 -m pip install --user pipx
python3 -m pipx ensurepath
pipx install browser-agent-bridge
Verify:
browser-bridge --version
browser-bridge-server --help
Upgrade:
pipx upgrade browser-agent-bridge
Install From Source
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
Quick Start
1) Start server
browser-bridge-server
Server defaults to http://127.0.0.1:8765.
2) Create session
browser-bridge create-session --name local
Example output:
{
"agent_token": "...",
"agent_token_expires_at": "...",
"extension_token": "...",
"extension_token_expires_at": "...",
"saved_as": "local",
"session_id": "...",
"ws_url": "ws://127.0.0.1:8765/ws/extension/...?..."
}
3) Load extension (unpacked)
- Open
chrome://extensions. - Enable
Developer mode. - Click
Load unpacked. - Select the
extension/folder from this repository. - Open extension popup and fill:
Bridge Server Base URL:http://127.0.0.1:8765Session ID: thesession_idfrom CLIExtension Token: theextension_tokenfrom CLI
- Click
Save, thenConnect.
4) Verify roundtrip
browser-bridge status --name local
browser-bridge observe --name local
Optional raw command examples:
browser-bridge command --name local --type get_html --payload '{"max_chars":50000}'
browser-bridge command --name local --type click --payload '{"selector":"button"}'
Server Configuration
Environment variables:
BRIDGE_JWT_SECRET(required for non-dev usage)BRIDGE_AGENT_TOKEN_TTL_S(default:3600)BRIDGE_EXTENSION_TOKEN_TTL_S(default:86400)BRIDGE_ALLOWED_ORIGIN_PREFIXES(comma-separated origin prefixes)
Security Notes
- Prototype is development-oriented.
- Tokens are sensitive. Do not share them.
- For non-local deployments, use
https://andwss://. - Set a strong
BRIDGE_JWT_SECRETfor any non-local usage.
Testing
pytest -v
Build
python -m build
python -m twine check dist/*
CI and Publishing
GitHub Actions workflows:
.github/workflows/ci.yml: tests + package checks.github/workflows/publish.yml: publishes to PyPI on tag push (v*)
PyPI trusted publishing setup
- Create project
browser-agent-bridgeon PyPI. - Add Trusted Publisher in PyPI settings:
- Owner: your GitHub org/user
- Repository: this repository
- Workflow:
publish.yml - Environment:
pypi
- In GitHub settings, create environment
pypi(optional protection rules).
Release
pytest -v
python -m build
python -m twine check dist/*
git tag v0.1.0
git push origin v0.1.0
Tag push triggers the publish workflow.
License
MIT (see LICENSE).
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file browser_agent_bridge-0.1.0.tar.gz.
File metadata
- Download URL: browser_agent_bridge-0.1.0.tar.gz
- Upload date:
- Size: 12.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f77a748c6aadf0df50290ab40d3b59f83f55be35103d7ba91e1d2247b60b01c
|
|
| MD5 |
d3e491f9e5aff50c1c457fab4a9a82e9
|
|
| BLAKE2b-256 |
3f757e05e2452489b02039abf872e20191d7774bda61eae8d236980772ba4f6f
|
Provenance
The following attestation bundles were made for browser_agent_bridge-0.1.0.tar.gz:
Publisher:
publish.yml on NmadeleiDev/browser_agent_bridge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
browser_agent_bridge-0.1.0.tar.gz -
Subject digest:
4f77a748c6aadf0df50290ab40d3b59f83f55be35103d7ba91e1d2247b60b01c - Sigstore transparency entry: 1023796425
- Sigstore integration time:
-
Permalink:
NmadeleiDev/browser_agent_bridge@fdb1967ce0c252357b3c3ad524394f8dc7055781 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/NmadeleiDev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@fdb1967ce0c252357b3c3ad524394f8dc7055781 -
Trigger Event:
push
-
Statement type:
File details
Details for the file browser_agent_bridge-0.1.0-py3-none-any.whl.
File metadata
- Download URL: browser_agent_bridge-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
937310d7504b55410996820c0e462fa7ffc485b80ecd4681c59ff3eaf2d7cee1
|
|
| MD5 |
5f4617fe9c1b9706511c753735816fbc
|
|
| BLAKE2b-256 |
65165d823238e1746d839e964c5a45deb7e1fc5495056d3b5b4f19ca40838804
|
Provenance
The following attestation bundles were made for browser_agent_bridge-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on NmadeleiDev/browser_agent_bridge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
browser_agent_bridge-0.1.0-py3-none-any.whl -
Subject digest:
937310d7504b55410996820c0e462fa7ffc485b80ecd4681c59ff3eaf2d7cee1 - Sigstore transparency entry: 1023796455
- Sigstore integration time:
-
Permalink:
NmadeleiDev/browser_agent_bridge@fdb1967ce0c252357b3c3ad524394f8dc7055781 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/NmadeleiDev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@fdb1967ce0c252357b3c3ad524394f8dc7055781 -
Trigger Event:
push
-
Statement type: