Skip to main content

Module init_script

Module init_script 

Source
Expand description

Page init script for the fingerprint surfaces CDP cannot override.

Everything here is strictly worse than a browser-enforced override: a JavaScript patch is visible to anyone who inspects the property descriptor carefully enough, and it does not reach workers or HTTP headers. It exists only for fields the Emulation domain has no command for, and for connecting to a browser somebody else launched, where the switches can no longer be changed.

The payload itself is not written here. init_payload.js next to this module is a byte-for-byte copy of js/src/fingerprint/init-payload.js, kept in step by scripts/check-shared-fingerprint-assets.sh, so all three implementations send Chrome the same script rather than three hand-written translations of it.

Structs§

InitScriptOptions
What the init script still has to patch after the CDP overrides.

Constants§

FINGERPRINT_PAYLOAD_SOURCE
The shared payload source, embedded at compile time.

Functions§

build_fingerprint_init_script
Serialize the init script for a profile, or None when none is needed.
build_init_script_config
Decide what the init script still has to do after the CDP overrides.