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
Report - 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.