Expand description
Stealth self-diagnostic — JavaScript detection checks.
Defines a catalogue of JavaScript snippets that detect common browser-
automation telltales when evaluated inside a live browser context via
CDP Runtime.evaluate.
Each check script evaluates to a JSON string:
{ "passed": true, "details": "..." }§Usage
- Iterate
all_checksto get the built-in check catalogue. - For each
DetectionCheck, sendcheck.scriptto the browser via CDP and collect the returned JSON string. - Call
DetectionCheck::parse_outputto get aCheckResult. - Aggregate with
DiagnosticReport::new.
§Example
use stygian_browser::diagnostic::{all_checks, DiagnosticReport};
// Simulate every check returning a passing result
let results = all_checks()
.iter()
.map(|check| check.parse_output(r#"{"passed":true,"details":"ok"}"#))
.collect::<Vec<_>>();
let report = DiagnosticReport::new(results);
assert!(report.is_clean());Structs§
- Check
Result - The outcome of running a single detection check in the browser.
- Detection
Check - A single stealth detection check: identifier, description, and JavaScript
to evaluate via CDP
Runtime.evaluate. - Diagnostic
Hint - Non-fatal diagnostic hint emitted by configuration validation. Hints surface structural incompatibilities that the operator may want to know about but that don’t block the browser from launching.
- Diagnostic
Report - Aggregate result from running all detection checks.
- Known
Limitation - A known browser surface that is visible but not yet covered by stealth diagnostics.
- Limitation
Probe - A runtime probe for a visible browser surface we do not yet fully cover.
- Transport
Diagnostic - Transport-level diagnostics emitted alongside JavaScript stealth checks.
- Transport
Observations - Optional observed transport fingerprints to compare against expected values.
Enums§
- CheckId
- Stable identifier for a built-in stealth detection check.
- Downgrade
Cause - Why a protocol downgrade occurred — T105 only has one cause today (operator-configured HTTP proxy), but the variant is open for future causes (e.g. tunnel wrappers that strip UDP).
- Hint
Severity - Severity for a
DiagnosticHint. Hints are non-fatal;Warningdoes not block CI gates that look for hard errors. - Limitation
Id - Stable identifier for a browser surface we do not yet spoof or validate fully.
- Protocol
Version - HTTP/3 preference supported by the browser stack.
Functions§
- all_
checks - Return all built-in stealth detection checks.
- all_
limitation_ probes - Return all known browser-surface limitation probes.
- protocol_
downgrade_ hint - Build the protocol-downgrade hint payload for a proxy +
prefer_h3combination. Public so theBrowserConfig::diagnostic_hints()accessor can call it without re-implementing the message string.