Why CDP Is Needed
The NSP daemon’s V8 probe connects to CDP to:- Walk the V8 heap and extract live JavaScript object graphs from open tabs
- Read DOM state for UI-rendered data not available in network responses
- Inject lightweight state-capture scripts that run inside the page’s JavaScript context
Launching Chrome with the Debug Port
- Command Prompt
- PowerShell
- Dedicated profile (recommended)
Verify CDP Is Active
After launching Chrome, confirm the debug port is responding before starting the NSP daemon:Create a Windows Shortcut
Create a permanent desktop shortcut so you don’t have to retype the command each time:1
Right-click the Desktop
Select New → Shortcut.
2
Set the target
Paste this as the shortcut location (adjust for your Chrome installation path if needed):
3
Name the shortcut
Give it a recognisable name such as
Chrome (NSP) so it’s easy to distinguish from your regular Chrome shortcut.4
Launch and verify
Double-click the new shortcut, then run
curl http://localhost:9222/json/version to confirm the port is active.Chrome Profile Considerations
Every Chrome profile has its own cookies, login sessions, and extensions. Which profile matters for NSP:Default profile
Works fine if you always close normal Chrome before launching the NSP-enabled instance. You’ll be logged in to all your accounts already.
Dedicated NSP profile
Recommended for production. Use
--user-data-dir="C:\Temp\ChromeNSP" to create a separate profile. Log in to the accounts your agent needs and leave normal Chrome untouched.Extensions installed in your default profile are not available in a dedicated
--user-data-dir profile. If your target application requires a Chrome extension to function, install it in the NSP profile.Opening the Target Application
After Chrome is running with CDP active, navigate to the application you want NSP to monitor. The daemon identifies tabs by URL pattern:
Each open tab that matches a known URL pattern appears as a separate entry in
GET /substrate/v1/apps. You can have multiple tabs open simultaneously.
Electron Apps
Electron applications (VS Code, Slack Desktop, Discord, Figma, and others) embed their own Chromium and typically expose CDP automatically. NSP detects them from the process command line — no manual flag required:What Happens When Chrome Closes
If Chrome is closed while NSP is streaming state from it:- The daemon detects the process exit within one scan cycle (default: 5 seconds).
- All active
session.watch()streams for that PID close with aWebSocketClosederror. - When Chrome relaunches with the debug port flag, the daemon re-detects it and creates a new session with a new PID.
- Your agent should call
client.wait_for_app()after reconnecting to handle the new session gracefully.
