hook_jsvmp_interpreter
Install a JSVMP runtime probe in the page main world before navigation to record script property reads and calls for reverse-engineering JSVMP obfuscation and anti-bot logic.
Instructions
Install a JSVMP runtime probe in the page main world.
The probe runs where page scripts run, so their property reads and calls
are recorded. Read the log with
evaluate_js("window.__mcp_jsvmp_log || []", world="main"); the default
isolated world cannot see it. remove_hooks() restores what the probe replaced.
Each event has a seq; window.__mcp_jsvmp_meta.dropped counts events lost to
max_entries. Same-origin frames (including about:blank iframes created and
removed by the page) log into the top frame's log with frame_url/frame_depth.
The result's coverage lists what this probe records and what it cannot
see: a missing entry means "not observed", not "not called".
mode="proxy" wraps Function.prototype.apply/call/bind, Reflect.*, Date.now, performance.now and Math.random, and puts Proxies on globals (navigator, screen, etc.). Page code can detect all of this, so RS/AK-style signature-based anti-bot will notice; use instrumentation(action='install') (source-level rewrite) for those. mode="transparent" only replaces getters on prototypes (Navigator, Screen, Document, ...). It changes less, but the getters are no longer the originals: Function.prototype.toString.call(getter) shows JS source.
IMPORTANT — timing for sync-loaded SDKs (e.g. webmssdk): JSVMP interpreters capture native references at startup via closures. If you install hooks AFTER the SDK has loaded, the SDK's closures already hold the original (un-hooked) references — your hooks will never fire. You MUST install hooks BEFORE navigate(): 1. launch_browser() 2. hook_jsvmp_interpreter(mode='transparent', persistent=True) 3. navigate("https://www.douyin.com/...") If already navigated, call instrumentation(action='reload') after installing hooks to force a page reload with hooks active.
Args: script_url: Target script URL substring for stack filtering. persistent: Survive navigation (default True). mode: "proxy" (full coverage, detectable) or "transparent" (replaces getters only). track_calls, track_props, track_reflect: Only for mode="proxy". proxy_objects: Objects to proxy (default: navigator, screen, etc.). max_entries: Log buffer cap (default 10000).
Returns: dict with status, mode, world, read_with and install details.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "hook_jsvmp_interpreter"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | proxy | |
| persistent | No | ||
| script_url | No | ||
| max_entries | No | ||
| track_calls | No | ||
| track_props | No | ||
| proxy_objects | No | ||
| track_reflect | No |