Skip to content

feat(extension): allow configuring Browser Bridge daemon port#1331

Open
Mr0bean wants to merge 7 commits intojackwener:mainfrom
Mr0bean:feat/extension-daemon-port-config
Open

feat(extension): allow configuring Browser Bridge daemon port#1331
Mr0bean wants to merge 7 commits intojackwener:mainfrom
Mr0bean:feat/extension-daemon-port-config

Conversation

@Mr0bean
Copy link
Copy Markdown

@Mr0bean Mr0bean commented May 5, 2026

Summary

Adds daemon port configuration support to the Browser Bridge extension so it can match OPENCLI_DAEMON_PORT in multi-profile or managed-browser environments.

Priority order:

  1. Saved extension setting from chrome.storage.local (opencli_daemon_port_v1), editable from the extension popup.
  2. Build-time OPENCLI_DAEMON_PORT injected by the extension Vite build.
  3. Default fallback port 19825.

Why

The CLI and daemon already support OPENCLI_DAEMON_PORT, but the extension previously used a build-time constant. That made it difficult for managed environments to run multiple isolated Browser Bridge daemon ports without rewriting the built extension output.

Changes

  • Replaces fixed extension daemon URLs with runtime URL builders.
  • Adds port parsing and fallback helpers.
  • Adds popup UI for manually saving/resetting the daemon port.
  • Injects OPENCLI_DAEMON_PORT during extension builds via Vite.
  • Documents custom daemon port usage.
  • Adds extension tests for port resolution priority and validation.

Verification

  • npm run typecheck --prefix extension
  • npx vitest run --project extension extension/src/background.test.ts
  • npx vitest run --project extension
  • OPENCLI_DAEMON_PORT=23456 npm run build --prefix extension verified build-time injection
  • npm run build --prefix extension rebuilt committed dist with default fallback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants