package
Resolve DevToolsActivePort for Chromium-based browsers
npm install devtools-active-portGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Estimated unpacked size across 1 packages.
9.9 kB
Includes dependencies.
Zero-config active DevTools port resolution for Chromium-based browsers.
Opening the WebSocket at DevToolsActivePort automatically triggers a consent dialog users can click through to enable remote debugging on demand. No restart, command line flags or other configuration is necessary, just read the file and go.
Searches default user data directories for Chrome, Edge, Brave, Opera, and others across macOS, Linux, and Windows to parse the active port and WebSocket path. Auto-discovers whatever browser is currently running, or targets a specific browser / profile by name or path.
import resolveDevToolsActivePort from 'devtools-active-port'
// Auto-detect active debugging port across all known browsers
const info = resolveDevToolsActivePort()
// => { port: 9222, path: 'devtools/browser/6b579178-...' }
// Or specify a browser (case, spaces, and hyphens are normalized)
const edgeInfo = resolveDevToolsActivePort('Microsoft Edge')
// Or specify a custom user data directory
const customInfo = resolveDevToolsActivePort({ userDataDir: '/path/to/profile' })Pass an options object or browser name string:
browser: Target a specific browser by name or alias (e.g. 'Google Chrome', 'msedge', 'brave').userDataDir: Path to a custom user data directory containing DevToolsActivePort (overrides browser).If no options are passed, standard paths for all supported browsers are checked in order.
chrome, google-chrome)canary, chrome-canary, chrome-sxs)chromium)edge, msedge, microsoft-edge)brave, brave-browser)arc)vivaldi)opera, operagx)MIT