Skip to main content

Edge Agent Bridge

PyPI - Version GitHub Release PyPI - Python Version License: MIT GitHub Sponsors Buy Me A Coffee

Control your real, active Microsoft Edge tabs directly from Python scripts and CLI commands.

Standard browser automation frameworks like Playwright, Puppeteer, and Selenium always spin up clean temporary profiles that don't have your logged-in cookies, which ends up triggering bot checks or breaking on company SSO portals. Edge Agent Bridge skips that headache by attaching straight to your running browser window, so you don't lose your active session, enterprise VPN, or saved logins. It dispatches hardware-level inputs through Chrome DevTools Protocol over a local RFC 6455 WebSocket.


Measured Benchmarks

Hard benchmark and stress test suite executed against live Microsoft Edge tabs (tests/test_benchmark_hard.py):

Gate Category Load & Conditions Result Target Status
BM-01 WebSocket Latency 200 sequential calls P50: 9.09 ms (Min: 5.89 ms, P95: 14.35 ms) P50 < 20 ms PASS
BM-02 Action Batching 50 ops batched vs sequential 7.9x speedup (Batched: 140 ms / 356 ops/s vs 1103 ms) >= 3.0x PASS
BM-03 Native Click Burst 100 rapid-fire CDP clicks 100/100 clicks, 100% isTrusted: true, 0 dropped 100% trusted PASS
BM-04 Typing Integrity 55 chars Unicode + Symbols + Japanese 100% byte match in 216 ms (SkyPAS_AT 日本語...) Exact match PASS
BM-05 CSS :hover Cascade Multi-tier pure CSS dropdown sub1: block -> sub2: block -> clicked target Blink :hover PASS
BM-06 CDP Mouse Drag 300px coordinate drag over 15 steps Dropped successfully in 612 ms Valid drop PASS
BM-07 Massive DOM Scanner 3,000 synthetic DOM elements 2,253 interactive elements scanned in 134.8 ms < 350 ms PASS
BM-08 Screenshot Capture Viewport PNG capture + Base64 decode 111.2 ms avg per screenshot (99.8 KB PNG) < 300 ms PASS
BM-09 Tab Query Lifecycle Query open tabs & active tab ID 12 Edge tabs queried in 11.9 ms Active tab ok PASS

Run the Benchmark Suite Locally

python tests/test_benchmark_hard.py

Installation

pip install edge-agent-bridge

Runs on Python 3.8+ without installing external packages.


Fast Setup

1. Install the Microsoft Edge Extension

You can install the extension via either method:

  • Method A (Microsoft Edge Add-ons Store): Install the official Edge Agent Bridge extension from the Microsoft Edge Add-ons Store.
  • Method B (Developer Mode / Unpacked):
    1. Open edge://extensions in Edge and toggle Developer mode on.
    2. Run in terminal:
      edge-bridge extension open
      
    3. Click Load unpacked and select that directory.

2. Verify Connection

Run in terminal:

edge-bridge status

When Microsoft Edge is open, the bridge daemon connects instantly over 127.0.0.1:18999 with sub-15ms WebSocket latency.


Python API

from edge_agent_bridge import Edge

with Edge() as browser:
    tab = browser.tab()
    print("Active:", tab["tab"]["title"])

    browser.nav("https://news.ycombinator.com")
    browser.hover("past")
    browser.click("comments")
    browser.fill("Search:", "AI agents")

    elements = browser.elements()
    print(f"Found {len(elements)} targets")

    browser.screenshot("hn.png")

Command Line Interface

# Check daemon and socket state
edge-bridge status

# Query active tab
edge-bridge tab

# List open tabs or jump to specific ID
edge-bridge tabs
edge-bridge switch 1234

# Hover by visible text label or coordinates
edge-bridge hover "Settings"
edge-bridge hover --x 450 --y 320

# Hardware click with trusted events
edge-bridge click "Sign In"
edge-bridge click "#submit-button"

