CDP: Inject
cdp_injectRegister a persistent userscript on an attached browser so it re-runs at document-start on every navigation, current and future, not just once.
Instructions
Register a persistent userscript on the attached browser (CDP Page.addScriptToEvaluateOnNewDocument) — re-runs at document-start on every navigation, current and future pages. Unlike cdp_eval (one-shot).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tab | No | Tab index from cdp_tabs to act on. | |
| url | No | Pick the tab whose URL contains this substring. | |
| port | No | CDP debug port (default 9222). | |
| script | Yes | User script source to register on the attached browser |