interceptor_browser_inject_init_script
Inject a JavaScript file as an init script that runs before any page script on every navigation, enabling prototype/global patches without DOM artifacts. Navigate again to apply to the current page.
Instructions
Inject a JS file as an init script (Playwright page.addInitScript). Runs before any page script on every subsequent navigation/frame. Runs in the isolated utility world — no DOM artifact; patches to shared prototypes/globals reach the page main world via utility-world sharing. Does NOT affect the currently loaded document — navigate again to apply.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target_id | Yes | Target ID from interceptor_browser_launch | |
| script_path | Yes | Absolute path to a .js file to inject before page scripts on every load. |