Skip to content

fix(env): a mobile platform hint the UA does not confirm is the Linux lie (#12) - #50

Merged
gololdf1sh merged 3 commits into
mainfrom
fix/12-ubuntu-detected-as-android
Aug 20, 2026
Merged

fix(env): a mobile platform hint the UA does not confirm is the Linux lie (#12)#50
gololdf1sh merged 3 commits into
mainfrom
fix/12-ubuntu-detected-as-android

Conversation

@gololdf1sh

Copy link
Copy Markdown
Collaborator

Closes #12.

Testrun meta said OS: Android for a reporter working on Ubuntu. envOs() trusted navigator.userAgentData.platform blindly, and some desktop-Linux Chrome builds lie there and answer "Android". Extensions run on desktop browsers only — a mobile platform answer can never be true for the panel.

The fix (env-info.js): a mobile hint (Android/iOS) that the UA-string parse does not confirm loses to the parse; when the parse answers nothing, the machine is called Linux (the builds that lie are Linux). Honest hints and desktop answers are untouched.

The new sample matrix caught two more detector defects, fixed alongside: the iOS branch of uaOs was unreachable (every iOS UA carries "like Mac OS X" and the Mac check ran first), and the Safari pattern missed mobile Safari (Mobile/15E148 interleaved before Safari/).

Test infrastructure added (first commit — deliberately red, the documented "before"):

  • tests/env-info-matrix.mjs — the real env-info.js source driven with recorded hints+UA pairs: Windows/macOS/Ubuntu/ChromeOS × Chrome/Edge/Opera, headless (no hints), UA-only fallbacks, and the lying-mobile negatives. 14 cases.
  • tests/env-live-probe.mjs — injects the same source into a real branded browser and checks the answer against the actual OS. A plain locally-served secure page stands in for the panel: Chrome 137+ refuses --load-extension, and client hints exist only in secure contexts — both discovered the hard way.
  • .github/workflows/env-check.yml — 3 desktop OS × Chrome/Edge, runs both checks.

Verified

stage sample matrix live probes (6 legs)
before fix (run) red on the lying-hints cases, every leg green — stock runner browsers answer honestly, incl. Linux on Ubuntu
after fix (run) 14/14 green green

The stock-Ubuntu green probe confirms the reporter's "Android" comes from a lying build rather than every Linux Chrome — which is exactly why the fix cross-checks instead of special-casing Ubuntu.

gololdf1sh and others added 3 commits August 20, 2026 18:51
In a gherkin project the parameters ARE the body's Examples tables: the
backend derives the params/examples records from them, and the web app
offers no separate parameters UI at all. The editor still showed both —
the dedicated table under the read-only description and the editable grid
in edit mode — printing the same data twice, and the grid was a second
write path into body-owned state (a direct params write on a BDD test
answers 400 "Examples already exists").

The language probe added by #35 is now shared through one memoized promise
per document and started at boot for test documents too. A gherkin answer
skips the view table before its read and disables the grid the way basic
mode already does: section hidden, Save writes no params, drafts carry
none. Markdown projects are untouched, and a failed probe keeps today's
behaviour.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
)

A reporter's Ubuntu machine lands in testrun meta as OS "Android": the
client-hints platform lies on some desktop Linux builds, and env-info.js
takes it at its word. Before touching the detector, this pins down what it
answers today.

The sample matrix drives the real env-info.js source with recorded
hints+UA pairs for every target combination (Windows/macOS/Ubuntu/ChromeOS
x Chrome/Edge/Opera, headless, and the lying-mobile negatives) and is
deliberately red on the bug cases. The live probe injects the same source
into a real branded browser and checks the answer against the actual OS —
run by a 3-OS x Chrome/Edge workflow on every push of this branch. A plain
page stands in for the panel (Chrome 137+ refuses --load-extension) served
as a local secure context, because hints exist only there.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
… lie (#12)

Some desktop-Linux Chrome builds answer "Android" in the client-hints
platform, and envOs took the hint at its word — a reporter's Ubuntu landed
in testrun meta as Android. Extensions run on desktop browsers only, so a
mobile hint the UA string does not confirm can never be true: the UA parse
wins now, and when it answers nothing the machine is called Linux, after
the builds that lie.

The sample matrix caught two more detector defects, fixed alongside: the
iOS branch of uaOs was unreachable (every iOS UA carries "like Mac OS X"
and the Mac check ran first), and the Safari pattern missed mobile Safari,
whose UA interleaves Mobile/15E148 between the version and Safari. The
matrix is 14/14 with untouched expectations; the env-check workflow is the
same picture on real Chrome and Edge across the three desktop OS.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
@gololdf1sh gololdf1sh self-assigned this Aug 20, 2026
@gololdf1sh
gololdf1sh merged commit ba00e51 into main Aug 20, 2026
6 checks passed
@gololdf1sh
gololdf1sh deleted the fix/12-ubuntu-detected-as-android branch August 20, 2026 19:21
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.

Ubuntu is detected as Android

1 participant