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.
DiagnosticReport
Aggregate result from running all detection checks.

Enums§

CheckId
Stable identifier for a built-in stealth detection check.

Functions§

all_checks
Return all built-in stealth detection checks.