Module stealth

Module stealth 

Source
Expand description

Stealth configuration and anti-detection features

Provides navigator property spoofing and CDP injection scripts that make a headless Chrome instance appear identical to a real browser.

§Overview

  1. Navigator spoofing — Override navigator.webdriver, platform, userAgent, hardwareConcurrency, deviceMemory, maxTouchPoints, and vendor via Object.defineProperty so properties are non-configurable and non-writable (harder to detect the override).

  2. WebGL spoofing — Replace getParameter on WebGLRenderingContext and WebGL2RenderingContext to return controlled vendor/renderer strings.

§Example

use stygian_browser::stealth::{NavigatorProfile, StealthConfig, StealthProfile};

let profile = NavigatorProfile::windows_chrome();
let script = StealthProfile::new(StealthConfig::default(), profile).injection_script();
assert!(script.contains("'webdriver'"));

Structs§

NavigatorProfile
A bundle of navigator property values that together form a convincing browser identity.
StealthConfig
Feature flags controlling which stealth techniques are active.
StealthProfile
Combines StealthConfig (feature flags) with a NavigatorProfile (identity values) and produces a single JavaScript injection script.

Functions§

apply_stealth_to_page
Inject all stealth scripts into a freshly opened browser page.