Add Thorium support for the bundled Chrome plugin on Linux#301
Conversation
There was a problem hiding this comment.
Thanks for the Thorium support work. I did a stricter pass over the native host, launcher integration, patcher idempotency, and tests. CI is green and the fresh happy path looks close, but I found a couple of migration/idempotency issues that should be fixed before merge.
Findings:
-
scripts/lib/patch-chrome-plugin.js: the Thorium open-window command patch can falsely skip itself on an already Linux-patched Chrome/Brave/Chromium script. The new default-browser fallback insertsthorium-browser-avx2.desktop, while the later command patch usesalreadyText: "thorium-browser-avx2". That makes the command patch report “already patched” even when thecommandPath("thorium-browser-avx2") || commandPath("thorium-browser") || commandPath("thorium")branch is still missing. I reproduced this with a fixture that has the previous Linux open-window command block: after running the patcher, only the desktop-id fallback was added and the actual Thorium launch command was absent. Please use a command-specific idempotency marker, for examplecommandPath("thorium-browser-avx2"), and add a regression test for the already-patched Chrome/Brave/Chromium migration case. -
scripts/lib/patch-chrome-plugin.js:check-native-host-manifest.jsdoes not cover the previous multi-browser Linux fallback shape when upgrading from Chrome/Brave/Chromium support to Chrome/Brave/Chromium/Thorium. The currentoldTextcases cover mac/win-only and google-only Linux fallback, but not the existingmanifestPathsarray with google-chrome, BraveSoftware/Brave-Browser, and chromium. I reproduced that shape and the patcher only warned, leaving Thorium out of diagnostics. Please add that migration target and a smoke test so existing Linux-patched script shapes are upgraded to include~/.config/thorium/NativeMessagingHosts.
Non-blocking residual risks I noticed:
- The native host fallback for Thorium is scoped correctly to
getInfo, but it depends on the exacterror.messagecontainingchrome.runtime.getVersion is not a function; if the extension wraps this differently, it will not trigger. extension_id_from_args()is not directly tested, so argv shape drift would silently dropmetadata.extensionId.- There is no live Thorium native-messaging handshake in CI, which is understandable, but the patcher tests should cover the runtime script shapes as much as possible.
Validation I ran locally:
node --check scripts/lib/patch-chrome-plugin.jsbash -n tests/scripts_smoke.sh launcher/start.sh.templategit diff --check origin/main...HEADnode --test scripts/patch-linux-window-ui.test.jscargo test -p codex-computer-use-linux --bin codex-chrome-extension-hosttests/scripts_smoke.sh
|
Thanks for working on Thorium support. After thinking about the maintenance boundary, I don’t think we should add Thorium-specific browser support to the always-on core path. Thorium is a narrower browser variant, and supporting its profile paths, desktop IDs, process names, launch commands, plugin-script patches, and native-host compatibility in core would mean we own ongoing maintenance for a browser we do not regularly test. This repo has If a small generic native-host compatibility fix is still needed, we can discuss that separately, but the Thorium-specific support should live as an opt-in Linux feature rather than in the default build. |
|
Thank you for your feedback. I agree that Thorium is not as widely used as other browser flavors, and I will indeed move it to |
ff35734 to
66a7895
Compare
66a7895 to
a536803
Compare
ilysenko
left a comment
There was a problem hiding this comment.
Approved the updated version. Thorium support is now isolated as a disabled-by-default linux-features integration, and the remaining core changes are generic extension points/compatibility fallback.
Summary
getInfohandler callschrome.runtime.getVersion()Note:
chrome.runtime.getVersion()is a Chrome/Chromium 143+ API. The native-host fallback is generic for older Chromium-family runtimes that can otherwise run the extension; it may become unnecessary for Thorium once Thorium moves to its next Chromium LTS base.User-visible behavior
Thorium users can install and use the bundled Codex Chrome plugin on Linux instead of being routed through Chrome/Brave/Chromium-only setup paths. Existing Chrome, Brave, and Chromium behavior is preserved.
Validation:
cargo test -p codex-computer-use-linux --bin codex-chrome-extension-hostnode --test linux-features/thorium-chrome-plugin/test.jstests/scripts_smoke.sh