JBrowser Source Docs
You are reading the documentation for JBrowser 2.0.1. The newest release is 2.0.3. Go to the latest documentation

jbrowser.engine.identity

Generated from the source code of JBrowser 2.0.1.

jbrowser/engine/identity.py · 112 lines

The browser JBrowser presents itself as: the current Chrome version, as a Chromium browser.

Qt WebEngine would announce its own Chromium (140 in Qt 6.11) plus a QtWebEngine/x.y token, and a browser a year behind Chrome is treated as outdated or suspicious by some sites. JBrowser presents the newest stable Chrome version instead, consistently everywhere a site can look: the User-Agent header, navigator.userAgent, the Sec-CH-UA client-hint headers and navigator.userAgentData.

The user agent string is exactly Chrome's. The client-hint brands say "Chromium" (plus Chrome's placeholder brand) but not "Google Chrome": Google's sign-in knows a genuine Google Chrome by more than its brand, and rejects a browser that claims the brand without the rest ("Couldn't sign you in").

The version is recorded at build time: tools/chrome_version.py asks Google's version history service for the newest stable Chrome for Windows and rewrites the two constants below, and master.ps1 runs it for every release. A copy of JBrowser that hasn't been updated for a while keeps up by itself: every 30 days after the recorded date it presents the next major version. Chrome ships one every 4 weeks, so the estimate never runs ahead of the real Chrome.

Constants#

Name Value
CHROME_VERSION '155.0.8059.26'
CHROME_VERSION_DATE date(2026, 10, 4)
ESTIMATE_DAYS 30

Functions#

chrome_version#

chrome_version(today: date | None=None) -> strsource

The full Chrome version to present, e.g. "155.0.8059.12".

major#

major(version: str) -> intsource

user_agent#

user_agent(version: str) -> strsource

Chrome's reduced user agent: only the major version is real, the rest is always zero.

grease_brand#

grease_brand(seed: int) -> tuple[str, str]source

The placeholder brand and version Chrome adds for major version seed, e.g. ("Not(A:Brand", "24").

brand_versions#

brand_versions(version: str) -> dict[str, str]source

Brand → full version, as a Chromium browser of this version reports them (Sec-CH-UA-Full-Version-List). No "Google Chrome" brand: see the module notes.

engine_version#

engine_version() -> strsource

The Chromium version Qt WebEngine is actually built on, e.g. "140.0.7339.225".

version_for#

version_for(choice: str | None) -> strsource

The version for Settings → Advanced → "How JBrowser introduces itself": the newest Chrome ("current", the default) or the engine's own Chromium ("engine").

apply#

apply(profile, version: str | None=None) -> strsource

Present version (default: chrome_version()) on a QWebEngineProfile. Returns the user agent.

firefox_user_agent#

firefox_user_agent(today: date | None=None) -> strsource

A current Firefox user agent for Windows. Firefox 140 came out on 2025-06-24 and a new version follows about every four weeks; counting 30 days per version never runs ahead.

apply_firefox#

apply_firefox(profile) -> strsource

Present Firefox on a profile, as consistently as Qt WebEngine allows (see engine/signin.py): the user agent in headers and JavaScript, no high-entropy client hints, and no browser brands in the Sec-CH-UA header or navigator.userAgentData (Firefox has neither).