1.在VS Code中安装Debugger for Firefox插件
2.下载安Firefox Developer Edition
![](https://img-blog.csdnimg.cn/5cd7efb1dcd54ee9a1e4fb0d8bfbbdd3.png)
3. 创建launch.json
![](https://img-blog.csdnimg.cn/b3d1c63236ca4f49bd783177ddc9653c.png)
编辑并保存launch.json
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch MyDraw.html",
"type": "firefox",
"request": "launch",
"reAttach": true,
"file": "${workspaceFolder}/MyDraw.html"
}
]
}
4.开始调试
![](https://img-blog.csdnimg.cn/bf1725f166e541c5b6fd891ec72c0771.png)
![](https://img-blog.csdnimg.cn/7eda068df25149439c227cee5b90a70d.png)
5.设置断点开始调试,html中的javasript的代码也可以调试
![](https://img-blog.csdnimg.cn/4d7bb94c21c84f55a792f6a40c4c4177.png)