# Double click, right click, or drag and drop
edge-bridge dblclick "File_01.pdf"
edge-bridge rightclick "Folder A"
edge-bridge drag "Task 1" "Done Column"

# Fill inputs and dispatch keyboard keys
edge-bridge fill "Search query" "LangChain vs AutoGPT"
edge-bridge key Enter
edge-bridge key Ctrl+A

# Extract element text or take viewport snapshots
edge-bridge text "#results-count"
edge-bridge screenshot output.png

# In-memory action batching (single round-trip multi-step execution)
edge-bridge batch '[{"action":"click","x":450,"y":320},{"action":"sleep","ms":50},{"action":"fill","target":"Search","text":"AI Agents"}]'

Interactive REPL

If you're running repeated actions and want to skip Python startup overhead, launch the interactive shell:

edge-bridge repl
=== Edge Bridge Real-Time Interactive REPL ===
edge> tab
[11.8ms] {"success": true, "tab": {"id": 1459, "title": "GitHub"}}
edge> click "Pull requests"
[14.2ms] {"success": true, "x": 380, "y": 96, "native": true}
edge> fill "Type / to search" "bugfix"
[18.9ms] {"success": true, "text": "bugfix", "native": true}

Architecture & Security Model

  • RFC 6455 Streaming & Frame Reassembly: Full support for multi-frame continuation sequences (opcode=0) when Chromium fragments payloads >64KB (full-page DOM dumps, multi-megabyte screenshots).
  • Fast Integer-XOR Unmasking: Standard-library integer XOR unmasks multi-megabyte WebSocket payloads in <1ms without C-extensions or external dependencies.
  • Localhost only: The daemon binds strictly to 127.0.0.1:18999 and refuses remote network traffic.
  • Origin check: Any browser page attempting to open ws://127.0.0.1:18999/ws gets rejected with 403 Forbidden, meaning web pages you browse cannot hijack the bridge.
  • Zero telemetry: Nothing leaves your computer. Zero external network calls.

Support & Sponsorship

Edge Agent Bridge is built by Shanewas Ahmed.

If this project saves you engineering hours or simplifies your agent workflows, consider supporting its development:

Sponsorship helps fund keeping CDP handlers aligned with rapid Chromium engine updates and maintaining zero-dependency Python packages.


License

MIT License. See LICENSE for details.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

edge_agent_bridge-2.0.0.tar.gz (72.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

edge_agent_bridge-2.0.0-py3-none-any.whl (68.0 kB view details)

Uploaded Python 3

File details

Details for the file edge_agent_bridge-2.0.0.tar.gz.

File metadata

  • Download URL: edge_agent_bridge-2.0.0.tar.gz
  • Upload date:
  • Size: 72.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.4

File hashes

Hashes for edge_agent_bridge-2.0.0.tar.gz
Algorithm Hash digest
SHA256 78e9076c0df23dd7d7e1218bf1055a5026368db85e0a2d8eddce47c9c046f07b
MD5 a409c44d8e8f5e6c424cb8d9f0e518bb
BLAKE2b-256 c676772ace0d87eeaa2d6f4e7914fa7fa551bfab6a48b5e3b3f6c26306436858

See more details on using hashes here.

File details

Details for the file edge_agent_bridge-2.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for edge_agent_bridge-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d3974cdd2100d6844444ebf5ed2e7e596327f6d1e571bc3484be3a8b38217ce3
MD5 893f9f60088fc3a8b314ce73a5e75fd8
BLAKE2b-256 4dc55c0e44d5d5cee77d9655df9012a1d71416a1359349aab7caf466f5d92528

See more details on using hashes here.

Release history Release notifications | RSS feed

2.0.2

2 files

2.0.1

2 files

This release

2.0.0 This release

2 files

1.2.1

2 files

1.2.0

2 files

1.1.2

2 files

1.1.1

2 files

1.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page