【问题标题】:VS Code debug in Edge Browser json.config explanationVS Code debug in Edge Browser json.config 解释
【发布时间】:2018-07-30 22:32:44
【问题描述】:

谁能告诉我如何使用 Edge 浏览器扩展进行调试?我阅读了文档,但我对 json.config 非常不熟悉,这对我来说毫无意义。我不明白我应该把这个文件放在哪里或者它是如何生成的。

我从 powershell 的角度理解 json.config,因为有一个解释。我似乎无法利用这些知识在浏览器中进行调试。

因为我是这个界面的新手。当我单击调试器中的齿轮时,我得到:

{
"folders": [],
"settings": {}
}

这是 json.config 吗?我真的不确定。

我正在尝试按照此处的说明执行启动模式: https://github.com/Microsoft/vscode-edge-debug

它说把这个放在 json.config 中:

{
"version": "0.1.0",
"configurations": [
    {
        "name": "Launch localhost with sourcemaps",
        "type": "edge",
        "request": "launch",
        "url": "http://localhost/mypage.html",
        "webRoot": "${workspaceRoot}/app/files",
        "sourceMaps": true
    },
    {
        "name": "Launch index.html (without sourcemaps)",
        "type": "edge",
        "request": "launch",
        "file": "${workspaceRoot}/index.html"
    },
]
}

我不知道是否应该清除所有其他设置或将其嵌套在预定义区域之一中。

希望有人能解释一下。

最终我试图让某种形式的 javascript 调试与 SharePoint 一起工作,但现在我只想让插件正常工作。

【问题讨论】:

    标签: javascript debugging sharepoint visual-studio-code


    【解决方案1】:

    我必须观看视频并阅读说明才能弄清楚这一点。该网站确实有它,但我就是不知道在哪里。调试指南有所帮助。

    我的问题是我试图启动一个远程站点,但无法让它工作。我发现它不做远程。文件必须是本地的。

    【讨论】:

      【解决方案2】:

      来自https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_43.md#remote-debugging

      远程调试

      您现在可以从远程工作区(例如 VS Online)调试浏览器代码 或远程 SSH——在新的调试器中。要进行此设置,请将您的端口转发 web 服务器(或使用简单的静态 web 服务器),然后创建一个 指向转发的 chrome 或 pwa-msedge 启动配置 港口。例如:

      {   "version": "0.2.0",   "configurations": [
           {
             "type": "pwa-msedge",
             "request": "launch",
             "name": "Debug my App",
             "url": "http://localhost:5000", // <- debug an app forwarded on port 5000
           }   
        ] 
      } 
      

      当你启动它时,你的机器上会打开一个浏览器,你可以 像平常一样在 VS Code 中进行调试。

      一般请参阅https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_43.md#new-javascript-debugger 和 v1.42 发行说明https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_42.md#new-javascript-debugger

      【讨论】:

        猜你喜欢
        • 2023-03-17
        • 2022-12-28
        • 2019-08-05
        • 1970-01-01
        • 2022-12-02
        • 2022-09-26
        • 2022-01-13
        • 2018-10-08
        • 2018-04-27
        相关资源
        最近更新 更多