zendriver_stealth/lib.rs
1//! Anti-detection profiles and patches for `zendriver`.
2//!
3//! See the [Stealth chapter](https://turtiesocks.github.io/zendriver-rs/stealth.html)
4//! of the [zendriver-rs user guide](https://turtiesocks.github.io/zendriver-rs/)
5//! for profile trade-offs, the sannysoft test matrix, and platform-spoofing
6//! recipes.
7//!
8//! Three stealth modes, exposed via [`StealthProfile`]:
9//!
10//! - [`StealthProfile::off`] — no stealth (stock Chrome launch).
11//! - [`StealthProfile::native`] — launch flags + UA scrub + CDP `Emulation`
12//! overrides. Safe against `Function.prototype.toString` probes; the
13//! default.
14//! - [`StealthProfile::spoofed`] — `native` plus a Navigator-prototype JS
15//! bootstrap script that passes the [sannysoft][sannysoft] battery.
16//!
17//! Most users go through `zendriver`'s `BrowserBuilder::stealth(...)`:
18//!
19//! ```
20//! use zendriver_stealth::{Platform, StealthProfile};
21//!
22//! let profile = StealthProfile::spoofed()
23//! .platform(Platform::MacIntel)
24//! .locale("en-US")
25//! .timezone("America/Los_Angeles");
26//!
27//! assert!(profile.bypass_csp_enabled());
28//! assert!(!profile.build_flags().is_empty());
29//! ```
30//!
31//! The [`StealthObserver`] type plugs into `zendriver-transport`'s observer
32//! chain and applies the resolved [`Fingerprint`] / bootstrap to every newly
33//! attached page target before Chrome releases the debugger.
34//!
35//! [sannysoft]: https://bot.sannysoft.com/
36
37pub mod error;
38pub mod fingerprint;
39pub mod flags;
40#[cfg(feature = "geo")]
41pub mod geo;
42pub mod gpu;
43mod headers;
44pub mod input_profile;
45pub mod lang;
46pub mod observer;
47pub mod patches;
48pub mod persona;
49pub mod profile;
50pub mod ua;
51
52// Re-exports added as types land in Tasks 1–13:
53pub use error::StealthError;
54pub use fingerprint::{Brand, Fingerprint, UserAgentMetadata};
55pub use flags::GpuBackend;
56pub use gpu::device_select::{DeviceLookupError, GpuDevice};
57pub use gpu::{GlParam, GpuProfile, Provenance, ShaderPrecision};
58pub use input_profile::InputProfile;
59pub use lang::accept_language;
60pub use observer::StealthObserver;
61pub use profile::{Platform, ProfileKind, StealthProfile};
62
63pub use persona::seed::Seed;
64pub use persona::specs::{
65 FontSpec, HardwareSpec, ScreenSpec, SurfaceCfg, UaMetadata, UaSpec, WebglSpec, WebgpuSpec,
66 WebrtcSpec,
67};
68pub use persona::surface::{Strategy, Surface, SurfaceKind};
69pub use persona::{GeoPos, JsProbe, Persona, PersonaBuilder};