Skip to main content

navigator_coherence_script

Function navigator_coherence_script 

Source
pub fn navigator_coherence_script(profile: &FingerprintProfile) -> String
Expand description

Generate a CDP injection script for comprehensive navigator coherence.

All overrides are derived from profile to guarantee internal consistency. Must be injected via Page.addScriptToEvaluateOnNewDocument.

When a profile is not set, call stealth.rs’s existing navigator spoof instead — this function requires a fully populated profile.

§Example

use stygian_browser::navigator_coherence::navigator_coherence_script;
use stygian_browser::profile::FingerprintProfile;

let p = FingerprintProfile::linux_chrome_136_intel();
let js = navigator_coherence_script(&p);
assert!(js.contains("4")); // 4 cores
assert!(js.contains("userAgentData"));