seleniumbase_rs_codec::emulation holds every wire value the stealth layer
imitates. Each one was measured from a real browser by a capture tool
(capture_tls, capture_hints, capture_h2) and stored as JSON under
crates/codec/src/measured. The files are embedded with include_str!, parsed
once, and looked up by BrowserKind and OsType. Only what was measured
exists: an unmeasured pair is an error, never a nearby guess. Today the table
holds chrome-155-macos.json. How the files are made and refreshed is in
Wire formats.
Emulation#
struct
One measured browser on one operating system: everything a client must send to
look like it. OsType and ClientHints are the core’s
(seleniumbase_rs::stealth::fingerprint).
The browser.
The major version, such as 155.
The full version, such as 155.0.8059.40.
The operating system the browser ran on.
The User-Agent header the browser sends.
The ClientHello of its WebSocket connections, which offer only HTTP/1.1.
The header names, order and values of its requests; empty until the HTTP/2 and header capture has run. See HeaderSpec.
The client hints it reports, when the hints capture has run.
Where the entry came from.
Emulation::from_json#
method
Reads one measured file, for a browser the crate does not ship as well as for the
embedded ones. name only labels errors. The raw evidence under the capture
key is skipped; any other unknown key is an error. The entry is checked to agree
with itself: the full version starts with the major version, the user agent names
the browser at that major version (Chrome/155), and the header spec is valid.
A label for errors, such as the file name.
The text of the file, at most MAX_MEASURED_JSON_BYTES (16 MiB).
Parse when the text is not a measured file, TooLarge above the limit,
Inconsistent when the entry contradicts itself, Headers when the header spec
is invalid.
Emulation::to_json#
method
The entry as pretty-printed JSON, without the raw evidence. Returns
EmulationError::Parse when serialization fails, which a valid entry never does.
Emulation::file_stem#
method
The stem the capture tools give this entry’s files, such as chrome-155-macos.
An operating system without measured files is spelled other.
Provenance#
struct
Where and how a measured entry was captured.
The date of the last capture, YYYY-MM-DD (2026-10-11 for the Chrome 155 entry).
The tools that wrote the entry, such as
capture_h2 0.1.0; capture_hints 0.1.0; capture_tls 0.1.0.
The browser that was measured, such as Chrome 155.0.8059.40.
EmulationError#
enum
Why a measured table could not be read or looked up. SpecError is the design
plan’s name for it: its NotMeasured variant is the plan’s
SpecError::NotMeasured.
get#
fn
The newest measured entry of a browser on an operating system. Re-exported at the
crate root as get_emulation.
EmulationError::NotMeasured { kind, os } when the pair has no capture.
get_version#
fn
The measured entry of a browser at one major version on an operating system.
NotMeasured when the pair has no capture at all, VersionNotMeasured when it
has captures but not at major.
for_kind#
fn
The newest measured entry of a browser, whatever the system. Re-exported as
emulation_for_kind. It panics if kind has no entry; the unit test
every_browser_kind_has_an_entry rules that out.
measured#
fn
Every measured entry, parsed once from the embedded JSON. Re-exported as
measured_emulations. It panics if an embedded file is broken; the unit tests
parse every file, so a broken file cannot reach a release. Use try_measured to
see the error instead.
try_measured#
fn
Every measured entry, or the first error met while parsing the embedded files.
newest, newest_on#
fn
The entry with the highest major version of kind (on os) among entries; the
first of equals wins. They work on any slice, such as a table of your own read
with Emulation::from_json.
measured_systems#
fn
The operating systems with a measured entry for kind, without repeats.
source_names#
fn
The names of the embedded measured files: today ["chrome-155-macos.json"]. A
file added to src/measured must be added to the crate’s list of sources too; the
test tests/wire_emulation.rs fails when one is missing.
Constants#
constThe largest measured file Emulation::from_json reads, in bytes.