Microsoft Edge DevTools Protocol
Developer tools can use the Microsoft Edge DevTools Protocol to inspect and debug the Microsoft Edge browser. It provides a set of methods and events that are organized into different Domains of EdgeHTML engine instrumentation.
Tooling clients can call these methods and monitor these events through JSON web socket messages exchanged with the DevTools Server hosted by Edge or the Windows Device Portal. Microsoft Edge DevTools uses this protocol to enable remote debugging of a host machine running Microsoft Edge from the standalone DevTools client available from the Microsoft Store.
The Microsoft Edge DevTools Protocol is designed to align closely with the Chrome DevTools Protocol (see the W3C WICG for DevTools Protocols), though there are known interoperability gaps in this release.
Using the protocol
Here's how to attach a custom tooling client to the DevTools Server in Microsoft Edge. See the remote debugging instructions if you're using Microsoft Edge DevTools as your client.
Launch Microsoft Edge with the remote debugging port open, specifying the URL you wish to open. For example:
MicrosoftEdge.exe --devtools-server-port 9222 https://www.bing.com
If Edge is already launched, the URL parameter is optional. A button will appear next to the browser address bar to indicate the Developer tools server has started:
Use this HTTP endpoint to get a list of attachable page targets:
Connect to the listed
webSocketDebuggerUrlof the desired page to issue further protocol commands and receive event messages through the devtools socket server.
Status and feedback
The preliminary release (Version 0.1) of the Microsoft Edge DevTools Protocol provides core debugging functionality, such as setting breakpoints, stepping through code, and exploring stack traces. In the Edge DevTools UI, this translates to functionality available in the Debugger panel, minus cache inspection (for Web storage, Service worker, Cache API, and IndexedDB).
Further platform instrumentation will be available in future releases of the protocol.
Thanks for trying the Edge DevTools Protocol! We'd love to hear your feedback at:
Microsoft Edge Developer UserVoice: DevTools feature ideas and requests
EdgeHTML Issue Tracker: Protocol, DevTools, and EdgeHTML platform bugs and issues
Microsoft Edge DevTools Feedback Hub: Protocol and DevTools problems and suggestions through the Feedback Hub app
Can multiple clients connect to the same DevTools Server?
No, not simultaneously when the clients are debugging. The last client to connect will kick off the previous one. In the future when additional tools are supported, those will likely support simultaneous client connections.
Do I have to use 9222 as the DevTools Server port?
No. You can specify any port, though be sure to pick one that isn't already in use. Port 9222 for remote debugging is used by convention.
How do I connect my custom tooling client to Microsoft Edge running the DevTools Server?
See Using the protocol instructions above for attaching to Edge running on the local machine. If you're looking to support remote debugging, you'll need to devise a user workflow for installing the host machine's SSL certificate on the client, for example with an install dialog as Microsoft Edge DevTools Preview uses.
If I'm remote debugging using Edge DevTools, do I need to start the host browser process with --devtools-server-port cmd line switch?
No. If you're setting up remote debugging using Microsoft Edge DevTools Preview, the
--devtools-server-port command line switch is not necessary for starting Edge. In this case, Windows Device Portal is hosting the DevTools Server on behalf of the browser.
Can I use the Edge DevTools Protocol to remotely debug a WWAHost.exe or webview process?
Not yet, but stay tuned...