Skip to content

Add opt-in support for routing local HTML files - #32

Merged
damianh merged 1 commit into
devfrom
dh/consider-html-file-support
Sep 1, 2026
Merged

damianh merged 1 commit into
devfrom
dh/consider-html-file-support

Conversation

@damianh

@damianh damianh commented Sep 1, 2026

Copy link
Copy Markdown
Owner

Why

BrowserTamer supports file-extension based routing. Browser Wrangler only accepted http://, https://, and x-bw: targets, so local .htm/.html files could not be routed through rules. This adds parity while preserving current behavior for existing users.

What changed

  • Added a new HandleHtmlFiles config setting (default false) and a Settings toggle: Route local .htm/.html files.
  • Added LaunchTargetParser to normalize launch targets:
    • always accepts http://, https://, and x-bw:
    • when enabled, also accepts file:// URIs and rooted local .htm/.html paths (normalized to file://)
  • Updated launch and registration call sites (Program, MainWindow, WelcomeWindow, HealthPage, SettingsPage) to honor the setting.
  • Extended BrowserRegistration to conditionally advertise .htm and .html file associations and to re-register when association state no longer matches the configured mode.
  • Added focused tests for launch-target parsing, config defaults/round-tripping, and registration capability metadata.
  • Updated README feature list to document optional local HTML routing.

Notes for reviewers

  • HTML routing is intentionally opt-in to avoid surprising file-open behavior changes.
  • HTTP-specific preprocessing remains naturally no-op for file targets, while existing substitution behavior is preserved.

Add optional support for routing local .htm/.html files through Browser Wrangler so behavior stays aligned with BrowserTamer while preserving current defaults.

This adds a launch-target parser for file:// and local HTML paths, wires routing and registration to a new HandleHtmlFiles setting, updates the settings UI, and extends tests and docs.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@damianh
damianh merged commit ce1ee53 into dev Sep 1, 2026
2 checks passed
@damianh
damianh deleted the dh/consider-html-file-support branch September 1, 2026 14:12
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.

1 participant