Expand description
Advanced CDP leak hardening.
Injects a script that runs before all other stealth scripts to:
- Delete Playwright / Puppeteer binding remnants from
window. - Sanitize
Error.prototype.stackto remove CDP-specific frame URLs. - Harden
console.debugso a getter-based stack-inspection trap cannot detect CDP from within it. - Ensure the
Navigator.prototype.webdriverproperty descriptor matches Chrome’s native format (accessor descriptor with a getter, no setter). - Mark as non-enumerable any artifact properties that CDP injection may
have left enumerable on
window.
§Example
use stygian_browser::cdp_hardening::{cdp_hardening_script, CdpHardeningConfig};
let cfg = CdpHardeningConfig::default();
let js = cdp_hardening_script(&cfg);
assert!(js.contains("__playwright"));
assert!(js.contains("Error.prototype"));Structs§
- CdpHardening
Config - Configuration for CDP leak hardening.
Functions§
- cdp_
hardening_ script - Generate the CDP hardening injection script.