page_init_script
Run custom JavaScript at document start on every navigation, before page scripts load, to intercept API responses, capture state, and patch the environment.
Instructions
INIT SCRIPTS: run your JS at DOCUMENT START on every navigation — BEFORE any page script loads. The deepest interception layer in Ghostfox: hooks installed here are what page libraries (gt.js, analytics, frameworks) capture, so their stored references are YOURS. Use for: API response interception (JSONP callback swaps), state capture, anti-detection instrumentation, environment patches. Applies to subsequent navigations.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source | Yes | JavaScript source to run at document start on every navigation. | |
| page_id | Yes | ||
| session_id | Yes |