I'm using Windows 10. According to Microsoft Edge DevTools Protocol docs, I need to launch Edge with the --devtools-server-port cmd line arg.

i tried to do so via Console, but got an error:

'MicrosoftEdge.exe' is not recognized as an internal or external command, operable program or batch file.

After checking out this thread, it turns out that there is apparently some magic with launching Edge by not using standard shortcut in Start menu.

How can we launch Edge with some cmd line args?

  • 1
    See stackoverflow.com/questions/31164253/… – Clayton Apr 27 '18 at 18:20
  • @Clayton: Tried all of those suggestion. While they launch Edge, none seems to be passing --devtools-server-port cmd line arg to it. – Alexander Abakumov Apr 27 '18 at 20:37
  • Are you running an Insider Preview build of windows? From your link The Microsoft Edge DevTools Protocol is currently in preview and works only on Windows Insider Preview builds. – Clayton Apr 27 '18 at 21:23
  • @Clayton: Holy moly, you're right! I'm on the stable version on Win 10. Thank you! – Alexander Abakumov Apr 27 '18 at 21:48
  • @AlexanderAbakumov May I request you to add a formal answer to this thread, if you were able to resolve the problem yourself because of incorrect OS version that you were using. It can be really helpful for future readers who face the same problem. – RBT Aug 25 '18 at 0:05

As pointed by @Clayton in comments to my question, in order to be able to use Microsoft Edge DevTools Protocol you have to make sure you actually have it in your system first. At the moment, this means that you should update your Windows 10 at least to April 2018 Update (version 1803) or later (see the link in my question for reference).

Then, you can launch Edge with DevTools Protocol server enabled by creating a shortcut on your Desktop with the command like this as a Target:

MicrosoftEdge.exe --devtools-server-port 9220 http://localhost:5000

After launching Edge with this shortcut, you now able to connect to Edge, for instance, with Visual Studio Code just like you used to do so to connect to Chrome. Here is a sample of a corresponding setup from launcn.json:

    "type": "edge",
    "request": "attach",
    "name": "Attach to Edge",
    "port": 9220,
    "webRoot": "${workspaceFolder}"

Of course for this to work, you need to have the Debugger for Edge extension installed in VS Code.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.