Skip to content

feat(frontend): the device test names the browser and its version - #2053

Merged
rpgmem merged 2 commits into
developfrom
claude/device-check-browser-name
Oct 24, 2026
Merged

rpgmem merged 2 commits into
developfrom
claude/device-check-browser-name

Conversation

@rpgmem

@rpgmem rpgmem commented Oct 24, 2026

Copy link
Copy Markdown
Owner

Closes #2052.

Problem

The "Test my device" mode (#2047) said "Ordinary browser (computer)" for every browser that was not an app's own. Support could not tell an out-of-date browser, or a Chromium derivative, from a current Chrome without reading the raw user agent.

Change

assets/js/ffc-device-check.js gets browserName(), which reads two sources in order.

  • Chromium brands first. It reads navigator.userAgentData.brands and, through getHighEntropyValues(['fullVersionList']), the full versions. Brands win in this order: Brave, Edge, Opera, Samsung Internet, Chrome; a list with only Chromium is Chromium.
  • The user agent as the fallback. This covers Firefox, Safari, every iOS browser (CriOS, FxiOS, EdgiOS, all WebKit), a Chromium build that declares no brands, and a page without HTTPS.

Examples of what it shows:

Browser Shown
Chrome Chrome (v. 129.0.6668.81)
Chromium Chromium (v. …)
Brave Brave / Chromium (v. …)
Edge Edge / Chromium (v. …)
Opera Opera 103 / Chromium (v. 117.0.5938.60)
Samsung Internet Samsung Internet 26 / Chromium (v. …)
Firefox Firefox (v. 131)
Safari Safari (v. 17.6)
Chrome on iOS Chrome / WebKit (v. 129.0.6668.69)
  • A reduced user agent's padding is trimmed, so 129.0.0.0 reads 129.
  • The row reads <name> — <device> through a new translatable browserNamed string. An unknown browser keeps "Ordinary browser (…)".
  • An app's own browser names the app: Instagram, Facebook, WhatsApp, TikTok, LinkedIn, LINE.
  • It stays out of FFC.Platform, whose rule is capabilities and contexts, never brands: no decision reads the name.
  • PDF row: "Supported" now says what was checked, "Supported: this browser can build and save the PDF." A "(JS on)" note would be redundant: without JavaScript no row is filled and the page shows its JavaScript-off notice instead.
  • Documentation (Certificates & Forms topic), catalogues, CHANGELOG (Added).

Tests

  • New device-check-browser.test.js (18 tests):
    • Chrome, Chromium and Brave, whose user agents are the same, told apart by their brands;
    • Edge, Opera and Samsung Internet with the engine version, plus their own number;
    • the fallback to the major version when fullVersionList is refused or empty;
    • a 12-entry user-agent corpus with no brands (desktop, Android, iOS, Linux Chromium, unknown);
    • the row text, the generic wording, and the app name.
  • device-check.test.js still passes (9 tests).
  • PHP translation, comment-language, documentation and device-check tests pass (69 tests). ESLint and PHPCS are clean. The full suites run in CI.

Risk

  • Display only, on the device test page. Vivaldi and other derivatives that declare only Chromium show as Chromium.

Checklist

Waits as a draft until #2051 merges (one PR armed at a time).


Generated by Claude Code

"Ordinary browser" becomes the browser's name and version: Chrome,
Chromium, Brave, Edge, Opera and Samsung Internet from the brands a
Chromium browser declares (with the full version from fullVersionList
when it answers), and Firefox, Safari and every iOS browser from the user
agent. A derivative shows its engine ("Brave / Chromium (v. ...)"), and
Opera and Samsung Internet their own number too. An app's own browser
names the app. An unknown browser keeps the generic wording. It stays out
of FFC.Platform: no decision reads the name.

The PDF row now says what it checked: "Supported: this browser can
build and save the PDF."

Closes #2052

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018srx5hc431EYmG4MHUr2KA
@rpgmem rpgmem added enhancement New feature or request area:certificates labels Oct 24, 2026 — with Claude
@rpgmem
rpgmem marked this pull request as ready for review October 24, 2026 11:46
@rpgmem
rpgmem enabled auto-merge (squash) October 24, 2026 11:46
@rpgmem
rpgmem merged commit 75963de into develop Oct 24, 2026
21 checks passed
@rpgmem
rpgmem deleted the claude/device-check-browser-name branch October 24, 2026 11:55
rpgmem added a commit that referenced this pull request Oct 24, 2026
LiteSpeed Cache minifies and combines scripts for guests through
matthiasmullie/minify. That minifier reads a regex literal ending in an
escaped slash, followed by `]` or a line break, as closing early and
drops the rest of the line. `['LINE', /Line\//]` (#2053) came out as
`['LINE',/Line\];`, the combined file stopped parsing, and the device
test stayed at "Checking…" for every visitor who is not logged in.

The three such literals become `\/\d` and `\/{2}`. Every readable and
minified script in assets/js and libs/js was run through the same
minifier and still parses. MinifierSafeRegexTest refuses the shape,
with a canary and an independent recount of the scanned files.

Closes #2056


Claude-Session: https://claude.ai/code/session_018srx5hc431EYmG4MHUr2KA

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:certificates enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants