突然遇到的vscode打开浏览器一直都是首页的解决问题

配置tasks.json
1.打开VS Code,点击“终端”,选择“配置任务”。
2.选择“使用模板创建tasks.json文件”。
3.选择“Others”。
4.tasks.json新建完成,默认如下图:
5.修改tasks.json
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
“version”: “2.0.0”,
“tasks”: [
{
“label”: “在Chrome中运行”,
“type”: “process”, // [shell,process]
“command”: “Chrome”,
“args”: [“ f i l e " ] , " w i n d o w s " : " c o m m a n d " : " C : / P r o g r a m F i l e s ( x 86 ) / G o o g l e / C h r o m e / A p p l i c a t i o n / c h r o m e . e x e " , " g r o u p " : " b u i l d " , " p r e s e n t a t i o n " : / / R e v e a l t h e o u t p u t o n l y i f u n r e c o g n i z e d e r r o r s o c c u r . " r e v e a l " : " n e v e r " / / [ a l w a y s , n e v e r , s i l e n t ] , / / U s e t h e s t a n d a r d M S c o m p i l e r p a t t e r n t o d e t e c t e r r o r s , w a r n i n g s a n d i n f o s " p r o b l e m M a t c h e r " : " {file}"], "windows": { "command": "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe" }, "group": "build", "presentation": { // Reveal the output only if unrecognized errors occur. "reveal": "never" //[always,never,silent] }, // Use the standard MS compiler pattern to detect errors, warnings and infos "problemMatcher": " file"],"windows":"command":"C:/ProgramFiles(x86)/Google/Chrome/Application/chrome.exe","group":"build","presentation"://Revealtheoutputonlyifunrecognizederrorsoccur."reveal":"never"//[always,never,silent],//UsethestandardMScompilerpatterntodetecterrors,warningsandinfos"problemMatcher":"msCompile”
}
]
}
6.运行任务
选中需要运行的html文件,按住Ctrl+Shift+B,选择“在Chome中运行”,即可。

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值