Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

runtime-devtools

V8 Inspector bridge that lets Chrome DevTools attach to a running NativeScript isolate.

Usage

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

What it does

  1. Binds a V8Inspector + V8InspectorSession to the provided isolate/context.
  2. Starts a background TCP server on the configured port.
  3. Serves CDP discovery endpoints (/json/version, /json/list) as plain HTTP.
  4. Upgrades /devtools/page/runtime connections to WebSocket and bridges them to V8.
  5. Implements run_message_loop_on_pause so breakpoints work correctly.

Connecting

Open the frontend_url from DevtoolsEndpoint in Chrome, or use:

chrome://inspect  →  Configure  →  add 127.0.0.1:42000