Skip to content

google-chrome: preserve quoted arguments in user flags - #2388

Open
latentoperator wants to merge 3 commits into
omacom:masterfrom
latentoperator:fix/chrome-flag-quoting
Open

latentoperator wants to merge 3 commits into
omacom:masterfrom
latentoperator:fix/chrome-flag-quoting

Conversation

@latentoperator

@latentoperator latentoperator commented Nov 9, 2026 •

Copy link
Copy Markdown

Chrome's old Bash launcher splits a quoted mobile user agent into URL arguments. Parse saved flags into an argv vector without shell evaluation, preserving file-over-environment precedence and command-line arguments. Comments start only at unquoted token boundaries, so --app=https://example.test/#/inbox --disable-gpu keeps both the URL fragment and the following flag. Malformed quotes or escapes refuse before Chrome launches.

November 19 update

Head d9eaf826e3 uses upstream Chrome 158.0.8127.36, preserves both vendor checksums, and bumps pkgrel to 2. All ten launcher tests, the pinned-source check and the vendored-key check passed.

Both architecture packages built with makepkg. Each archive contains the tested launcher and declares its Python dependency. On x86_64 the packaged launcher passed the complete quoted mobile user agent to headless Chrome. The aarch64 package installed with dependencies in an isolated ARM container. Pacman verified all 305 files, and the packaged launcher reported Google Chrome 158.0.8127.36 under emulation. The upstream Tests, Check Shadowed Packages and Build changed packages workflows await maintainer approval.

The earlier package and runtime checks below used the November 14 head.

November 14 update

The November 14 refresh retained upstream 157.0.8103.78 and both vendor archive checksums, bumps pkgrel to 2, adds the Python runtime dependency and updates the launcher source hash. It adds no mobile UA/scaling defaults.

Validation on the November 14 head

  • All 10 launcher tests pass: quoted arguments, literal shell substitutions/globs, configuration paths, environment fallback, empty-file precedence, URL fragments with later flags, boundary comments and malformed-input refusal. The new fragment regression was previously confirmed failing against the old submitted parser.
  • Complete makepkg vendor packages 157.0.8103.78-2 build for x86_64 and aarch64 with pinned source checks passing. Both archives contain the exact reviewed launcher and declared Python dependency; ELF architecture and all-root archive ownership checks pass.
  • The x86_64 package installs in an isolated scratch root with dependency/script checks disabled there; package verification reports 305 files, none altered. The installed entry point then runs the full current vendor payload in an isolated filesystem mapping with a fresh profile and no network. It reports the complete quoted Mozilla/5.0 (Linux; Android) Mobile user agent as one argument.
  • The aarch64 package installs in an isolated Arch Linux ARM container with its dependencies and normal hooks. Package verification reports 305 files, none altered; the installed entry point executes the real ARM payload under emulation and reports Google Chrome 157.0.8103.78. This is package/install/version evidence, not a phone graphical-session test.
  • Repository metadata, pinned-source and vendored-key checks, whitespace checks and independent source review pass. No new phone operation occurred.

Mobile #581 continues to defer Chrome defaults until this quote-aware launcher is released. The earlier .50 package results are historical; the current .78 replacement has the build/install/runtime checks above. Fresh hosted checks and maintainer build/workflow approval remain required.

@greptile-apps

greptile-apps Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The reviewed changes appear safe to merge.

Summary

Chrome’s launcher now preserves quoted user flags without running shell code.

  • Chrome keeps quoted user flags together when it starts.

The launcher’s source checksum matches. No actionable issues found.

Reviews (3) · Last reviewed commit: "Refresh PR 2388 against current upstream..." · Reviewed by Greptile

@latentoperator

Copy link
Copy Markdown
Author

The URL-fragment finding is valid: shlex.split(..., comments=True) treats an unquoted # inside an argument as the start of a comment, so --app=https://example.test/#/inbox --disable-gpu loses both the fragment and the following flag.

This remains unresolved on 8710c51d1b880a742d0f4895940053be4051799c. The next source revision needs comment handling that preserves hashes inside arguments, with regression coverage for an unquoted app URL plus a following flag, while retaining quoted values, ordinary comments, literal substitutions/globs and failure before launch on malformed quoting. The existing package-build/install results do not cover this case; I am not claiming the PR is merge-ready until it is fixed. No source or package has changed in this status update.

latentoperator and others added 2 commits November 14, 2026 17:01
The launcher split a quoted mobile user agent into separate URL arguments,
opening broken tabs. Parse flags with shlex and exec an argv vector without
evaluating shell code. Keep the config-file precedence over environment
flags and preserve command-line arguments verbatim. Reject malformed
quoting before Chrome starts.

Add the Python runtime dependency, bump pkgrel and update the source hash.
Tests cover quoting, comments, literal shell syntax, config paths with
spaces, environment fallback and failure without launching the browser.
The candidate entry point also ran an isolated aarch64 web-app profile on
a Pixel 6a with the complete mobile user agent in one argument.

Co-Authored-By: Codex <noreply@openai.com>
Treat a hash as a comment only at an unquoted token boundary, preserving URL fragments and later flags. Keep shlex validation and literal shell syntax. Retain current master vendor version and checksums after rebasing.

Validation: ten launcher tests pass; the unquoted fragment regression fails against the old launcher. Pinned-source, metadata and local launcher checksum checks pass. Full builds of the current vendor version remain unverified.

Co-Authored-By: Codex <noreply@openai.com>
@latentoperator
latentoperator marked this pull request as draft November 14, 2026 23:10
@latentoperator
latentoperator force-pushed the fix/chrome-flag-quoting branch from 8710c51 to eb24a26 Compare November 14, 2026 23:18
@latentoperator
latentoperator marked this pull request as ready for review November 14, 2026 23:18

This branch has not been deployed

No deployments
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