Skip to content

fix(launcher): caller flags override ours; report the engine we actually run - #72

Merged
ralyodio merged 1 commit into
mainfrom
fix/launcher-flag-override
Aug 3, 2026
Merged

fix(launcher): caller flags override ours; report the engine we actually run#72
ralyodio merged 1 commit into
mainfrom
fix/launcher-flag-override

Conversation

@ralyodio

@ralyodio ralyodio commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Two launcher fixes that came out of chasing "TronBrowser got slow today."

1. Caller flags were silently ignored

FLAGS is placed before "$@", and Chromium honors the first occurrence of a switch. So tron --user-data-dir=/tmp/scratch produced two --user-data-dir flags and the browser opened the default profile anyway. A duplicated --user-data-dir can also fault the process — that is what a local SIGSEGV traced back to.

Now any switch of ours that the caller also passes is dropped, so theirs is the only one left.

--enable-features / --disable-features merge rather than being replaced — they're comma-separated lists, and dropping ours wholesale would re-enable the Manifest V2 kill switch (uBlock Origin stops loading) just because someone wanted one unrelated feature.

The dedupe deliberately runs before the Tor block. Tor's proxy flags are a guarantee, not a preference; appending them afterward keeps them first on the command line, where a caller-supplied --proxy-server cannot displace them.

2. Nothing recorded which engine actually ran

TronBrowser ships no engine — apps/desktop/launcher/tronbrowser drives whatever Ungoogled Chromium is on the system, and the bundled-binary branch ($DIR/chrome) is still a stub. On Linux that is usually the Flathub Flatpak, which updates itself.

So a Flathub push can change every user's browser overnight while TronBrowser's own history shows nothing, and the resulting regression in scrolling, video or compositing arrives as a TronBrowser bug against a release that touched none of it. There was no way to tell from the logs.

The launcher now prints the engine version and source on every launch, and when it differs from last launch says so explicitly:

TronBrowser: the browser engine CHANGED since your last launch.
  was: 141.0.7390.65 — flatpak io.github.ungoogled_software.ungoogled_chromium a1b2c3d4e5f6
  now: 149.0.7827.196 — flatpak io.github.ungoogled_software.ungoogled_chromium 9f8e7d6c5b4a
  TronBrowser did not do this — your system updated Chromium underneath it.
  If the browser now feels different (scrolling, video, GPU), start here.

Tests

The launcher had none — it is the one piece of TronBrowser with no compiler behind it. Added apps/desktop/test/launcher.test.ts, which runs the real script against a stub browser that records its argv.

  • 8 new tests pass; 135 tests pass across apps/desktop
  • Verified the new tests fail against the pre-fix launcher — it emits two --user-data-dir and two --enable-features
  • sh -n and dash -n clean (shellcheck not installed here)

extensions/ai-sidebar/moshpit-drift.test.js fails to load in a fresh worktree because @moshcoder/moshpit-resolve isn't installed there. Pre-existing and unrelated; it resolves in a checkout that has run pnpm install.

Not included

This does not explain the specific slowdown that prompted it — that still points at a Flatpak engine update, which is being confirmed separately. These two fixes are correct regardless of what that turns up.

🤖 Generated with Claude Code

… run

Our flags go on the command line before "$@", and Chromium honors the
first occurrence of a switch. So `tron --user-data-dir=/tmp/x` was
silently ignored — the browser opened the default profile instead of the
one asked for — and the duplicated switch can fault the process outright.
Drop any switch of ours the caller also passed.

--enable-features/--disable-features merge instead of being replaced.
They are comma-separated lists, and dropping ours wholesale would
re-enable the Manifest V2 kill switch, which stops uBlock Origin from
loading, just because the caller wanted one unrelated feature. The
dedupe runs before the Tor block on purpose: Tor's proxy flags are a
guarantee rather than a preference, and appending them afterward keeps
them first on the command line where a caller cannot displace them.

TronBrowser also ships no engine — it drives whatever Ungoogled Chromium
is on the system, usually a Flatpak that updates itself. A Flathub push
can therefore change every user's browser overnight while TronBrowser's
own history shows nothing, and the resulting regression in scrolling or
compositing arrives as a TronBrowser bug against a release that touched
none of it. Record the engine on each launch and say so when it changes.

Adds the launcher's first tests: they run the real script against a stub
browser that records its argv. Verified they fail against the pre-fix
launcher, which emits two --user-data-dir and two --enable-features.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

vu1nz Security Review

0 finding(s) in PR #?

No security issues found.

@ralyodio
ralyodio marked this pull request as ready for review August 3, 2026 14:18
@ralyodio
ralyodio merged commit 18b4a24 into main Aug 3, 2026
7 checks passed
@ralyodio
ralyodio deleted the fix/launcher-flag-override branch August 3, 2026 14:19
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