Edge DOM Skill
Coordinates the connection architecture, JSON-RPC commands, and troubleshooting for the headed Edge DOM bridge extension.
Edge DOM Browser Skill
This skill defines the architecture, connection mechanics, supported commands, and troubleshooting guides for utilizing the Edge DOM browser (Edge DOM Bridge) in Antigravity.
I. Architecture & Setup
The Edge DOM browser allows direct programmatic interaction with the user's personal Microsoft Edge instance at the DOM level using a 3-piece bridge system:
- Edge Extension: An unpacked developer extension (global_workflows/edge_dom_bridge_extension/content.js) injected into every page.
- Location:
global_workflows/edge_dom_bridge_extension/ - Extension ID:
cdkodipddhcdfjgophblpnkcgepookpb
- Location:
- Native Messaging Host: A python script (global_workflows/edge_dom_bridge_extension/native_host.py) automatically spawned by Microsoft Edge.
- TCP Socket Server: Listens on loopback address
127.0.0.1:18900where scripts connect to send JSON-RPC commands.
[!CAUTION] FOREGROUND REQUIREMENT: 🚨 The DOM Bridge only reads the ACTIVE TAB. If automation requires switching tabs using Win32 keyboard events (like
Ctrl+Tab), Edge MUST be in the foreground. When executing these actions, you MUST put a bold message with red emojis (e.g., 🚨 WARNING: BRING EDGE TO FRONT 🚨) in your response so the user focuses the Edge window.
II. Connection Snippet
To send commands over the bridge, run a Python script via the run_command tool connecting to port 18900:
import socket
import json
def edge_dom(command):
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.settimeout(15)
sock.connect(("127.0.0.1", 18900))
sock.sendall(json.dumps(command).encode("utf-8") + b"\n")
response = b""
while b"\n" not in response:
chunk = sock.recv(65536)
if not chunk: break
response += chunk
sock.close()
return json.loads(response.decode("utf-8").strip())
# Example action: Retrieve active page metadata
result = edge_dom({"action": "get_page_info"})
print(json.dumps(result, indent=2))
III. Supported Commands
{"action": "get_page_info"}— Returns the URL, title, and current scroll position of the active tab.{"action": "get_all_text"}— Returns all visible text on the page.{"action": "get_text", "selector": "CSS_SELECTOR"}— Extracts text from a specific CSS selector.{"action": "get_elements"}— Returns a semantic element map with interactive tags (e.g.,@e1,@e2).{"action": "click", "selector": "CSS_SELECTOR"}— Click element by CSS selector.{"action": "click_tag", "tag": "@e5"}— Click element by its semantic bridge tag.{"action": "type", "selector": "CSS_SELECTOR", "text": "value"}— Type into an input element.{"action": "scroll", "amount": 500}— Scroll down by pixels.{"action": "get_value", "selector": "CSS_SELECTOR"}— Get value of an input field.{"action": "eval_selector", "selector": "CSS_SELECTOR"}— Evaluate element selector and return match count.
IV. Troubleshooting & Fallbacks
1. ConnectionRefusedError (WinError 10061)
If the socket connection is refused, verify the following:
- Is the Extension Enabled? Check
edge://extensionsand verify that the unpacked "Antigravity DOM Bridge" is ON. Edge restarts can sometimes silently disable unpacked extensions. - Refresh the Tab: The content script must be injected. Ask the user or programmatic navigation to refresh the active tab.
- Manifest ID Match: Check
allowed_originsin the native messaging manifest (global_workflows/edge_dom_bridge_extension/antigravity_dom_bridge.json). The extension ID MUST matchcdkodipddhcdfjgophblpnkcgepookpb. - Testing Tool: Run python global_workflows/edge_dom_bridge_extension/test_bridge.py to diagnose the connection.
2. HTTPS Only
The DOM Bridge works exclusively on https:// websites. It will time out or crash on localhost, chrome://, or edge:// URLs.
3. Shadow DOM Limitations
For pages rendering elements inside shadow DOM trees (such as Google Search Console), standard DOM commands will fail to query elements.
- Fallback: Switch to the Visible Browser (Playwright physical coordinates) or vision-based Point and Click direct clicks, which bypass DOM-traversal limitations.