trace_function
Monitor JavaScript function calls in real-time to capture arguments, return values, and call stacks for debugging and reverse engineering without halting execution.
Instructions
Trace all calls to a function without pausing execution.
Records arguments, return values, and optionally call stacks for each invocation. Data can be retrieved with get_trace_data.
Args: function_path: Full path to the function, e.g. "XMLHttpRequest.prototype.open", "window.encrypt", "JSON.stringify". log_args: Record function arguments (default True). log_return: Record return values (default True). log_stack: Record call stacks (default False, enable for call chain analysis). max_captures: Maximum number of calls to record (default 50). persistent: If True, the trace survives page navigation. Trace data is collected Python-side via console events and won't be lost on reload.
Returns: dict with status and the target function path.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| function_path | Yes | ||
| log_args | No | ||
| log_return | No | ||
| log_stack | No | ||
| max_captures | No | ||
| persistent | No |