Bugfix: Why did the Chrome extension side panel show 'localhost refu...

Documentation for Sessions

🐛 Bugfix: Why did the Chrome extension side panel show 'localhost refu...

Date: 2026-02-11
Time: 15:15:35 UTC
Session: gspace1-105.6
Agent: angular
Confidence: 100%
Status: ✅ Documented


📋 Decision Context

Question:

Why did the Chrome extension side panel show 'localhost refused to connect' (ERR_CONNECTION_REFUSED) when loading the gograb-ai iframe?

Task: Session 105.3: Fix Chrome extension side panel ERR_CONNECTION_REFUSED


🎯 Decision Made

Chosen:

Port mismatch — the Chrome extension was loaded from editor2 workspace (port 5400) while gograb-ai was running on gspace1 workspace (port 6400). The extension's dev-ports.js and hardcoded URLs pointed to 5400 but the server was on 6400.

Options Considered:

  1. Chrome PNA (Private Network Access) enforcement blocking the iframe
  2. Missing CORS headers on the dev server
  3. Port mismatch — extension targeting wrong port for gograb-ai server
  4. Timing issue — iframe loading before dev server is ready

💭 Reasoning

The root cause was a workspace port mismatch. When the embeddable-bridge was first created, everything worked on editor2 (port 5400). After switching to gspace1 workspace (port 6400), the extension still referenced the old port. The extension was physically loaded from the editor2 directory, so its dev-ports.js had ai:5400. Additionally, the embeddable-bridge components had compile-time constants for port 5400. ERR_CONNECTION_REFUSED simply meant no server was listening on 5400 — not a CORS/PNA issue. We initially went down a PNA rabbit hole (adding declarativeNetRequest rules, proxy.conf.js OPTIONS handling, CSP headers) before discovering the simple port mismatch via screenshot analysis showing the iframe URL was localhost:5400 while the server ran on 6400.


📁 Files Involved


🔗 Related


Auto-generated by MCP Smart Consolidation