Skip to main content

Module diagnostic

Module diagnostic 

Source
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

  1. Iterate all_checks to get the built-in check catalogue.
  2. For each DetectionCheck, send check.script to the browser via CDP and collect the returned JSON string.
  3. Call DetectionCheck::parse_output to get a CheckResult.
  4. 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§

CheckResult
The outcome of running a single detection check in the browser.
DetectionCheck
A single stealth detection check: identifier, description, and JavaScript to evaluate via CDP Runtime.evaluate.
DiagnosticHint
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.
DiagnosticReport
Aggregate result from running all detection checks.
KnownLimitation
A known browser surface that is visible but not yet covered by stealth diagnostics.
LimitationProbe
A runtime probe for a visible browser surface we do not yet fully cover.
TransportDiagnostic
Transport-level diagnostics emitted alongside JavaScript stealth checks.
TransportObservations
Optional observed transport fingerprints to compare against expected values.

Enums§

CheckId
Stable identifier for a built-in stealth detection check.
DowngradeCause
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).
HintSeverity
Severity for a DiagnosticHint. Hints are non-fatal; Warning does not block CI gates that look for hard errors.
LimitationId
Stable identifier for a browser surface we do not yet spoof or validate fully.
ProtocolVersion
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_h3 combination. Public so the BrowserConfig::diagnostic_hints() accessor can call it without re-implementing the message string.