V8 Inspector bridge that lets Chrome DevTools attach to a running NativeScript isolate.
use runtime_devtools::{DevtoolsServer, DevtoolsServerConfig};
// On the V8 thread, after creating the isolate and context:
let mut server = DevtoolsServer::attach(
&DevtoolsServerConfig::default(), // host: 127.0.0.1, port: 42000
isolate,
context,
)?;
println!("DevTools: {}", server.endpoint().frontend_url);
// In the JS execution loop:
server.pump_messages(); // dispatches pending CDP messages to V8- Binds a
V8Inspector+V8InspectorSessionto the provided isolate/context. - Starts a background TCP server on the configured port.
- Serves CDP discovery endpoints (
/json/version,/json/list) as plain HTTP. - Upgrades
/devtools/page/runtimeconnections to WebSocket and bridges them to V8. - Implements
run_message_loop_on_pauseso breakpoints work correctly.
Open the frontend_url from DevtoolsEndpoint in Chrome, or use:
chrome://inspect → Configure → add 127.0.0.1:42000