fix(launcher): caller flags override ours; report the engine we actually run - #72
Merged
Conversation
… 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>
vu1nz Security Review0 finding(s) in PR #? No security issues found. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two launcher fixes that came out of chasing "TronBrowser got slow today."
1. Caller flags were silently ignored
FLAGSis placed before"$@", and Chromium honors the first occurrence of a switch. Sotron --user-data-dir=/tmp/scratchproduced two--user-data-dirflags and the browser opened the default profile anyway. A duplicated--user-data-dircan also fault the process — that is what a localSIGSEGVtraced back to.Now any switch of ours that the caller also passes is dropped, so theirs is the only one left.
--enable-features/--disable-featuresmerge 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-servercannot displace them.2. Nothing recorded which engine actually ran
TronBrowser ships no engine —
apps/desktop/launcher/tronbrowserdrives 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:
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.apps/desktop--user-data-dirand two--enable-featuressh -nanddash -nclean (shellcheck not installed here)extensions/ai-sidebar/moshpit-drift.test.jsfails to load in a fresh worktree because@moshcoder/moshpit-resolveisn't installed there. Pre-existing and unrelated; it resolves in a checkout that has runpnpm 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