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 Antigravity Edge 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-1.2.0.tar.gz (58.5 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-1.2.0-py3-none-any.whl (45.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: edge_agent_bridge-1.2.0.tar.gz
  • Upload date:
  • Size: 58.5 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-1.2.0.tar.gz
Algorithm Hash digest
SHA256 30120fe3a081e3c1c01389e3cdea8a67eb3c05c172bf5f95cd47f19ff3596615
MD5 b01a6169f41946b68461bf3457c4404f
BLAKE2b-256 1025162cc3190a688c3c485edf5be513b07adfbf58aa12715f853a7cfc2878ae

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for edge_agent_bridge-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c512a5f1b1a6dbe430a6a0ef8d3ba54ce631dad128db9a9f5807f610c907e856
MD5 34911442e309af1adde44005a047f40e
BLAKE2b-256 32db2f0b69478188cab98f7cfa7994ef0f9070f10c0eef433a68ec762ff31fd2

See more details on using hashes here.

Release history Release notifications | RSS feed

2.0.2

2 files

2.0.1

2 files

2.0.0

2 files

1.2.1

2 files

This release

1.2.0 This release

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