解决VSCode中Windows 找不到文件‘firefox’。请确定文件名是否正确后,再试一次

步骤:

  1. 右击桌面浏览器快捷方式=》属性=》复制目标中引号的位置
  2. VSCode中点击左下角设置
  3. 搜索‘open in browser’将步骤1复制的粘贴到相应位置
  4. 右击测试一下,如果不行,继续步骤5
  5. ctrl+shift+p打开命令面板,输入Configure Task然后依次操作
  6. 点击‘使用模板创建 tasks.json 文件’
  7. 点击‘’Others 运行任意外部命令的示例‘’,进入tasks.json 文件
  8.  原来代码如下:
    {
        // See https://go.microsoft.com/fwlink/?LinkId=733558
        // for the documentation about the tasks.json format
        "version": "2.0.0",
        "tasks": [
            {
                "label": "echo",
                "type": "shell",
                "command": "echo Hello"
            }
        ]
    }

    对这个代码进行修改,如下:

  9. {
        // See https://go.microsoft.com/fwlink/?LinkId=733558
        // for the documentation about the tasks.json format
    "version": "2.0.0",
        "tasks": [
            {
                "label": "Run HTML file with Firefox",
                "type": "process",
                "command": "firefox",
                "args": [
                    "${file}"
                ],
                "windows": {
                    //这里写你电脑的Firefox浏览器的安装位置
                    "command": "E:/Program Files(x86)/liulanqi/Mozilla Firefox/firefox.exe"
                },
                "group": {
                    "kind": "build",
                    "isDefault": true
                }
            }
        ]
     }

    保存后打开文件,直接右键‘Open In Default Browser’运行就能打开浏览器了。

 

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值