I am trying to add a debug configuration that will allow me debug a normal JavaScript application. There is no server-side code or server, just a .html file with vanilla JavaScript.
I would like to be able to use the VS Code debugger, breakpoints, etc. and preview in Internet Explorer 11 by simply pressing F5.
I was able to get my launch.json configuration to run Chrome, but it doesn't seem attach to the process the same way that normal Visual Studio does. I would like to know how to do this with iexplore.exe:
{
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "${file}",
"webRoot": "${workspaceRoot}"
}
]
}
I cannot find any documentation for how to set these values. Everything I've found talks about nodejs. I don't use Node. I'm also not interested in downloading extensions because this is basic stuff and should be configurable being these are both Microsoft products. I'm sure someone has solved this already.
Open the extensions view (ctrl+shift+x) and search for @builtin @id:ms-vscode. js-debug. Right click on the JavaScript Debugger extension and select Switch to Pre-Release Version . Reload VS Code.
The simplest way to debug a webpage is through the Debug: Open Link command found in the Command Palette (Ctrl+Shift+P). When you run this command, you'll be prompted for a URL to open, and the debugger will be attached. If your default browser is Edge, VS Code will use it to open the page.
Simply click the cog icon to open the json file. Here you will see configurations for your setup. name refers to the option inside the debug dropdownlist. processName is the process name to attach to.
The reason you're able to attach to Chrome is that you have a debugger extension installed. There are extensions for Chrome, Firefox, and Edge, but not IE.
If you'd like to use a JavaScript debugger for IE you'll have to install Visual Studio instead. The Community Edition is free if you meet the criteria (personal use, or corporate for learning purposes only).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With